增加断开连接时的日志输出

This commit is contained in:
dexter
2023-02-03 21:34:50 +08:00
parent f42849b149
commit 1744587c88

View File

@@ -3,6 +3,7 @@ package rtmp
import (
"context"
"fmt"
"io"
"net"
"sync/atomic"
@@ -167,7 +168,11 @@ func (config *RTMPConfig) ServeTCP(conn *net.TCPConn) {
RTMPPlugin.Warn("ReceiveVideo", zap.Uint32("MessageStreamID", msg.MessageStreamID))
}
}
} else if err == io.EOF {
RTMPPlugin.Info("rtmp client closed", zap.String("remote", conn.RemoteAddr().String()))
return
} else {
RTMPPlugin.Warn("ReadMessage", zap.Error(err))
return
}
}