slight refactoring, WS sends periodic ping

This commit is contained in:
David Zhao
2020-12-20 16:13:12 -08:00
parent 72d853589c
commit 684099d653
9 changed files with 75 additions and 37 deletions
+5 -7
View File
@@ -98,16 +98,14 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if err == io.EOF {
// client disconnected from websocket
return
}
if err != nil {
// most of these are disconnection, just return vs clogging up logs
//logger.GetLogger().Errorw("error reading WS",
// "err", err,
// "participantName", pName,
// "roomId", roomId)
} else if err != nil {
return
}
if req == nil {
continue
}
switch msg := req.Message.(type) {
case *livekit.SignalRequest_Offer:
err = s.handleOffer(participant, msg.Offer)