Better tracking of signalling connection. (#1794)
* Better tracking of signalling connection. - Reason for closing signaling channel. - ConnectionID attached to request source/response sink * Tests
This commit is contained in:
+19
-1
@@ -98,16 +98,24 @@ func publishSignalMessage(rc redis.UniversalClient, nodeID livekit.NodeID, conne
|
||||
type RTCNodeSink struct {
|
||||
rc redis.UniversalClient
|
||||
nodeID livekit.NodeID
|
||||
connectionID livekit.ConnectionID
|
||||
participantKey livekit.ParticipantKey
|
||||
participantKeyB62 livekit.ParticipantKey
|
||||
isClosed atomic.Bool
|
||||
onClose func()
|
||||
}
|
||||
|
||||
func NewRTCNodeSink(rc redis.UniversalClient, nodeID livekit.NodeID, participantKey livekit.ParticipantKey, participantKeyB62 livekit.ParticipantKey) *RTCNodeSink {
|
||||
func NewRTCNodeSink(
|
||||
rc redis.UniversalClient,
|
||||
nodeID livekit.NodeID,
|
||||
connectionID livekit.ConnectionID,
|
||||
participantKey livekit.ParticipantKey,
|
||||
participantKeyB62 livekit.ParticipantKey,
|
||||
) *RTCNodeSink {
|
||||
return &RTCNodeSink{
|
||||
rc: rc,
|
||||
nodeID: nodeID,
|
||||
connectionID: connectionID,
|
||||
participantKey: participantKey,
|
||||
participantKeyB62: participantKeyB62,
|
||||
}
|
||||
@@ -137,6 +145,12 @@ func (s *RTCNodeSink) OnClose(f func()) {
|
||||
s.onClose = f
|
||||
}
|
||||
|
||||
func (s *RTCNodeSink) ConnectionID() livekit.ConnectionID {
|
||||
return s.connectionID
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
type SignalNodeSink struct {
|
||||
rc redis.UniversalClient
|
||||
nodeID livekit.NodeID
|
||||
@@ -177,3 +191,7 @@ func (s *SignalNodeSink) IsClosed() bool {
|
||||
func (s *SignalNodeSink) OnClose(f func()) {
|
||||
s.onClose = f
|
||||
}
|
||||
|
||||
func (s *SignalNodeSink) ConnectionID() livekit.ConnectionID {
|
||||
return s.connectionID
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user