Esempio n. 1
0
        public Shell(
            ICommandScheduler <JupyterRequestContext> scheduler,
            ConnectionInformation connectionInformation)
        {
            if (connectionInformation == null)
            {
                throw new ArgumentNullException(nameof(connectionInformation));
            }

            _scheduler = scheduler ?? throw new ArgumentNullException(nameof(scheduler));

            _shellAddress   = $"{connectionInformation.Transport}://{connectionInformation.IP}:{connectionInformation.ShellPort}";
            _ioPubAddress   = $"{connectionInformation.Transport}://{connectionInformation.IP}:{connectionInformation.IOPubPort}";
            _stdInAddress   = $"{connectionInformation.Transport}://{connectionInformation.IP}:{connectionInformation.StdinPort}";
            _controlAddress = $"{connectionInformation.Transport}://{connectionInformation.IP}:{connectionInformation.ControlPort}";

            var signatureAlgorithm = connectionInformation.SignatureScheme.Replace("-", string.Empty).ToUpperInvariant();

            _signatureValidator = new SignatureValidator(connectionInformation.Key, signatureAlgorithm);
            _shell       = new RouterSocket();
            _ioPubSocket = new PublisherSocket();
            _stdIn       = new RouterSocket();
            _control     = new RouterSocket();

            _shellSender = new MessageSender(_shell, _signatureValidator);
            _ioPubSender = new MessageSender(_ioPubSocket, _signatureValidator);

            _disposables = new CompositeDisposable
            {
                _shell,
                _ioPubSocket,
                _stdIn,
                _control
            };
            _messageBuilder = new MessageBuilder();
        }
Esempio n. 2
0
 public RequestHandlerStatus(Header requestHeader, MessageSender messageSender)
 {
     _requestHeader  = requestHeader;
     _messageSender  = messageSender;
     _messageBuilder = new MessageBuilder();
 }