コード例 #1
0
ファイル: Server.cs プロジェクト: smallredarmy/HNXC_WCS
 public void Write(string remoteAddress, string msg)
 {
     for (int i = 0; i < this.clients.Count; i++)
     {
         ClientThread thread = (ClientThread)this.clients[i];
         //if (thread.RemoteAddress.Equals(remoteAddress))
         //{
         thread.Write(msg);
         return;
         //}
     }
 }
コード例 #2
0
ファイル: Server.cs プロジェクト: smallredarmy/HNXC_WCS
 private void Listen()
 {
     this.server.Listen(10);
     while (this.isRun)
     {
         Socket client = this.server.Accept();
         client.Blocking = true;
         ClientThread thread = new ClientThread(this, client);
         thread.OnReceive    += this.OnReceive;
         thread.OnDisconnect += this.OnDisconnect;
         this.clients.Add(thread);
         if (this.OnConnect != null)
         {
             this.OnConnect(this, new SocketEventArgs(client));
         }
         thread.Start();
     }
 }
コード例 #3
0
ファイル: Server.cs プロジェクト: smallredarmy/HNXC_WCS
 internal void RemoveClient(ClientThread client)
 {
     this.clients.Remove(client);
 }
コード例 #4
0
ファイル: Server.cs プロジェクト: Guoyingbin/HNXC_WCS
 private void Listen()
 {
     this.server.Listen(10);
     while (this.isRun)
     {
         Socket client = this.server.Accept();
         client.Blocking = true;
         ClientThread thread = new ClientThread(this, client);
         thread.OnReceive += this.OnReceive;
         thread.OnDisconnect += this.OnDisconnect;
         this.clients.Add(thread);
         if (this.OnConnect != null)
         {
             this.OnConnect(this, new SocketEventArgs(client));
         }
         thread.Start();
     }
 }
コード例 #5
0
ファイル: Server.cs プロジェクト: Guoyingbin/HNXC_WCS
 internal void RemoveClient(ClientThread client)
 {
     this.clients.Remove(client);
 }