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
 
Crash in SocketController  
by Demez Christophe [cdemez2 at hotmail dot com]
posted on 2006/01/24

Hi,

I got a NullReferenceException in the class SocketController in the method:

TransferItem EndReceive(IAsyncResult ar)

at the line :
if (ar != m_ActiveReceive.AsyncResult)

the "ActiveReceive" is null !

What I do in my program:
-------------------------
I call "ChangeSecurityProtocol" during usage. Maybe I have something to synchronize, but really I understand nothing about theses classes code !

Can you help me ?

Thanks

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2006/01/24

It appears you are executing the method Receive (or BeginReceive/EndReceive) while calling ChangeSecurityProtocol. You shouldn't do this (cfr remarks section in the documentation of ChangeSecurityProtocol).

by Demez Christophe [cdemez2 at hotmail dot com]
posted on 2006/01/24

You're right...

The problem is that one thread call
BeginReceive to continue listening on the socket.

After, another thread process the message and detect that we must use TLS.

How can I stop the previous BeginReceive before change security procotol ?

Thanks for your help

 

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