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}"); } }
public ClientEntity(TcpClient client, ServerEntity server) { Id = Guid.NewGuid().ToString(); _client = client; _server = server; }