コード例 #1
0
        //establishes a SSH connection in subject to ConnectionParameter
        public static SSHConnection Connect(SSHConnectionParameter param, ISSHConnectionEventReceiver receiver, Socket underlying_socket)
        {
            if (param.UserName == null)
            {
                throw new InvalidOperationException("UserName property is not set");
            }
            if (param.Password == null)
            {
                throw new InvalidOperationException("Password property is not set");
            }

            ProtocolNegotiationHandler pnh = new ProtocolNegotiationHandler(param);
            PlainSocket s = new PlainSocket(underlying_socket, pnh);

            s.RepeatAsyncRead();
            return(ConnectMain(param, receiver, pnh, s));
        }
コード例 #2
0
        //establishes a SSH connection in subject to ConnectionParameter
        public static SSHConnection Connect(SSHConnectionParameter param, ISSHConnectionEventReceiver receiver, Socket underlying_socket)
        {
            if(param.UserName==null) throw new InvalidOperationException("UserName property is not set");
            if(param.Password==null) throw new InvalidOperationException("Password property is not set");

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