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; //} } }
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(); } }
internal void RemoveClient(ClientThread client) { this.clients.Remove(client); }