mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: afterConnectionClosed redundancy removed
parent
e7c6b9ebf9
commit
cf31dc8cb6
|
@ -294,23 +294,23 @@ public class RpcHandler extends DefaultJsonRpcHandler<JsonObject> {
|
|||
|
||||
@Override
|
||||
public void afterConnectionEstablished(Session rpcSession) throws Exception {
|
||||
log.info("Connection established for WebSocket session: {}", rpcSession.getSessionId());
|
||||
log.info("After connection established for WebSocket session: {}", rpcSession.getSessionId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterConnectionClosed(Session rpcSession, String status) throws Exception {
|
||||
log.info("Connection closed for WebSocket session: {} - Status: {}", rpcSession.getSessionId(), status);
|
||||
|
||||
RpcConnection rpc = this.notificationService.closeRpcSession(rpcSession.getSessionId());
|
||||
|
||||
if (rpc != null && rpc.getSessionId() != null) {
|
||||
io.openvidu.server.core.Session session = this.sessionManager.getSession(rpc.getSessionId());
|
||||
if (session != null && session.getParticipantByPrivateId(rpc.getParticipantPrivateId()) != null) {
|
||||
leaveRoomAfterConnClosed(rpc.getParticipantPrivateId(), "networkDisconnect");
|
||||
log.info("After connection closed for WebSocket session: {} - Status: {}", rpcSession.getSessionId(), status);
|
||||
|
||||
if ("Close for not receive ping from client".equals(status)) {
|
||||
RpcConnection rpc = this.notificationService.closeRpcSession(rpcSession.getSessionId());
|
||||
if (rpc != null && rpc.getSessionId() != null) {
|
||||
io.openvidu.server.core.Session session = this.sessionManager.getSession(rpc.getSessionId());
|
||||
if (session != null && session.getParticipantByPrivateId(rpc.getParticipantPrivateId()) != null) {
|
||||
leaveRoomAfterConnClosed(rpc.getParticipantPrivateId(), "networkDisconnect");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.notificationService.showRpcConnections();
|
||||
String rpcSessionId = rpcSession.getSessionId();
|
||||
if (this.webSocketTransportError.get(rpcSessionId) != null) {
|
||||
log.warn(
|
||||
|
|
|
@ -112,6 +112,7 @@ public class RpcNotificationService {
|
|||
try {
|
||||
s.close();
|
||||
log.info("Closed session for participant with private id {}", participantPrivateId);
|
||||
this.showRpcConnections();
|
||||
return rpcSession;
|
||||
} catch (IOException e) {
|
||||
log.error("Error closing session for participant with private id {}", participantPrivateId, e);
|
||||
|
|
Loading…
Reference in New Issue