Skip to content

Commit

Permalink
chore/#110 :: 디버깅용 로그 메시지 제거
Browse files Browse the repository at this point in the history
Co-Authored-By: Kiyoung <[email protected]>
  • Loading branch information
youn9k and Kiyoung-Kim-57 committed Nov 27, 2024
1 parent 558f2f1 commit f3e3e91
Showing 1 changed file with 6 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ final public class SignalingServiceImpl: SignalingService {
userID: String,
roomID: String
) {
PTGDataLogger.log("send Candidate type: \(type) userID: \(userID) roomID: \(roomID)")
let message = IceCandidateMessage(from: rtcIceCandidate, userID: userID, roomID: roomID)
do {
let dataMessage = try self.encoder.encode(message)
Expand Down Expand Up @@ -90,35 +89,23 @@ extension SignalingServiceImpl {
}

public func webSocket(_ webSocket: WebSocketClient, didReceiveData data: Data) {
guard let response = data.toDTO(type: SignalingResponseDTO.self, decoder: decoder)
else {
PTGDataLogger.log("수신한 메시지 decoding에 실패하였습니다.: \(data)")
return
}
PTGDataLogger.log("Signaling 응답 수신.: \(response.messageType)")
guard let response = data.toDTO(type: SignalingResponseDTO.self, decoder: decoder) else { return }
switch response.messageType {
case .iceCandidate:
guard let iceCandidate = response.message?.toDTO(type: IceCandidateMessage.self, decoder: decoder)
else {
PTGDataLogger.log("IceCandidate decoding에 실패하였습니다.: \(response)")
return
}
else { return }
self.didReceiveCandidateSubject.send(iceCandidate.rtcIceCandidate)

case .offerSDP:
guard let sdp = response.message?.toDTO(type: SessionDescriptionMessage.self, decoder: decoder)
else {
PTGDataLogger.log("SDP decoding에 실패하였습니다.: \(response)")
return
}
else { return }
self.didReceiveRemoteSdpSubject.send(sdp.rtcSessionDescription)

case .answerSDP:
guard let sdp = response.message?.toDTO(type: SessionDescriptionMessage.self, decoder: decoder)
else {
PTGDataLogger.log("SDP decoding에 실패하였습니다.: \(response)")
return
}
else { return }
self.didReceiveRemoteSdpSubject.send(sdp.rtcSessionDescription)

@unknown default:
PTGDataLogger.log("Unknown Message Type: \(response)")
return
Expand Down

0 comments on commit f3e3e91

Please sign in to comment.