mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-26 11:34:09 +00:00
Show errors when ICE fails
This commit is contained in:
parent
851d9a6fc1
commit
624eecd4e8
2 changed files with 9 additions and 3 deletions
|
|
@ -141,8 +141,12 @@ func (p *Peer) handleICEState(onConnect func()) func(webrtc.ICEConnectionState)
|
|||
// nothing
|
||||
case webrtc.ICEConnectionStateConnected:
|
||||
onConnect()
|
||||
case webrtc.ICEConnectionStateFailed,
|
||||
webrtc.ICEConnectionStateClosed,
|
||||
case webrtc.ICEConnectionStateFailed:
|
||||
p.log.Error().Msgf("WebRTC connection fail! connection: %v, ice: %v, gathering: %v, signalling: %v",
|
||||
p.conn.ConnectionState(), p.conn.ICEConnectionState(), p.conn.ICEGatheringState(),
|
||||
p.conn.SignalingState())
|
||||
p.Disconnect()
|
||||
case webrtc.ICEConnectionStateClosed,
|
||||
webrtc.ICEConnectionStateDisconnected:
|
||||
p.Disconnect()
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -105,7 +105,9 @@ const webrtc = (() => {
|
|||
break;
|
||||
}
|
||||
case 'disconnected': {
|
||||
log.info('[rtc] disconnected...');
|
||||
log.info(`[rtc] disconnected... ` +
|
||||
`connection: ${connection.connectionState}, ice: ${connection.iceConnectionState}, ` +
|
||||
`gathering: ${connection.iceGatheringState}, signalling: ${connection.signalingState}`)
|
||||
connected = false;
|
||||
event.pub(WEBRTC_CONNECTION_CLOSED);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue