示例#1
0
        private void MainDisplay_Load(object sender, EventArgs e)
        {
            Server = new NetComm.Host(2020); //Initialize the Server object, connection will use the 2020 port number
            Server.StartConnection();        //Starts listening for incoming clients

            //Adding event handling methods, to handle the server messages
            Server.onConnection   += new NetComm.Host.onConnectionEventHandler(Server_onConnection);
            Server.lostConnection += new NetComm.Host.lostConnectionEventHandler(Server_lostConnection);
            Server.DataReceived   += new NetComm.Host.DataReceivedEventHandler(Server_DataReceived);
            Cxo();
        }
示例#2
0
        public void Init()
        {
            server = new Host(8080);
            server.StartConnection();

            server.NoDelay           = true;
            server.ReceiveBufferSize = 100;
            server.SendBufferSize    = 100;

            server.onConnection   += Server_onConnection;
            server.lostConnection += Server_lostConnection;
            server.DataReceived   += Server_DataReceived;

            Console.WriteLine("Сервер запущен. Ожидание подключений...");
        }