示例#1
0
 public ClientObj(TcpClient tcpClient, ServerObj serverObj)
 {
     id          = Guid.NewGuid().ToString();
     this.client = tcpClient;
     this.server = serverObj;
     server.AddConnection(this);
 }
示例#2
0
 static void Main(string[] args)
 {
     try
     {
         server       = new ServerObj();
         threadListen = new Thread(new ThreadStart(server.Listen));
         threadListen.Start();
     }
     catch (Exception ex)
     {
         server.Disconnect();
         Console.WriteLine(ex.Message);
     }
 }