예제 #1
0
        static void Main()
        {
            _configuration = ReadConfiguration();
            string host = _configuration["tcp:host"];
            int    port = int.Parse(_configuration["tcp:port"]);

            using (var tcpServer = new TcpServer(host, port))
            {
                tcpServer.Start();
                tcpServer.ClientConnected += Listen;
                Console.WriteLine("Press enter to exit");
                Console.ReadKey();
            }
        }
예제 #2
0
 public void Start()
 {
     tcpServer = new TcpServer(IPAddress.Any, Port);
     tcpServer.Start();
     tcpServer.BeginAcceptTcpClient(new System.AsyncCallback(OnAccept), tcpServer);
 }