diff --git a/internal/core/rtmp_conn.go b/internal/core/rtmp_conn.go index 1b565d050e9..6365c3d714b 100644 --- a/internal/core/rtmp_conn.go +++ b/internal/core/rtmp_conn.go @@ -527,7 +527,7 @@ func (c *rtmpConn) runPublish(ctx context.Context, u *url.URL) error { c.path.Name(), sourceTrackInfo(tracks)) - // disable write deadline + // disable write deadline to allow outgoing acknowledges c.nconn.SetWriteDeadline(time.Time{}) for { diff --git a/internal/core/rtmp_source.go b/internal/core/rtmp_source.go index 2f809d0abd5..7bdcde628e5 100644 --- a/internal/core/rtmp_source.go +++ b/internal/core/rtmp_source.go @@ -148,6 +148,9 @@ func (s *rtmpSource) run(ctx context.Context) error { s.parent.sourceStaticImplSetNotReady(pathSourceStaticSetNotReadyReq{}) }() + // disable write deadline to allow outgoing acknowledges + nconn.SetWriteDeadline(time.Time{}) + for { nconn.SetReadDeadline(time.Now().Add(time.Duration(s.readTimeout))) msg, err := conn.ReadMessage()