mirror of
https://github.com/aler9/gortsplib
synced 2025-10-13 02:43:53 +08:00
set default read and write timeout to 10 secs
This commit is contained in:
@@ -46,11 +46,11 @@ type ConnServer struct {
|
||||
|
||||
// NewConnServer allocates a ConnServer.
|
||||
func NewConnServer(conf ConnServerConf) *ConnServer {
|
||||
if conf.ReadTimeout == time.Duration(0) {
|
||||
conf.ReadTimeout = 5 * time.Second
|
||||
if conf.ReadTimeout == 0 {
|
||||
conf.ReadTimeout = 10 * time.Second
|
||||
}
|
||||
if conf.WriteTimeout == time.Duration(0) {
|
||||
conf.WriteTimeout = 5 * time.Second
|
||||
if conf.WriteTimeout == 0 {
|
||||
conf.WriteTimeout = 10 * time.Second
|
||||
}
|
||||
if conf.ReadBufferCount == 0 {
|
||||
conf.ReadBufferCount = 1
|
||||
|
Reference in New Issue
Block a user