MCPcopy
hub / github.com/q191201771/lal / doProtocolControlMessage

Method doProtocolControlMessage

pkg/rtmp/client_session.go:613–633  ·  view source on GitHub ↗
(stream *Stream)

Source from the content-addressed store, hash-verified

611 return nil
612}
613func (s *ClientSession) doProtocolControlMessage(stream *Stream) error {
614 if stream.msg.Len() < 4 {
615 return base.NewErrRtmpShortBuffer(4, int(stream.msg.Len()), "ClientSession::doProtocolControlMessage")
616 }
617 val := int(bele.BeUint32(stream.msg.buff.Bytes()))
618
619 switch stream.header.MsgTypeId {
620 case base.RtmpTypeIdWinAckSize:
621 s.option.PeerWinAckSize = val
622 Log.Infof("[%s] < R Window Acknowledgement Size: %d", s.UniqueKey(), s.option.PeerWinAckSize)
623 case base.RtmpTypeIdBandwidth:
624 // TODO chef: 是否需要关注这个信令
625 Log.Warnf("[%s] < R Set Peer Bandwidth. ignore.", s.UniqueKey())
626 case base.RtmpTypeIdSetChunkSize:
627 // composer内部会自动更新peer chunk size.
628 Log.Infof("[%s] < R Set Chunk Size %d.", s.UniqueKey(), val)
629 default:
630 Log.Errorf("[%s] read unknown protocol control message. typeid=%d, %s", s.UniqueKey(), stream.header.MsgTypeId, stream.toDebugString())
631 }
632 return nil
633}
634
635func (s *ClientSession) writeAcknowledgementIfNeeded(stream *Stream) error {
636 // https://github.com/q191201771/lal/pull/154

Callers 1

doMsgMethod · 0.95

Calls 5

UniqueKeyMethod · 0.95
NewErrRtmpShortBufferFunction · 0.92
BytesMethod · 0.80
toDebugStringMethod · 0.80
LenMethod · 0.65

Tested by

no test coverage detected