News  [SoftwareSite

Latest News
Older News
RSS Feed
Complete Projects
Useful Classes
Top Downloads
Message Board
Send Comments
Software License Buttons
Forums -> Security Library Forum
Hang in shutdown  
by Frederic Rouyre [rfr at inter-land dot net]
posted on 2004/01/28

First, a big thanks for this great library. Well, at least, there is a big potential :)

Indeed, it seems I have a deadlock problem in the library.

I'm using the lastest version.

My application is a mutli-threaded tunnel manager, that use asynchronous network communications (through a SecureNetworkStream).

After a certain "amount" of connection (when running as a service, I would say 5 -> the number of working thread), all my apps is blocked, in read (/shutdown?) calls (i do not receive read termination callbacks).

I looked in the board and saw similar problems.

Do you have an idea or an plan for a correction?

Thanks a lot!

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2004/03/06

Have you synchronized your code? Keep in mind that asynchonous calls have to be synchronized because they can interrupt each other.
If you have synchronized your code, can you send me a small example application that shows the problem you're seeing? We haven't been able to reproduce this particular issue.

by A.G. Neville [agneville at rogers dot com]
posted on 2004/08/02

I am having a similar problem.

The server side receives all the data on a socket, calls Shutdown(Both), then Close().... but it hangs on the call to Shutdown. The client app is not writing to the socket at this time.

The app works fine if I use the non-secure VirtualSocket, and also if I simply remove the Shutdown and just execute Close.

I was not sure what you ment by 'synchronized your code', so I probably have not done that.

Any thoughts? Build

(PS Nice work on this library!)

by Stefan Bernbo [stefan at bernbo dot com]
posted on 2004/08/08

I have the exact same problem. My application is run as a service and it hangs (deadlock) on shutdown. The problem only appears if the socket is in secure mode.
There is no stress on the application and no synchronization problems. SecureSocket version is
Has anyone seen a solution on this?

This is where the deadlock is:

mscorlib.dll!System.Threading.WaitHandle.WaitOne() + 0x57 bytes!Org.Mentalis.Security.Ssl.SecureSocket.EndShutdown(System.IAsyncResult asyncResult) + 0x26 bytes!Org.Mentalis.Security.Ssl.SecureSocket.Shutdown(System.Net.Sockets.SocketShutdown how) + 0x19 bytes


Copyright © 2002-2007, The Team. All rights reserved.
This site is located at
Send comments to the webmaster.