From e776b9c2e56b71bbdf6f8abe946975a0ce999274 Mon Sep 17 00:00:00 2001 From: tommi27 Date: Wed, 25 Mar 2020 14:50:05 +0100 Subject: [PATCH] socket is now sequential and not concurrent --- .../sa4/sanmarinoes/smarthut/socket/SensorSocketEndpoint.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;