split configuration into sections

This commit is contained in:
aler9
2021-05-07 15:34:54 +02:00
parent bec905ed9c
commit a8c6af39e3
3 changed files with 75 additions and 25 deletions

View File

@@ -60,9 +60,25 @@ type sessionReq struct {
// Server is a RTSP server.
type Server struct {
//
// handler
//
// an handler to handle requests.
Handler ServerHandler
//
// connection
//
// timeout of read operations.
// It defaults to 10 seconds
ReadTimeout time.Duration
// timeout of write operations.
// It defaults to 10 seconds
WriteTimeout time.Duration
// a TLS configuration to accept TLS (RTSPS) connections.
TLSConfig *tls.Config
@@ -74,13 +90,9 @@ type Server struct {
// If UDPRTPAddress and UDPRTCPAddress are != "", the server can accept and send UDP streams.
UDPRTCPAddress string
// timeout of read operations.
// It defaults to 10 seconds
ReadTimeout time.Duration
// timeout of write operations.
// It defaults to 10 seconds
WriteTimeout time.Duration
//
// reading / writing
//
// read buffer count.
// If greater than 1, allows to pass buffers to routines different than the one
@@ -95,10 +107,18 @@ type Server struct {
// It defaults to 2048.
ReadBufferSize int
//
// system functions
//
// function used to initialize the TCP listener.
// It defaults to net.Listen
Listen func(network string, address string) (net.Listener, error)
//
// private
//
receiverReportPeriod time.Duration
closeSessionAfterNoRequestsFor time.Duration