open-webrtc-toolkit / owt-client-native

Open WebRTC Toolkit client SDK for native Windows/Linux/iOS applications.
https://01.org/open-webrtc-toolkit
Apache License 2.0
384 stars 180 forks source link

Parse signaling messages in P2PClient. #720

Closed jianjunz closed 1 year ago

jianjunz commented 1 year ago

P2PClient scans signaling messages to see if a PeerConnectionChannel is needed to be created or not. However, scaning messages with std::string::find may miss some matches when extra spaces are added, although these spaces don't change the meaning of a JSON message, e.g.: {"type":"chat-closed"} is the same as { "type" : "chat-closed" }. Parsing signaling messages in P2PClient identifies message type more accurate.

taste1981 commented 1 year ago

P2PClient scans signaling messages to see if a PeerConnectionChannel is needed to be created or not. However, scaning messages with std::string::find may miss some matches when extra spaces are added, although these spaces don't change the meaning of a JSON message, e.g.: {"type":"chat-closed"} is the same as { "type" : "chat-closed" }. Parsing signaling messages in P2PClient identifies message type more accurate.

Adding @dvrogozh

jianjunz commented 1 year ago

Please also review #719, which makes onPeerConnectionClosed align with what implied by its name. Thanks.

dvrogozh commented 1 year ago

@jianjunz : appreciate if you cab rebase this PR on top of latest master which has merged #719, so I will be able to try them both at once.