ing
This commit is contained in:
parent
3ac035bfcf
commit
8a218a0806
8
const.go
8
const.go
|
@ -1,5 +1,7 @@
|
|||
package server
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
// DefaultConcurrency is the maximum number of concurrent connections
|
||||
// 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 = 4096
|
||||
// DefaultPongTimeout is default value of websocket pong Timeout
|
||||
DefaultPongTimeout = 0
|
||||
DefaultPongTimeout = 60 * time.Second
|
||||
// DefaultPingTimeout is default value of websocket ping Timeout
|
||||
DefaultPingTimeout = 0
|
||||
DefaultPingTimeout = 10 * time.Second
|
||||
// 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
|
||||
}
|
||||
if sh.PingPeriod <= 0 {
|
||||
sh.PingPeriod = DefaultPingPeriod
|
||||
sh.PingPeriod = (sh.PingTimeout * 9) / 10
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user