internal CallbackSSH1PacketHandler(SSH1Connection con) { _connection = con; }
private static SSHConnection ConnectMain(SSHConnectionParameter param, ISSHConnectionEventReceiver receiver, ProtocolNegotiationHandler pnh, AbstractSocket s) { pnh.Wait(); if(pnh.State!=ReceiverState.Ready) throw new SSHException(pnh.ErrorMessage); string sv = pnh.ServerVersion; SSHConnection con = null; if(param.Protocol==SSHProtocol.SSH1) con = new SSH1Connection(param, receiver, sv, SSHUtil.ClientVersionString(param.Protocol)); else con = new SSH2Connection(param, receiver, sv, SSHUtil.ClientVersionString(param.Protocol)); s.SetHandler(con.PacketBuilder); SendMyVersion(s, param); if(con.Connect(s)!=AuthenticationResult.Failure) return con; else { s.Close(); return null; } }
internal CallbackSSH1PacketHandler(SSH1Connection con) { _connection = con; }