Ejemplo n.º 1
0
 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;
         //}
     }
 }
Ejemplo n.º 2
0
 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();
     }
 }
Ejemplo n.º 3
0
 internal void RemoveClient(ClientThread client)
 {
     this.clients.Remove(client);
 }
Ejemplo n.º 4
0
 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();
     }
 }
Ejemplo n.º 5
0
 internal void RemoveClient(ClientThread client)
 {
     this.clients.Remove(client);
 }