示例#1
0
        public void Start()
        {
            TcpListener tcpListener = new TcpListener(address, port);

            tcpListener.Start();

            // Keep processing inbound connections ..
            while (true)
            {
                Console.WriteLine("Waiting for a connection on {0}, port {1} ... ", address ,port);

                TcpClient tcpClient = tcpListener.AcceptTcpClient();

                TelnetServer telnetServer = new TelnetServer(tcpClient, password);

                Thread backgroundThread = new Thread(new ThreadStart(telnetServer.Connect));
                backgroundThread.Start();

                Console.WriteLine("Connected {0}", backgroundThread.ManagedThreadId);
            }
        }
示例#2
0
        public void Start()
        {
            TcpListener tcpListener = new TcpListener(address, port);

            tcpListener.Start();

            // Keep processing inbound connections ..
            while (true)
            {
                Console.WriteLine("Waiting for a connection on {0}, port {1} ... ", address, port);

                TcpClient tcpClient = tcpListener.AcceptTcpClient();

                TelnetServer telnetServer = new TelnetServer(tcpClient, password);

                Thread backgroundThread = new Thread(new ThreadStart(telnetServer.Connect));
                backgroundThread.Start();

                Console.WriteLine("Connected {0}", backgroundThread.ManagedThreadId);
            }
        }