Reputation: 4233
I got a RTCPeerConnection
, when the connection is established I want to disconnect from the web-server.
How do I check for an established connection?
readyState
was always undefined
and onopen
never fired.
Upvotes: 2
Views: 2611
Reputation: 4277
readyState
comes from an earlier version of the standard. You can now determine this from the PeerConnection.oniceconnectionstatechange
callback and by querying the PeerConnection.iceConnectionState
. The state value you're looking for is probably connected
.
Upvotes: 5
Reputation: 3992
I'm not sure, is this for you?
if (typeof RTCPeerConnection == "undefined") {
Abort("RTCPeerConnection is not supported/enabled in this browser, cannot test!");
}
or maybe set to null
value to broke up a connection?
RTCPeerConnection = null;
Upvotes: 0