I have a little problem with connect when the host isnt listening..

As i think i'm using a blocking model , the connect call doesnt return, and
i need tho continue execution.

how can I solve easily this?





invoke connect,sock,addr sin,sizeof sin
.if eax!=SOCKET_ERROR
invoke send,sock,addr GET,SIZEOF GET,0
.while sizetoread==0
invoke Sleep, 1
invoke ioctlsocket,sock,FIONREAD,addr sizetoread
.if sizetoread!=0
invoke recv,sock,addr buff,sizetoread,0
Print buff
.endif
.EndW
.endif


thanks
Posted on 2004-09-21 06:29:43 by MaRi
extra threads + blocking sockets, or async sockets (traditional select() method or WSAAsyncSelect or WSAEventSelect). Have a look at www.madwizard.org ?
Posted on 2004-09-21 07:26:36 by f0dder