Any particular reason you're using Disconnect rather than Close
I think Disconnect is a wrapper on top of the DisconnectEx API in Winsock, which is not available in Windows 2000. That would explain the problem. You're running on an OS that doesn't support the operation you're trying to perform!
If all you want to do is sever the connection, then Close is what you want. Disconnect implies more than just ending the connection - it ends it in such a way that you can then reuse the Socket object for the next connection. (This can improve the scalability under certain load patterns.)
|