/// <summary> /// Disconnects the client from any established connections. /// </summary> public void Disconnect() { var noDelay = MainSocket.NoDelay; MainSocket.Dispose(); MainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) { NoDelay = noDelay }; }