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); } }
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."); }
public DistributorRequests(ClientObject client, ServerObject server) { this.Client = client; this.Server = server; }