示例#1
0
        public SessionRequestedArgs(SessionChannel channel, String command, UserauthArgs userauthArgs)
        {
            Contract.Requires(channel != null);
            Contract.Requires(command != null);
            Contract.Requires(userauthArgs != null);

            Channel              = channel;
            CommandText          = command;
            AttachedUserauthArgs = userauthArgs;
        }
示例#2
0
        private void HandleMessage(SessionOpenMessage message)
        {
            var channel = new SessionChannel(
                this,
                message.SenderChannel,
                message.InitialWindowSize,
                message.MaximumPacketSize,
                (uint)Interlocked.Increment(ref _serverChannelCounter));

            lock (_locker)
                _channels.Add(channel);

            var msg = new SessionOpenConfirmationMessage();

            msg.RecipientChannel  = channel.ClientChannelId;
            msg.SenderChannel     = channel.ServerChannelId;
            msg.InitialWindowSize = channel.ServerInitialWindowSize;
            msg.MaximumPacketSize = channel.ServerMaxPacketSize;

            _session.SendMessage(msg);
        }