Signal v2: envelope and fragments as wire message format. (#3800)

* Signal v2: envelope and fragments as wire message format.

Please see details in https://github.com/livekit/protocol/pull/1133

* log connect response
This commit is contained in:
Raja Subramanian
2025-07-18 15:24:32 +05:30
committed by GitHub
parent b9a44c3fbf
commit 078c01fad3
8 changed files with 119 additions and 76 deletions
+5 -3
View File
@@ -58,9 +58,11 @@ func (s *SignalCache) AddBatch(msgs []*livekit.Signalv2ServerMessage, lastRemote
defer s.lock.Unlock()
for _, msg := range msgs {
msg.MessageId = s.messageId
msg.Sequencer = &livekit.Sequencer{
MessageId: s.messageId,
LastProcessedRemoteMessageId: lastRemoteId,
}
s.messageId++
msg.LastProcessedRemoteMessageId = lastRemoteId
s.messages.PushBack(msg)
}
@@ -76,7 +78,7 @@ func (s *SignalCache) Clear(till uint32) {
func (s *SignalCache) clearLocked(till uint32) {
for s.messages.Len() != 0 {
front := s.messages.Front()
if front.GetMessageId() > till {
if front.Sequencer.GetMessageId() > till {
break
}
s.messages.PopFront()