コード例 #1
0
ファイル: Program.cs プロジェクト: GSMelford/MyChat
 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;
 }