Re: CAsyncSocket connect problem
mmlab_js wrote:
As the message says, WSAEWOULDBLOCK means there will be a delay, and is
a normal part of socket communication. CAsyncSocket is designed to
return to you with this code so your application can continue doing
other things during the delay. Your override of OnConnect, OnSend or
OnReceive will be called when the socket delay has cleared. OnConnect
gives you the result of a connection attempt. OnSend means you can try
sending now. OnReceive means there is some incoming data available now.
Scott McPhillips [VC++ MVP]
I get the point and solve this problem. Thank you.
But what is the meaning of "socket delay"??
TCP/IP provides handshaking to manage reliable data flow. Both sender
and receiver must be willing and ready. A slow or busy receiving
machine can require a fast sender to slow down. You see the same delays
all the time while surfing the web.
For send: All buffers are full locally, or waiting for an acknowledge
from the receiving end.
For receive: No data has been received since your last call to Receive.
For connect: Awaiting answer from server.
--
Scott McPhillips [VC++ MVP]