Skip to content

Commit 4673c62

Browse files
committed
use read instad of control
1 parent 18b46a1 commit 4673c62

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/pool/conn_check.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func connCheck(conn net.Conn) error {
3030

3131
var sysErr error
3232

33-
if err := rawConn.Control(func(fd uintptr) {
33+
if err := rawConn.Read(func(fd uintptr) bool {
3434
var buf [1]byte
3535
// Use MSG_PEEK to peek at data without consuming it
3636
n, _, err := syscall.Recvfrom(int(fd), buf[:], syscall.MSG_PEEK|syscall.MSG_DONTWAIT)
@@ -45,6 +45,7 @@ func connCheck(conn net.Conn) error {
4545
default:
4646
sysErr = err
4747
}
48+
return true
4849
}); err != nil {
4950
return err
5051
}

0 commit comments

Comments
 (0)