Пример #1
0
 public ClientObj(TcpClient tcpClient, ServerObj serverObject)
 {
     Id     = Guid.NewGuid().ToString();
     client = tcpClient;
     server = serverObject;
     serverObject.AddConnection(this);
 }
Пример #2
0
 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);
     }
 }