public ClientObj(TcpClient tcpClient, ServerObj serverObject) { Id = Guid.NewGuid().ToString(); client = tcpClient; server = serverObject; serverObject.AddConnection(this); }
static void Main(string[] args) { try { server = new ServerObj(); listenThread = new Thread(new ThreadStart(server.Listen)); listenThread.Start(); } catch (Exception ex) { server.Disconnect(); Console.WriteLine(ex.Message); } }