diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/socket/SensorSocketEndpoint.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/socket/SensorSocketEndpoint.java index f1e4808..1735b86 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/socket/SensorSocketEndpoint.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/socket/SensorSocketEndpoint.java @@ -58,9 +58,9 @@ public class SensorSocketEndpoint extends Endpoint { * @return number of successful transfer */ public long broadcast(Object message, User u) { - final Collection sessions = authorizedClients.get(u); + final HashSet sessions = new HashSet<>(authorizedClients.get(u)); + return sessions.stream() - .parallel() .filter( s -> { if (s.isOpen()) return true;