Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sockets and sleep

Status
Not open for further replies.

Smarty

Programmer
Apr 12, 2001
191
BE
I'm trying to work with sockets, but it doesn't work properly. When I try to send 2 things, they arrive as 1. I tried with a Sleep() between it, but this didn't work as well. Does any1 knows what to do?

send(s1, "Hello!\r\n", 8,0);
Sleep(1000);

Thanx,

Smarty
 
Hi

You're are not very explicit about your code but ..
If you are using the CSocket class of MFC, then there surely is no need to wait ... In fact, you'd better let the system works as fast as possible to give it any opportunity to receive and handle any messages send by the sockets.

The CSocket uses a serialization of the data to send and simple user-defined messages. All is really handled by the sockets, your job is simply to process the messages.
Look at MSDN samples ....

HTH

Thierry
EMail: Thierry.Marneffe@swing.be
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top