コード例 #1
0
 public SSHChannel OpenShell(ISSHChannelEventReceiver receiver)
 {
     _channel_entry = new TelnetChannel(this, socket, receiver);
     TelnetPacketBuilder pb = new TelnetPacketBuilder(receiver);
     PlainSocket ps = new PlainSocket(socket, pb);
     ps.RepeatAsyncRead();
     return _channel_entry;
 }
コード例 #2
0
        //establishes a SSH connection in subject to ConnectionParameter
        public static SSHConnection Connect(SSHConnectionParameter param, ISSHConnectionEventReceiver receiver, StreamSocket underlying_socket)
        {
            if (param.UserName == null) throw new InvalidOperationException(resLoader.GetString("UsernameUnset"));
            if (param.Password == null) throw new InvalidOperationException(resLoader.GetString("PasswordUnset"));

            ProtocolNegotiationHandler pnh = new ProtocolNegotiationHandler(param);
            PlainSocket s = new PlainSocket(underlying_socket, pnh);
            s.RepeatAsyncRead();
            return ConnectMain(param, receiver, pnh, s);
        }