broadcast method
Implementation
void broadcast(dynamic message,
{WebSocket? currentSocket, Iterable<String> rooms = const []}) {
for (var room in rooms.isEmpty ? [''] : rooms) {
var list = _websockets.where((socket) => currentSocket != socket);
if (room.isNotEmpty) {
list = list.where((socket) => socket._enteredRooms.contains(room));
}
for (var websocket in list) {
websocket.sink.add(message);
}
}
}