Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

winsock best way to call closesocket

0 views
Skip to first unread message

Mubashir Khan

unread,
Dec 29, 2009, 11:17:01 PM12/29/09
to
We are using winock 2.2 in one of our client server application. while we are
about to close the socket we use this logic.

while(!closesocket(s)) sleep(200);

is this the right way to call the winsock closeocket.

thanks
Mubashir

mosesvas

unread,
Dec 30, 2009, 2:21:26 AM12/30/09
to
On Dec 30, 9:17 am, Mubashir Khan

There shouldn't be any pending send at the time of close otherwise
underlying TCP connection sends reset to the other end. Read the below
link for graceful connection close
http://msdn.microsoft.com/en-us/library/ms738547(VS.85).aspx

0 new messages