Skip to content

Commit 9a7844f

Browse files
committed
[BE] refactor: 리스너 수집 시작용 publish 추가 (#98)
Signed-off-by: EunJiJung <[email protected]>
1 parent 4075da3 commit 9a7844f

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

src/backend/signaling-server/src/main/java/com/asyncgate/signaling_server/controller/StompWebRtcController.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,20 @@ public void handleAnswer(KurentoOfferRequest message, StompHeaderAccessor access
4444
@MessageMapping("/candidate")
4545
public void handleIceCandidate(KurentoOfferRequest message, StompHeaderAccessor accessor) {
4646

47-
System.out.println("addCandidate 접근 합니다 !!!!!!!!!!!!!!!!!!!!.");
48-
4947
// Kurento에 ICE Candidate 전달
5048
kurentoManager.addIceCandidates(message, accessor);
5149
}
5250

51+
/**
52+
* ICE Candidate 수집 시작
53+
*/
54+
@MessageMapping("/gather/candidate")
55+
public void handleIceGetherCandidate(KurentoOfferRequest message, StompHeaderAccessor accessor) {
56+
57+
// Kurento에 ICE Candidate 전달
58+
kurentoManager.GetherICECandidate(message, accessor);
59+
}
60+
5361
/**
5462
* 미디어 토글 (AUDIO, MEDIA, DATA)
5563
*/

src/backend/signaling-server/src/main/java/com/asyncgate/signaling_server/signaling/KurentoManager.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ public synchronized void getOrCreateEndpoint(String roomId, String userId, JoinR
7878

7979
startIceCandidateListenerAuto(roomId, userId);
8080

81-
// ICE Candidate 수집 시작
82-
endpoint.gatherCandidates();
8381

8482
// log.info("users topic을 전송하려고 합니다..");
8583
// 자동으로 토픽 전송
@@ -121,6 +119,20 @@ public void sendKurentoOffer(String roomId, String userId) {
121119
log.info("🎬 Kurento가 클라이언트에게 Offer 전송 완료: {}", sdpOffer);
122120
}
123121

122+
/**
123+
* ice 수집을 시작하는 메서드
124+
*/
125+
public void GetherICECandidate(KurentoOfferRequest message, StompHeaderAccessor accessor) {
126+
log.info("message {}", message);
127+
String userId = (String) accessor.getSessionAttributes().get("userId");
128+
log.warn("⚠️ user id : {}, roomId: {}", userId, message.data().roomId());
129+
WebRtcEndpoint endpoint = getUserEndpoint(message.data().roomId(), userId);
130+
131+
log.info("Gether ICE Candidate candidate kurento가 수집을 시작합니다 와하하~~" + endpoint);
132+
// ICE Candidate 수집 시작
133+
endpoint.gatherCandidates();
134+
}
135+
124136
/**
125137
* SDP Offer를 처리하고 Answer를 반환
126138
*/

0 commit comments

Comments
 (0)