コード例 #1
0
        public Client(NetPeer peer, ServerNetEventListener server)
        {
            NetPeer = peer;

            _server = server;
            _server.ConnectedClients.Add(NetPeer.Id, this);

            Console.WriteLine($"Connected new client. ClientId: {NetPeer.Id}");
        }
コード例 #2
0
        private static void Main(string[] args)
        {
            Console.WriteLine("Start application.");

            var operation = "start";

            while (operation == "start")
            {
                _server = new ServerNetEventListener();
                _server.Start(15000);

                Console.ReadKey();

                _server.Stop();

                operation = Console.ReadLine();
            }
        }