Skip to content

Commit aea1504

Browse files
committed
core/sockopt: attempt sockopts on SyscallConn
Instead of relying on a higher-level concerete type like *net.TCPConn, rely on the lowest-common type (here, PoolableConn viz SyscallConn) to cover *retrier, *splitter and other connection wrappers used in firestack.
1 parent 8d1c6bf commit aea1504

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

intra/core/sockopt.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ func SetKeepAliveConfig(c MinConn) bool {
4141
}
4242

4343
func SetTimeoutSockOpt(c MinConn, timeoutms int) bool {
44-
if tc, ok := c.(*net.TCPConn); ok {
45-
id := conn2str(tc)
44+
if tc, ok := c.(PoolableConn); ok {
45+
id := conn2str(c)
4646
rawConn, err := tc.SyscallConn()
4747
if err != nil || rawConn == nil {
4848
return false

0 commit comments

Comments
 (0)