Exemplo n.º 1
0
        static void Main(string[] args)
        {
            serverHandler = new TcpServer(300, 1024);

            serverHandler.Init();
            serverHandler.ServerStopedEvent += m_socket_ServerStopedEvent;


            int  port    = 50000;
            bool isStart = serverHandler.Start(new IPEndPoint(IPAddress.Any, port));

            if (isStart)
            {
                Console.WriteLine("服务器已启动 \r\n");
                serverHandler.ClientNumberChange += m_socket_ClientNumberChange;
                serverHandler.ReceiveClientData  += m_socket_ReceiveClientData;
            }


            Log.Info("Hello World!");
        }