示例#1
0
 static Thread listenThread; // потока для прослушивания
 static void Main(string[] args)
 {
     try
     {
         server = new ServerObject();
         ServerDirectory.CreateDirectory();
         listenThread = new Thread(new ThreadStart(server.Listen));
         listenThread.Start();
     }
     catch (Exception ex)
     {
         server.Disconnect();
         Console.WriteLine(ex.Message);
     }
 }
示例#2
0
 public ClientObject(string IPClient, TcpClient tcpMainClient, TcpClient tcpSubClient, ServerObject server)
 {
     Id = Guid.NewGuid().ToString();
     this.TcpMainClient = tcpMainClient;
     this.TcpSubClient  = tcpSubClient;
     this.Server        = server;
     this.IPClient      = IPClient;
     server.AddConnection(this);
     Console.WriteLine($"Client IP: {IPClient}. Unknown connection.");
 }
示例#3
0
 public DistributorRequests(ClientObject client, ServerObject server)
 {
     this.Client = client;
     this.Server = server;
 }