/// <summary> /// Create an authentication protocol instance /// </summary> /// <param name="transport"></param> /// <param name="connection"></param> public AuthenticationProtocol(TransportProtocol transport, ConnectionProtocol connection) { this.transport = transport; this.connection = connection; transport.StartService(SERVICE_NAME); }
/// <summary> /// Connect to an SSH server. This method is not designed to be called directly but from /// an <see cref="Maverick.SSH.SSHConnector"/> instance. /// </summary> /// <param name="io">The underlying transport mechanism</param> /// <param name="context">The configuration context for this connection</param> /// <param name="connector">The connector creating this client</param> /// <param name="username">The username for the connection</param> /// <param name="localIdentification">The identification string sent to the server</param> /// <param name="remoteIdentification">The identification string received from the server</param> /// <param name="threaded">Should this connection use an additional thread to buffer messages</param> public void Connect(SSHTransport io, SSHContext context, SSHConnector connector, System.String username, System.String localIdentification, System.String remoteIdentification, bool threaded) { FireEvent(SSHState.CONNECTING); this.context = (SSH2Context)context; this.con = connector; this.io = io; this.threaded = threaded; this.username = username; this.localIdentification = localIdentification; this.remoteIdentification = remoteIdentification; this.transport = new TransportProtocol(io, this); this.transport.StateChange += new TransportProtocolStateChangeEvent(this.OnTransportEvent); this.transport.StartProtocol(); FireEvent(SSHState.CONNECTED); this.connection = new ConnectionProtocol(transport, threaded); this.connection.AddChannelFactory(requestFactory); this.authentication = new AuthenticationProtocol(transport, connection); RequestAuthenticationMethods(); }
internal virtual void Init(ConnectionProtocol connection, int channelid) { this.connection = connection; base.Init(connection, channelid, connection.Context); }