DF> For instance, we've found that when our Windows code calls
DF> closesocket() on a SOCK_STREAM socket (but not on a SOCK_DGRAM socket),
DF> wineserver refuses to actually close and release the socket for several
DF> minutes, so if you stop our app, you can't start it for several
DF> minutes, or its bind() or listen() call will fail because the socket we
DF> closed still exists and still owns the port.

If this happens only with SOCK_STREAM sockets, then maybe your app has
data pending to be sent when it calls closesocket(). If you want that
pending data to be sent, call shutdown() to close the connection
before calling closesocket(). If you don't care about that data, just
call WSACleanup() before your app exits. WSACleanup() should free all
socket resources regardless of their state.

Good luck;)
Attila


Reply via email to