func (c conn) SetWriteDeadline(t time.Time) (err error) { err = unix.SetsockoptTimeval(c.fd, unix.SOL_SOCKET, unix.SO_SNDTIMEO, getTimeval(t)) if err != nil { err = Err{err} } return }
func (pc *packetSock) SetReadTimeout(t time.Duration) error { tv := unix.NsecToTimeval(t.Nanoseconds()) return unix.SetsockoptTimeval(pc.fd, unix.SOL_SOCKET, unix.SO_RCVTIMEO, &tv) }