mirror of
https://github.com/bluenviron/mediamtx
synced 2024-12-13 02:04:58 +00:00
24 lines
471 B
Go
24 lines
471 B
Go
package rtmp
|
|
|
|
import (
|
|
"bufio"
|
|
"net"
|
|
|
|
"github.com/notedit/rtmp/format/rtmp"
|
|
)
|
|
|
|
// NewServerConn initializes a server-side connection.
|
|
func NewServerConn(nconn net.Conn) *Conn {
|
|
// https://github.com/aler9/rtmp/blob/master/format/rtmp/server.go#L46
|
|
c := rtmp.NewConn(&bufio.ReadWriter{
|
|
Reader: bufio.NewReaderSize(nconn, readBufferSize),
|
|
Writer: bufio.NewWriterSize(nconn, writeBufferSize),
|
|
})
|
|
c.IsServer = true
|
|
|
|
return &Conn{
|
|
rconn: c,
|
|
nconn: nconn,
|
|
}
|
|
}
|