Source File
conn_check.go
Belonging Package
github.com/redis/go-redis/v9/internal/pool
//go:build linux || darwin || dragonfly || freebsd || netbsd || openbsd || solaris || illumos// +build linux darwin dragonfly freebsd netbsd openbsd solaris illumospackage poolimport ()var errUnexpectedRead = errors.New("unexpected read from socket")func connCheck( net.Conn) error {// Reset previous timeout._ = .SetDeadline(time.Time{}), := .(syscall.Conn)if ! {return nil}, := .SyscallConn()if != nil {return}var errorif := .Read(func( uintptr) bool {var [1]byte, := syscall.Read(int(), [:])switch {case == 0 && == nil:= io.EOFcase > 0:= errUnexpectedReadcase == syscall.EAGAIN || == syscall.EWOULDBLOCK:= nildefault:=}return true}); != nil {return}return}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |