openvidu-server: improve websocket disconnection detection when sending response

pull/648/head
pabloFuente 2021-07-08 18:03:50 +02:00
parent 3265bf401d
commit 4b3b3780be
1 changed files with 2 additions and 4 deletions

View File

@ -75,8 +75,7 @@ public class RpcNotificationService {
try { try {
t.sendResponse(result); t.sendResponse(result);
} catch (KurentoException e) { } catch (KurentoException e) {
if (e.getCause().getMessage() if (e.getCause().getClass().equals(java.lang.IllegalStateException.class)) {
.contains("been closed and no method (apart from close()) may be called on a closed session")) {
log.warn("Response couldn't be sent to participant with privateId {}: {}", participantPrivateId, log.warn("Response couldn't be sent to participant with privateId {}: {}", participantPrivateId,
e.getCause().getMessage()); e.getCause().getMessage());
} else { } else {
@ -119,8 +118,7 @@ public class RpcNotificationService {
try { try {
s.sendNotification(method, params); s.sendNotification(method, params);
} catch (KurentoException e) { } catch (KurentoException e) {
if (e.getCause().getMessage() if (e.getCause().getClass().equals(java.lang.IllegalStateException.class)) {
.contains("been closed and no method (apart from close()) may be called on a closed session")) {
log.warn("Notification '{}' couldn't be sent to participant with privateId {}: {}", method, log.warn("Notification '{}' couldn't be sent to participant with privateId {}: {}", method,
participantPrivateId, e.getCause().getMessage()); participantPrivateId, e.getCause().getMessage());
} else { } else {