public TelnetConnection(string InHostname, int InPort) { mSock = new TcpClient(InHostname, InPort); // socket is now ready to send and receive. Clear the disconnected signal. IsDisconnectedSignal.Reset(); }
public void Disconnect() { if (IsDisconnectedSignal.State == false) { try { mSock.Client.Disconnect(false); } catch (SocketException) { } IsDisconnectedSignal.Set(); } }