mirror of
https://github.com/impact-eintr/netstack.git
synced 2025-10-05 21:06:50 +08:00
keepalive 成功解决 ZWP 问题 当接收端不理发送端的时候 每 idleTime 就会重发一个询问报文
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"reflect"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Error struct {
|
||||
@@ -383,6 +384,32 @@ type ReceiveQueueSizeOption int
|
||||
// SO_TIMESTAMP socket control messages are enabled.
|
||||
type TimestampOption int
|
||||
|
||||
// TCPInfoOption is used by GetSockOpt to expose TCP statistics.
|
||||
//
|
||||
// TODO: Add and populate stat fields.
|
||||
type TCPInfoOption struct {
|
||||
RTT time.Duration
|
||||
RTTVar time.Duration
|
||||
}
|
||||
|
||||
// KeepaliveEnabledOption is used by SetSockOpt/GetSockOpt to specify whether
|
||||
// TCP keepalive is enabled for this socket.
|
||||
type KeepaliveEnabledOption int
|
||||
|
||||
// KeepaliveIdleOption is used by SetSockOpt/GetSockOpt to specify the time a
|
||||
// connection must remain idle before the first TCP keepalive packet is sent.
|
||||
// Once this time is reached, KeepaliveIntervalOption is used instead.
|
||||
type KeepaliveIdleOption time.Duration
|
||||
|
||||
// KeepaliveIntervalOption is used by SetSockOpt/GetSockOpt to specify the
|
||||
// interval between sending TCP keepalive packets.
|
||||
type KeepaliveIntervalOption time.Duration
|
||||
|
||||
// KeepaliveCountOption is used by SetSockOpt/GetSockOpt to specify the number
|
||||
// of un-ACKed TCP keepalives that will be sent before the connection is
|
||||
// closed.
|
||||
type KeepaliveCountOption int
|
||||
|
||||
// MulticastTTLOption is used by SetSockOpt/GetSockOpt to control the default
|
||||
// TTL value for multicast messages. The default is 1.
|
||||
type MulticastTTLOption uint8
|
||||
|
Reference in New Issue
Block a user