PDA

View Full Version : Asynchronously use connect() API


Syrinx
04-06-2006, 09:42 AM
socket DataSocket = socket(AF_INET,SOCK_STREAM,0);
WSAAsyncSelect(DataSocket, Window, WM_TCPDATASOCKET,FD_CONNECT|FD_READ|FD_WRITE|FD_CL OSE);
connect(DataSocket, (const SOCKADDR *)&ServerAddress,sizeof(ServerAddress));

normally,the default time out for connect() is over 10 seconds,any way I can control the time out at 5 seconds other than 10+ seconds.

Thx

FTPServerTools
04-06-2006, 05:32 PM
How about using setsockopt? I mean you can set the timeout time with that function.

Syrinx
04-07-2006, 03:19 PM
not work on that situation