Skip to content
Snippets Groups Projects
Commit 1445b6e9 authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Fix NotFoundExeptions for setSession event in Socket.IO implementation

parent 6ed1d666
Branches
Tags
No related merge requests found
......@@ -65,7 +65,12 @@ public class SessionService implements ISessionService {
public final Session joinSession(final String keyword, final UUID socketId) {
/* Socket.IO solution */
Session session = databaseDao.getSession(keyword);
Session session = null;
try {
session = databaseDao.getSession(keyword);
} catch (NotFoundException e) {
}
if (null == session) {
userService.removeUserFromSessionBySocketId(socketId);
......
......@@ -112,11 +112,12 @@ public class ARSnovaSocketIOServer {
server.addEventListener("setSession", Session.class, new DataListener<Session>() {
@Override
public void onData(SocketIOClient client, Session session, AckRequest ackSender) {
sessionService.joinSession(session.getKeyword(), client.getSessionId());
/* active user count has to be sent to the client since the broadcast is
* not always sent as long as the polling solution is active simultaneously */
reportActiveUserCountForSession(session.getKeyword());
reportSessionDataToClient(session.getKeyword(), client);
if (null != sessionService.joinSession(session.getKeyword(), client.getSessionId())) {
/* active user count has to be sent to the client since the broadcast is
* not always sent as long as the polling solution is active simultaneously */
reportActiveUserCountForSession(session.getKeyword());
reportSessionDataToClient(session.getKeyword(), client);
}
}
});
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment