.NET Framework Bookmark and Share   
 index > Network Class Library (System.Net) > All writes on all sockets hanging after BeginWrite on network streams.
 

All writes on all sockets hanging after BeginWrite on network streams.

I'm facing a problem which has got me puzzled. I've got a custom network server application which is accepting sockets which are wrapped by NetworkStreams and then wrapped by SslStreams. All communication is being done asynchronously using Begin/End calls, and everything is working perfectly almost all of the time.

However, a few times per day, all at the same time the writes on open sockets do not complete. The BeginWrite call returns, but then the async callback is never called back. I've added in a timeout on the wait handle which closes the socket if the write doesn't complete within a given time, and when this happens, all of the connections are re-established and everything works again.

It looks like everything is blocking on a single resource here, but my code is not doing anything at this point. It's called BeginWrite on the SSL stream, and it's just waiting for a IOCP thread to call back.

Paul
  •  
pgrebenc
Hi Paul,

Can you provide us with a code snippet please?
Jovana Florus

You can use google to search for other answers

Custom Search

More Threads

• An established connection was aborted by the software in your host machine
• How to Find Unique IP
• Problem with DNS resolving using TcpClient.Connect()
• Problem in using SslStream
• System.Net.Mail AlternateViews losing plain text data
• HttpWebRequest problem.
• Multiple HTTP Requests with HttpWebRequest
• Error in Simple Client FTP
• How to locate Live Server URL
• Sending alot of messages to private MSMQ taking a long time