OnDisconnected event is being run twice.

Mar 29, 2011 at 1:34 PM
Edited Mar 29, 2011 at 1:35 PM

In file NetBaseClient.cs line 132 "stream.Stop()" run Disconnect (NetStoppedReason reason) again.

Before
protected void Disconnect(NetStoppedReason reason)
{
if (!IsConnected)
return;

stream.Stop();
tcp.Close();

IsConnected = false;
if (OnDisconnected != null)
OnDisconnected(this, new NetDisconnectedEventArgs(reason));
}


Now
protected void Disconnect(NetStoppedReason reason)
{
if (!IsConnected)
return;

IsConnected = false;

stream.Stop();
 tcp.Close();

if (OnDisconnected != null)
OnDisconnected(this, new NetDisconnectedEventArgs(reason));
}