mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
webRTC WS disconnect error handling.
This commit is contained in:
parent
cca147859d
commit
5a25aefa34
@ -149,7 +149,9 @@ func (manager *WebRTCManager) CreatePeer(id string, session types.Session) (stri
|
|||||||
case webrtc.PeerConnectionStateDisconnected:
|
case webrtc.PeerConnectionStateDisconnected:
|
||||||
case webrtc.PeerConnectionStateFailed:
|
case webrtc.PeerConnectionStateFailed:
|
||||||
manager.logger.Info().Str("id", id).Msg("peer disconnected")
|
manager.logger.Info().Str("id", id).Msg("peer disconnected")
|
||||||
session.Disconnect("peer connection state failed")
|
if err:= session.Disconnect("peer connection state failed"); err != nil {
|
||||||
|
manager.logger.Warn().Err(err).Msg("error while disconnecting session")
|
||||||
|
}
|
||||||
case webrtc.PeerConnectionStateConnected:
|
case webrtc.PeerConnectionStateConnected:
|
||||||
manager.logger.Info().Str("id", id).Msg("peer connected")
|
manager.logger.Info().Str("id", id).Msg("peer connected")
|
||||||
session.SetConnected()
|
session.SetConnected()
|
||||||
|
Loading…
Reference in New Issue
Block a user