github.com/neatio-net/neatio@v1.7.3-0.20231114194659-f4d7a2226baa/network/p2p/netutil/toobig_windows.go (about) 1 //go:build windows 2 // +build windows 3 4 package netutil 5 6 import ( 7 "net" 8 "os" 9 "syscall" 10 ) 11 12 const _WSAEMSGSIZE = syscall.Errno(10040) 13 14 func isPacketTooBig(err error) bool { 15 if opErr, ok := err.(*net.OpError); ok { 16 if scErr, ok := opErr.Err.(*os.SyscallError); ok { 17 return scErr.Err == _WSAEMSGSIZE 18 } 19 return opErr.Err == _WSAEMSGSIZE 20 } 21 return false 22 }