public ClientOptions(TcpClient tcpCl, ServerChat serverObj) { User_id = Guid.NewGuid().ToString(); client = tcpCl; server = serverObj; serverObj.JoinConnection(this); }
static void Main(string[] args) { try { serverObj = new ServerChat(); thread = new Thread(new ThreadStart(serverObj.Listen)); thread.Start(); } catch (Exception ex) { serverObj.Deactivate(); Console.WriteLine(ex.Message); } }