From 51b59f6a8869d9e269019c4664f151b98b6ce899 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sun, 13 Nov 2011 22:42:42 -0500 Subject: [PATCH] various: reduce overuse of os.EINVAL + others R=golang-dev, r CC=golang-dev https://golang.org/cl/5372081 --- conn.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conn.go b/conn.go index f4178e3..b8fa273 100644 --- a/conn.go +++ b/conn.go @@ -93,7 +93,8 @@ func (c *Conn) SetTimeout(nsec int64) error { } // SetReadTimeout sets the time (in nanoseconds) that -// Read will wait for data before returning os.EAGAIN. +// Read will wait for data before returning a net.Error +// with Timeout() == true. // Setting nsec == 0 (the default) disables the deadline. func (c *Conn) SetReadTimeout(nsec int64) error { return c.conn.SetReadTimeout(nsec) @@ -737,7 +738,7 @@ func (c *Conn) Write(b []byte) (n int, err error) { return c.writeRecord(recordTypeApplicationData, b) } -// Read can be made to time out and return err == os.EAGAIN +// Read can be made to time out and return a net.Error with Timeout() == true // after a fixed time limit; see SetTimeout and SetReadTimeout. func (c *Conn) Read(b []byte) (n int, err error) { if err = c.Handshake(); err != nil {