Skip to content

Commit

Permalink
Merge pull request #315 from platinouss/fix/240313-not-removed-RTCPee…
Browse files Browse the repository at this point in the history
…rConnection

Fix: disconnect된 클라이언트의 WebRTC connection이 해제되지 않는 문제 해결
  • Loading branch information
tmddus2 authored Mar 14, 2024
2 parents ea602f6 + 1f2e6f6 commit b94c2d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mediaServer/src/RelayServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class RelayServer {
console.log('존재하지 않는 방입니다.');
return;
}
roomConnectionInfo.closeParticipantConnection(roomId);
roomConnectionInfo.closeAllParticipantConnection(roomId);
this._roomConnectionInfoList.delete(roomId);
const presenterConnectionInfo = this._clientConnectionInfoList.get(presenterEmail);
if (!presenterConnectionInfo) {
Expand Down
1 change: 1 addition & 0 deletions mediaServer/src/listeners/lecture.listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export class LectureListener {
return;
}
presenterStreamInfo.pauseRecording();
clientConnectionInfo.disconnectWebRTCConnection();
}
if (isParticipant(clientInfo.type, clientInfo.roomId, clientInfo.roomId)) {
leaveRoom(clientInfo.roomId, email);
Expand Down
3 changes: 2 additions & 1 deletion mediaServer/src/models/RoomConnectionInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class RoomConnectionInfo {
return this._stream;
}

closeParticipantConnection = (roomId: string) => {
closeAllParticipantConnection = (roomId: string) => {
this._participantIdList.forEach((participantId: string) => {
const participantConnectionInfo = relayServer.clientConnectionInfoList.get(participantId);
if (participantConnectionInfo) {
Expand All @@ -46,6 +46,7 @@ export class RoomConnectionInfo {
const participantConnectionInfo = relayServer.clientConnectionInfoList.get(participantId);
if (participantConnectionInfo) {
participantConnectionInfo.disconnectSocket(participantId, roomId);
participantConnectionInfo.disconnectWebRTCConnection();
this._participantIdList.delete(participantId);
}
};
Expand Down

0 comments on commit b94c2d9

Please sign in to comment.