ing
This commit is contained in:
parent
3ac035bfcf
commit
8a218a0806
8
const.go
8
const.go
|
@ -1,5 +1,7 @@
|
||||||
package server
|
package server
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// DefaultConcurrency is the maximum number of concurrent connections
|
// DefaultConcurrency is the maximum number of concurrent connections
|
||||||
// the Server may serve by default (i.e. if Server.Concurrency isn't set).
|
// the Server may serve by default (i.e. if Server.Concurrency isn't set).
|
||||||
|
@ -23,9 +25,9 @@ const (
|
||||||
// DefaultMaxMessageSize is default size for a message read from the peer
|
// DefaultMaxMessageSize is default size for a message read from the peer
|
||||||
DefaultMaxMessageSize = 4096
|
DefaultMaxMessageSize = 4096
|
||||||
// DefaultPongTimeout is default value of websocket pong Timeout
|
// DefaultPongTimeout is default value of websocket pong Timeout
|
||||||
DefaultPongTimeout = 0
|
DefaultPongTimeout = 60 * time.Second
|
||||||
// DefaultPingTimeout is default value of websocket ping Timeout
|
// DefaultPingTimeout is default value of websocket ping Timeout
|
||||||
DefaultPingTimeout = 0
|
DefaultPingTimeout = 10 * time.Second
|
||||||
// DefaultPingPeriod is default value of send ping period
|
// DefaultPingPeriod is default value of send ping period
|
||||||
DefaultPingPeriod = 0
|
DefaultPingPeriod = (DefaultPingTimeout * 9) / 10
|
||||||
)
|
)
|
||||||
|
|
|
@ -183,7 +183,7 @@ func (sh *ServerHandlers) Validate() error {
|
||||||
sh.PingTimeout = DefaultPingTimeout
|
sh.PingTimeout = DefaultPingTimeout
|
||||||
}
|
}
|
||||||
if sh.PingPeriod <= 0 {
|
if sh.PingPeriod <= 0 {
|
||||||
sh.PingPeriod = DefaultPingPeriod
|
sh.PingPeriod = (sh.PingTimeout * 9) / 10
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue
Block a user