Example #1
0
        static void Main(string[] args)
        {
            ServerEntity server = null;

            try
            {
                server = new ServerEntity("127.0.0.1", 8080);
                new Thread(server.Listen).Start();
            }
            catch (Exception ex)
            {
                server?.DisconnectAll();
                Console.WriteLine($"ERROR: {ex.Message}");
            }
        }
Example #2
0
 public ClientEntity(TcpClient client, ServerEntity server)
 {
     Id      = Guid.NewGuid().ToString();
     _client = client;
     _server = server;
 }