why CAsyncSocket always failed while Connect()???
-
:eek:I am trying to use CAsyncSocket to connect to the server and wrote the code below: ... CAsyncSocket asocket; asocket.Create();//ok asocket.Connect("server",999);//always failed ... can anyone tell me what's the reason and how to resolve this problem. thanks a lot.
-
:eek:I am trying to use CAsyncSocket to connect to the server and wrote the code below: ... CAsyncSocket asocket; asocket.Create();//ok asocket.Connect("server",999);//always failed ... can anyone tell me what's the reason and how to resolve this problem. thanks a lot.
-
:eek:I am trying to use CAsyncSocket to connect to the server and wrote the code below: ... CAsyncSocket asocket; asocket.Create();//ok asocket.Connect("server",999);//always failed ... can anyone tell me what's the reason and how to resolve this problem. thanks a lot.
-
thanks for your reply, the error code is 10035 but i want to know what's the difference between CAsyncSocket and CSocket. can you plz told me about that? many many thanks
CSocket does work blocking (with background processing of Windows messages), CAsyncSocket does not block. That's why you get error 10035 "A non-blocking socket operation could not be completed immediately". You should read example code to study CAsnycSocket's concept. In your case you would override
OnConnect()
handler. -
CSocket does work blocking (with background processing of Windows messages), CAsyncSocket does not block. That's why you get error 10035 "A non-blocking socket operation could not be completed immediately". You should read example code to study CAsnycSocket's concept. In your case you would override
OnConnect()
handler. -
CSocket does work blocking (with background processing of Windows messages), CAsyncSocket does not block. That's why you get error 10035 "A non-blocking socket operation could not be completed immediately". You should read example code to study CAsnycSocket's concept. In your case you would override
OnConnect()
handler.