public void Disconnect()
{
try
{
//while (Receiving) Thread.Sleep(10);
if (!this.disposed)
{
if (this.Sock != null && this.Sock.Connected)
{
onClientDisconnected(this, new ClientEventArgs(this));
this.Sock.Close();
//this.Sock = null;
return;
}
else
onClientDisconnected(this, new ClientEventArgs(this));
this.Dispose();
}
}
catch { }
}