-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Old clients get isolated #2
Comments
Uncaught Error: Ice connection failed. And this happens randomly. Those two are relevant I thing. I've checked on I think we should do something with this RTCPeerConnection.oniceconnectionstatechange. In Simple-peer, any event like disconnected, failed, closed happens, it destroy connection. Peer.prototype._onIceConnectionStateChange = function () {
var self = this
if (self.destroyed) return
var iceGatheringState = self._pc.iceGatheringState
var iceConnectionState = self._pc.iceConnectionState
self._debug('iceConnectionStateChange %s %s', iceGatheringState, iceConnectionState)
self.emit('iceConnectionStateChange', iceGatheringState, iceConnectionState)
if (iceConnectionState === 'connected' || iceConnectionState === 'completed') {
clearTimeout(self._reconnectTimeout)
self._pcReady = true
self._maybeReady()
}
if (iceConnectionState === 'disconnected') {
if (self.reconnectTimer) {
// If user has set `opt.reconnectTimer`, allow time for ICE to attempt a reconnect
clearTimeout(self._reconnectTimeout)
self._reconnectTimeout = setTimeout(function () {
self._destroy()
}, self.reconnectTimer)
} else {
self._destroy()
}
}
if (iceConnectionState === 'failed') {
self._destroy(new Error('Ice connection failed.'))
}
if (iceConnectionState === 'closed') {
self._destroy()
}
} So when this happened, show the modal to user to be able to refresh the page. |
Oh, maybe this could be the solution. on y-multihack self._client = new SimpleSignalClient(self._socket, {
room: self.room,
reconnectTimer: 100
}) I'd tested it, and it seems work fine. |
So adding a reconnect timer fixes the issue? That would make sense if ICE is only disconnecting for a short time. |
Yes, disconnecting ICE is regularly happens and reconnectTimer can fix this. |
I assume ICE connection failed happens because of NAT. Found this from simple-peer page
And someone had same issue. I think I will make TURN server on my own. Before that, let me drop the link here. ;) ** maybe we could use exist websocket instead TURN server to relay client who uses NAT and/or firewall. |
I should just use the websocket fallback on WebRTC failure. That's basically what a TURN server does anyhow. |
I'd like to avoid using 3rd party services. If a business ever decides to use this, security will be a concern. A 3rd party TURN could be a server option though. |
right one is newer client, others are clients that connect together few hours ago.
old 2 clients are still can co-operate work.
I guess it is signal server problem?
The text was updated successfully, but these errors were encountered: