public void sendToAll(CommandClient command) { lock (connections) { for (int i = 0; i < connections.Count; i++) { send(connections[i].Socket, command); } } }
void send(Socket s, CommandClient command) { MemoryStream x = new MemoryStream(); binFormat.Serialize(x, command); s.Send(x.GetBuffer()); }