Solved

Need socket example

Posted on 2006-10-19
2
321 Views
Last Modified: 2008-02-01
Hi, having alot of problems with async sockets and have kind of given up. If anyone can create a small sample of these features, points are yours.

I need a console application that is able to open up 2 connections to 2 _different_ servers, at the same time.

One should run on a thread and send "PING" to the server, once every xx seconds.
The other should just run normally as I'm expected to send commands to the stream - written from the console.

I don't mind what you use, TcpClient or Socket, aslong as both connections to the server's running until I close the application.

Some of the problems i'm having is doing while loops to keep reading for data, I always end up with only 1 line of data, then not being able to read anymore.

I've tried the async client socket example from MSDN, but it won't give a reply back. Server is sending '\0' char at the end I believe.

Thanks!
0
Comment
Question by:valvet
2 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 500 total points
ID: 17769307
Did you read this sample:
http://www.microsoft.com/downloads/details.aspx?familyid=08e3d5f8-033d-420b-a3b1-3074505c03f3&displaylang=en

Asynchronous socket chat sample can be found in the CSharp.msi file - download and install it. It is quite simple and can help to write your own code. And it is really working.
0
 

Author Comment

by:valvet
ID: 17769663
Great resource. Have not seen that before.

Thank you!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now