From 4b3b3780bee5e73fa69658b750ad10e3c0585cce Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Thu, 8 Jul 2021 18:03:50 +0200 Subject: [PATCH] openvidu-server: improve websocket disconnection detection when sending response --- .../java/io/openvidu/server/rpc/RpcNotificationService.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/openvidu-server/src/main/java/io/openvidu/server/rpc/RpcNotificationService.java b/openvidu-server/src/main/java/io/openvidu/server/rpc/RpcNotificationService.java index 670f7b67..a197d4de 100644 --- a/openvidu-server/src/main/java/io/openvidu/server/rpc/RpcNotificationService.java +++ b/openvidu-server/src/main/java/io/openvidu/server/rpc/RpcNotificationService.java @@ -75,8 +75,7 @@ public class RpcNotificationService { try { t.sendResponse(result); } catch (KurentoException e) { - if (e.getCause().getMessage() - .contains("been closed and no method (apart from close()) may be called on a closed session")) { + if (e.getCause().getClass().equals(java.lang.IllegalStateException.class)) { log.warn("Response couldn't be sent to participant with privateId {}: {}", participantPrivateId, e.getCause().getMessage()); } else { @@ -119,8 +118,7 @@ public class RpcNotificationService { try { s.sendNotification(method, params); } catch (KurentoException e) { - if (e.getCause().getMessage() - .contains("been closed and no method (apart from close()) may be called on a closed session")) { + if (e.getCause().getClass().equals(java.lang.IllegalStateException.class)) { log.warn("Notification '{}' couldn't be sent to participant with privateId {}: {}", method, participantPrivateId, e.getCause().getMessage()); } else {