コード例 #1
0
        public void T00_TelnetSuccess()
        {
            ProtocolServiceTestPlugin.Instance.Reset();

            ITCPParameter tcp = _protocolService.CreateDefaultTelnetParameter();

            tcp.Destination = GetTelnetConnectableHost();
            Assert.AreEqual(23, tcp.Port);

            ResultCallback client = new ResultCallback();
            IInterruptable t      = _protocolService.AsyncTelnetConnect(client, tcp);

            client.AssertSuccess();

            ProtocolServiceTestPlugin.Instance.AssertSuccess();
        }
コード例 #2
0
        /// <summary>
        /// Establishes the connection to the remote server; initializes a <see cref="ITCPParameter"/> with the connection properties from
        /// <see cref="BaseConnectionForm{T}.Connection"/> and then calls <see cref="IProtocolService.AsyncTelnetConnect(IInterruptableConnectorClient, ITCPParameter)"/>
        /// to start the connection process.
        /// </summary>
        public override void Connect()
        {
            ITCPParameter tcpParameters = PoderosaProtocolService.CreateDefaultTelnetParameter();

            tcpParameters.Destination = Connection.Host;
            tcpParameters.Port        = Connection.Port;

            PoderosaProtocolService.AsyncTelnetConnect(this, tcpParameters);
        }
コード例 #3
0
        //TODO シリアル用テストケースは追加必要。CygwinはTelnetと同じなのでまあいいだろう

        //TODO ITerminalOutputのテスト。正しく送信されたかを確認するのは難しい感じもするが

        //TODO Reproduceサポートの後、SSH2で1Connection-複数Channelを開き、個別に開閉してみる

        private ITerminalConnection CreateTelnetConnection()
        {
            ITCPParameter tcp = _protocolService.CreateDefaultTelnetParameter();

            tcp.Destination = UnitTestUtil.GetUnitTestConfig("protocols.telnet_connectable");
            Debug.Assert(tcp.Port == 23);

            ISynchronizedConnector sc  = _protocolService.CreateFormBasedSynchronozedConnector(null);
            IInterruptable         t   = _protocolService.AsyncTelnetConnect(sc.InterruptableConnectorClient, tcp);
            ITerminalConnection    con = sc.WaitConnection(t, 5000);

            //Assert.ReferenceEquals(con.Destination, tcp); //なぜか成立しない
            Debug.Assert(con.Destination == tcp);
            _rawsocket    = ((InterruptableConnector)t).RawSocket;
            _testReceiver = new TestReceiver();
            con.Socket.RepeatAsyncRead(_testReceiver);
            return(con);
        }