RTCPeerConnection | Signaling

Once the TsgcRTCPeerConnection has configure the RTCOptions property and the Servers (WebSocket and STUN/TURN) are running, the client can start the process of gathering candidates.

 

The client first connects to the websocket server, if the connection is successful, it sends the local SDP. Then tries to get the local and public IP Addresses, to get the public IP Addresses will send a binding request to the STUN server to obtain the public IP Address and the relayed IP Address of the TURN server. Every time it gets a new candidate, this info is passed to the websocket server which will be forwarded to the other peer.

 

When the RTCPeerConnection has the Local SDP, Remote SDP and the candidates it will start a process of checking every candidate pair to see if can connect between them. When a candidate pair successfully connects, it's a valid candidate pair and the Securing process continues the flow.