public void Disconnect(SocketError error)
{
// disconnect may not throw any exceptions
try
{
_stream.Close();
}
catch (Exception err)
{
_log.Write(this, LogPrio.Error, "Disconnect threw an exception: " + err);
}
if (_disconnectHandler != null)
_disconnectHandler(this, error);
}