set default read and write timeout to 10 secs

This commit is contained in:
aler9
2020-11-01 16:57:39 +01:00
parent e4e66789e9
commit 5945937a5f
4 changed files with 9 additions and 9 deletions

View File

@@ -102,11 +102,11 @@ type ConnClient struct {
// NewConnClient allocates a ConnClient. See ConnClientConf for the options.
func NewConnClient(conf ConnClientConf) (*ConnClient, error) {
if conf.ReadTimeout == time.Duration(0) {
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