client socket disconnect  
Author Message
kishoremsn





PostPosted: .NET Framework Networking and Communication, client socket disconnect Top

Hi,

I am doing socket communication in asp.net using c#. I can able to connect to the client using socket programming. when i am disconnecting means socket.disconnect(false) then i am getting some an exception like "feature requires windows xp or later". as i am using windows 2000 professional. what is the exception




.NET Development28  
 
 
IanG





PostPosted: .NET Framework Networking and Communication, client socket disconnect Top

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.)


 
 
carlengerer





PostPosted: .NET Framework Networking and Communication, client socket disconnect Top

I too have had this problem on a windows 2000 machine (service pack 4). The mystery is that the documentation (link below) actually SAYS that it is supported.. !

msdn2.microsoft.com/en-us/library/system.net.sockets.socket.begindisconnect.aspx