Exemplo n.º 1
0
        /// <summary>
        ///     Start listening for incoming connections.
        /// </summary>
        /// <param name="port">The port to bind to listen connections on.</param>
        private void ListenAsync(int port)
        {
            // start server
            IPEndPoint endPoint = new IPEndPoint(IPAddress.Any, port);

            Libuv2kNGLogger.Log("libuv server: starting TCP..." + endPoint);

            _server = new TcpStream(_serverLoop);
            _server.SimultaneousAccepts(true);
            _server.onServerConnect = OnLibuvServerConnected;
            _server.Listen(endPoint);

            Libuv2kNGLogger.Log("libuv server: TCP started!");
        }
Exemplo n.º 2
0
        public override void ServerStart()
        {
            if (server != null)
            {
                return;
            }

            // start server
            IPEndPoint EndPoint = new IPEndPoint(IPAddress.Any, Port);

            Debug.Log($"libuv sv: starting TCP..." + EndPoint);
            server = new TcpStream(serverLoop);
            server.SimultaneousAccepts(true);
            server.Listen(EndPoint, OnLibuvServerConnected);
            Debug.Log($"libuv sv: TCP started!");
        }