News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Security Library Forum
 
Deadlocks using SecureSocket  
by John Doty
posted on 2003/08/17


A client using a SecureSocket can get itself into a deadlock quite easily if it does a synchronous send from the callback of an asynchronous receive.

That is if you do something like:

SecureSocket ss = ...;
void SetupReceive()
{
ss.BeginReceive(ReceiveCallback);
}

void ReceiveCallback(IAsyncResult result)
{
ss.Send(new byte[] {...});
}

then the Send() will deadlock and never complete. The reason for this is that the ReceiveCallback is called from SocketController.OnReceive (via ProcessDecryptedBytes) while holding the lock on the SocketController. Thus, when EndSend() tries to take the lock to complete the send, it cannot.

Is this going to be fixed soon?

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2003/08/17

Thanks, we've uploaded a new version of the library that fixes this deadlock problem. You can download it from http://www.mentalis.org/soft/projects/seclib/download.qpx

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.