use a single TCP outgoing buffer each client / session (#665)

this saves memory.
This commit is contained in:
Alessandro Ros
2024-12-24 10:24:24 +01:00
committed by GitHub
parent 6750427282
commit 5506eb2f7f
8 changed files with 78 additions and 87 deletions

View File

@@ -67,9 +67,9 @@ func (h *serverMulticastWriter) ip() net.IP {
return h.rtpl.ip()
}
func (h *serverMulticastWriter) writePacketRTP(payload []byte) error {
func (h *serverMulticastWriter) writePacketRTP(byts []byte) error {
ok := h.writer.push(func() error {
return h.rtpl.write(payload, h.rtpAddr)
return h.rtpl.write(byts, h.rtpAddr)
})
if !ok {
return liberrors.ErrServerWriteQueueFull{}
@@ -78,9 +78,9 @@ func (h *serverMulticastWriter) writePacketRTP(payload []byte) error {
return nil
}
func (h *serverMulticastWriter) writePacketRTCP(payload []byte) error {
func (h *serverMulticastWriter) writePacketRTCP(byts []byte) error {
ok := h.writer.push(func() error {
return h.rtcpl.write(payload, h.rtcpAddr)
return h.rtcpl.write(byts, h.rtcpAddr)
})
if !ok {
return liberrors.ErrServerWriteQueueFull{}