} // Demo private static void SampleShell(Reader reader) { byte[] b = new byte[1]; while (TerminalDemo.ConnectionStatus > 0 && _conn.IsOpen) { int input = System.Console.Read(); b[0] = (byte)input; reader._pf.Transmit(b); } _conn.Disconnect(""); //_conn.Close(); //Close TCP-Socket directly }
/// <summary> /// Send a SSH logout-response /// </summary> /// <param name="synchronous">Send synchronously (true) or asynchronously (false)</param> /// <returns></returns> public bool SendLogout(bool synchronous) { try { if (synchronous) { _conn.Disconnect(""); } else { _conn.Close(); //Close TCP-Socket directly } return(true); } catch { return(false); } } // sendLogout