protected virtual void SendSpecific(Client[] specificClients, byte[] p) { for (int i = 0; i < specificClients.Length; i++) { specificClients[i].Send(p); } }
private void AsyncListen() { while (true) { Socket client = listener.Accept(); byte key = (byte)rand.Next(1, 255); Client serverClient = new Client(client, key); clients.Add(serverClient); OnClientConnected(new ClientConnectionEventArgs(serverClient)); serverClient.ClientExceptionOccoured += new EventHandler<ClientExceptionEventArgs>(serverClient_ClientExceptionOccoured); serverClient.ClientDisposed += new EventHandler(serverClient_ClientDisposed); serverClient.BeginReceive(); } }