Exemple #1
0
        /// <summary>
        /// Instantiates a new transport layer abstraction. This will block until
        /// the initial key exchange completes, leaving you with a ready-to-use
        /// transport session.
        /// </summary>
        /// <param name="host"></param>
        /// <param name="options"></param>
        public Session(string host, SessionOptions options)
        {
            this.Host = host;
            this.Port = options.Port ?? DefaultPort;

            this.Options = options;

            Trace.TraceWarning("establishing connection to {0}:{1}", this.Host, this.Port);
            var factory = options.Proxy ?? ConnectFactory;

            if(options.Timeout != null)
                throw new NotSupportedException("Timeout is not currently supported");

            var socket = Timeout.Wait(options.Timeout ?? 0, () => factory(this.Host, this.Port));

            Trace.TraceInformation("Connection established.");

            this.HostKeyVerifier = SelectHostKeyVerifier(options.Paranoid);

            this.ServerVersion = new ServerVersion(socket);

            this.Algorithms = new Algorithms(this, options);

            Wait(() => this.Algorithms.IsInitialized);
        }
Exemple #2
0
 public Algorithms(Session session, SessionOptions options)
 {
     throw new NotImplementedException();
 }