mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Create constants for Keepalive defaults.
Fixes #6725 PiperOrigin-RevId: 402683244
This commit is contained in:
committed by
gVisor bot
parent
08f1d96168
commit
e54ee7a990
@@ -813,10 +813,9 @@ func newEndpoint(s *stack.Stack, protocol *protocol, netProto tcpip.NetworkProto
|
||||
waiterQueue: waiterQueue,
|
||||
state: uint32(StateInitial),
|
||||
keepalive: keepalive{
|
||||
// Linux defaults.
|
||||
idle: 2 * time.Hour,
|
||||
interval: 75 * time.Second,
|
||||
count: 9,
|
||||
idle: DefaultKeepaliveIdle,
|
||||
interval: DefaultKeepaliveInterval,
|
||||
count: DefaultKeepaliveCount,
|
||||
},
|
||||
uniqueID: s.UniqueID(),
|
||||
txHash: s.Rand().Uint32(),
|
||||
|
||||
@@ -66,6 +66,18 @@ const (
|
||||
// DefaultSynRetries is the default value for the number of SYN retransmits
|
||||
// before a connect is aborted.
|
||||
DefaultSynRetries = 6
|
||||
|
||||
// DefaultKeepaliveIdle is the idle time for a connection before keep-alive
|
||||
// probes are sent.
|
||||
DefaultKeepaliveIdle = 2 * time.Hour
|
||||
|
||||
// DefaultKeepaliveInterval is the time between two successive keep-alive
|
||||
// probes.
|
||||
DefaultKeepaliveInterval = 75 * time.Second
|
||||
|
||||
// DefaultKeepaliveCount is the number of keep-alive probes that are sent
|
||||
// before declaring the connection dead.
|
||||
DefaultKeepaliveCount = 9
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user