Hi,
I have an .NET 3.5 application, which have a server socket. The connecting clients are handled using functions BeginAcceptTcpClient and EndAcceptTcpClient. Old version of the application have worked fine and served TCP clients without problems. But, now when the protocol an other socket connection that the application uses have changed, the server socket serves a few clients without error and then BeginAcceptTcpClient rises exception WSANOTINITIALISED (10093). The code of the server socket have not changed, and the changes in the the other socket connection is that it started using OpenSSL (new DLLs ssleay32.dll and libeay32.dll). The implementation of the protocol and the changes was made by an other company, and I don't have the source codes.
Detailed description of the exception is:
Successful WSAStartup not yet performed.
Either the application has not called WSAStartup or WSAStartup failed. The application may be accessing a socket that the current active task does not own (that is, trying to share a socket between tasks), or WSACleanup has been called too many times.
But, our application code doesn't have any WSAStartup or WSACleanup calls.
Stack Trace when the exception occurs:
System.Net.Sockets.SocketException: Either the application has not called WSAStartup, or WSAStartup failed
at System.Net.Sockets.Socket..ctor(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
at System.Net.Sockets.Socket.DoBeginAccept(Socket acceptSocket, Int32 receiveSize, AcceptOverlappedAsyncResult asyncResult)
at System.Net.Sockets.Socket.BeginAccept(Socket acceptSocket, Int32 receiveSize, AsyncCallback callback, Object state)
at System.Net.Sockets.Socket.BeginAccept(AsyncCallback callback, Object state)
at System.Net.Sockets.TcpListener.BeginAcceptTcpClient(AsyncCallback callback, Object state)
So, what could corrupt the sever socket that way? Has anybody seen this kind server socket malfunction before? Is there some good way to trace WSACleanup calls, if those cause the problem?