File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,21 +65,18 @@ func SetTimeoutSockOpt(c MinConn, timeoutms int) bool {
6565 return false
6666}
6767
68- func DisableKeepAlive (c MinConn ) bool {
69- if sc , ok := c .(syscall. Conn ); ok {
68+ func DisableKeepAlive (c MinConn ) ( done bool ) {
69+ if sc , ok := c .(PoolableConn ); ok {
7070 raw , err := sc .SyscallConn ()
71- if err != nil {
72- return false
71+ if raw == nil || err != nil {
72+ return
7373 }
7474 err = raw .Control (func (fd uintptr ) {
75- syscall .SetsockoptInt (int (fd ), syscall .SOL_SOCKET , syscall .SO_KEEPALIVE , 0 )
75+ err = syscall .SetsockoptInt (int (fd ), syscall .SOL_SOCKET , syscall .SO_KEEPALIVE , 0 )
7676 })
77- if err != nil {
78- return false
79- }
80- return true
77+ return err == nil
8178 }
82- return false
79+ return
8380}
8481
8582// SetKeepAliveConfigSockOpt sets for a TCP connection, SO_KEEPALIVE,
You can’t perform that action at this time.
0 commit comments