Hi there,

I downloaded a tutorial which consisted of a client program and a server program.

The server creates a socket which ends up at the 'accept' function and, apart from error checking code, the next statement it runs is 'recv'. It then shows a received message in a message box.

The client 'connect's to the server and then 'send's some data.

Pretty simple stuff and it works.

Now, when I try to re-create the program in a console app, the message box doesn't show the message.

I stepped through my client program and found that the server puts the message box up upon the client's 'connect'ion and so it has run the 'recv' function before the message has even been sent.

I did the same with the tutorial version and the message box doesn't appear until the client's 'send' function has been called! It seems to remain blocked on 'accept'.

Why won't my server wait?

Posted on 2002-04-20 16:42:15 by Station
Is that tutorial available online somewhere? That would help answering your question.

Posted on 2002-04-20 16:51:24 by Thomas
Thanks for your reply.

Hey, whilst copying and pasting my code into this reply I saw my mistake.

I was calling 'recv' with the socket doing the listening rather than the one returned from 'accept'. :tongue:

Posted on 2002-04-20 18:05:18 by Station