Exemplo n.º 1
0
 public static TelnetHandlerSet Default(TokenStream tokenStream)
 {
     return(new TelnetHandlerSet(tokenStream,
                                 TelnetHandler.QMethodDisagreeingHandler,
                                 TelnetHandler.QMethodAgreeingHandler(Option.SuppressLocalEcho),
                                 new EchoHandler()));
 }
Exemplo n.º 2
0
        private void ProcessInput(HandlerStateInput input, TelnetHandler handler)
        {
            var transition = _table[( int )_state, ( int )input];

            if (transition != null)
            {
                _state = transition.Execute(handler);
            }
        }
Exemplo n.º 3
0
        public virtual void SendCommand(Command command, TelnetHandler handler)
        {
            var input = CommandToInput(CommandDirection.Sent, command);

            ProcessInput(input, handler);
        }
Exemplo n.º 4
0
        public virtual void ReceiveCommand(Command command, TelnetHandler handler)
        {
            var input = CommandToInput(CommandDirection.Received, command);

            ProcessInput(input, handler);
        }
Exemplo n.º 5
0
 private void AddHandler(TelnetHandler handler)
 {
     _handlers.Add(handler.Option, handler);
     handler.TokenStream = _tokenStream;
 }