Closed jianjunz closed 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
Please also review #719, which makes onPeerConnectionClosed align with what implied by its name. Thanks.
@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.
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.