mirror of
https://github.com/livekit/livekit.git
synced 2026-10-23 19:32:41 +00:00
Respond to signal ping / pong (#871)
* Respond to signal ping / pong * Pass back 1 for pong for now, we don't need the timestamp * update protocol
This commit is contained in:
1 parent
c75090a0fe
commit
ab1ccae0c7
6 files changed
+46
-11
No files matched your search
@@ -54,6 +54,9 @@ func (p *ParticipantImpl) SendJoinResponse(
|
||||
// indicates both server and client support subscriber as primary
|
||||
SubscriberPrimary: p.SubscriberAsPrimary(),
|
||||
ClientConfiguration: p.params.ClientConf,
|
||||
// sane defaults for ping interval & timeout
|
||||
PingInterval: 10,
|
||||
PingTimeout: 20,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -256,6 +256,14 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if _, ok := req.Message.(*livekit.SignalRequest_Ping); ok {
|
||||
_ = sigConn.WriteResponse(&livekit.SignalResponse{
|
||||
Message: &livekit.SignalResponse_Pong{
|
||||
Pong: 1,
|
||||
},
|
||||
})
|
||||
continue
|
||||
}
|
||||
if err := reqSink.WriteMessage(req); err != nil {
|
||||
pLogger.Warnw("error writing to request sink", err,
|
||||
"connID", connId)
|
||||
|
||||
Reference in new issue
Block a user