我需要知道在收到消息时通话中是否有2个对等方已连接-冰连接状态已断开,它将关闭所有窗口并断开2个对等方。 Ice Server断开连接时,我们可以处理重新连接吗?
这是iceconnectionstatechange的代码
pc.oniceconnectionstatechange = function() {
switch (pc.iceConnectionState) {
case "failed":
util.log(
"iceConnectionState is disconnected, closing connections to " + peerId
);
connection.emit(
"error",
new Error("Negotiation of connection to " + peerId + " failed.")
);
connection.close();
break;
case "disconnected":
util.log(
"iceConnectionState is disconnected, closing connections to " + peerId
);
connection.close();
break;
case "completed":
pc.onicecandidate = util.noop;
break;
}
};