/// <summary> /// Disconnects from the current server and closes the connection. /// Does nothing if the client is not connected. /// </summary> public override void Disconnect() { DisconnectInternal(context); while (true) { if (context.WasExit) { break; } dispatcher.DoWork(); if (!context.WasExit) { Thread.Sleep(1); } } }
/// <summary> /// Disconnects from the current server and closes the connection. /// Does nothing if the client is not connected. /// </summary> public override void Disconnect() { TsEventHandler.Clients = new Dictionary <ClientIdT, ClientData>(); DisconnectInternal(context); while (true) { if (context.WasExit) { break; } dispatcher.DoWork(); if (!context.WasExit) { Thread.Sleep(1); } } }