catch panics to ensure reliability

This commit is contained in:
David Zhao
2021-01-11 00:07:11 -08:00
parent 6464ae3cd6
commit 21ac2413a2
7 changed files with 43 additions and 67 deletions
+1 -1
View File
@@ -106,7 +106,7 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// remove peer from room upon disconnection
room.RemoveParticipant(participant.ID())
participant.Close()
log.Infow("WS connection closed")
log.Infow("WS connection closed", "participant", participant.ID())
}()
// read connection and wait for commands