aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/websocket/websocket.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-01-25 21:54:22 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-01-25 21:54:22 +0000
commitaf92e385667da3fc91ac7f9f0867a56c111110b8 (patch)
treec8e8990a2197e33f6fe50a28a16714aafe982102 /libgo/go/websocket/websocket.go
parentdf1304ee03f41aed179545d1e8b4684cfd22bbdf (diff)
downloadgcc-af92e385667da3fc91ac7f9f0867a56c111110b8.zip
gcc-af92e385667da3fc91ac7f9f0867a56c111110b8.tar.gz
gcc-af92e385667da3fc91ac7f9f0867a56c111110b8.tar.bz2
libgo: Update to weekly.2012-01-20.
From-SVN: r183540
Diffstat (limited to 'libgo/go/websocket/websocket.go')
-rw-r--r--libgo/go/websocket/websocket.go27
1 files changed, 14 insertions, 13 deletions
diff --git a/libgo/go/websocket/websocket.go b/libgo/go/websocket/websocket.go
index df4416e..f7aabc9 100644
--- a/libgo/go/websocket/websocket.go
+++ b/libgo/go/websocket/websocket.go
@@ -17,6 +17,7 @@ import (
"net/http"
"net/url"
"sync"
+ "time"
)
const (
@@ -243,30 +244,30 @@ func (ws *Conn) RemoteAddr() net.Addr {
return &Addr{ws.config.Origin}
}
-var errSetTimeout = errors.New("websocket: cannot set timeout: not using a net.Conn")
+var errSetDeadline = errors.New("websocket: cannot set deadline: not using a net.Conn")
-// SetTimeout sets the connection's network timeout in nanoseconds.
-func (ws *Conn) SetTimeout(nsec int64) error {
+// SetDeadline sets the connection's network read & write deadlines.
+func (ws *Conn) SetDeadline(t time.Time) error {
if conn, ok := ws.rwc.(net.Conn); ok {
- return conn.SetTimeout(nsec)
+ return conn.SetDeadline(t)
}
- return errSetTimeout
+ return errSetDeadline
}
-// SetReadTimeout sets the connection's network read timeout in nanoseconds.
-func (ws *Conn) SetReadTimeout(nsec int64) error {
+// SetReadDeadline sets the connection's network read deadline.
+func (ws *Conn) SetReadDeadline(t time.Time) error {
if conn, ok := ws.rwc.(net.Conn); ok {
- return conn.SetReadTimeout(nsec)
+ return conn.SetReadDeadline(t)
}
- return errSetTimeout
+ return errSetDeadline
}
-// SetWriteTimeout sets the connection's network write timeout in nanoseconds.
-func (ws *Conn) SetWriteTimeout(nsec int64) error {
+// SetWriteDeadline sets the connection's network write deadline.
+func (ws *Conn) SetWriteDeadline(t time.Time) error {
if conn, ok := ws.rwc.(net.Conn); ok {
- return conn.SetWriteTimeout(nsec)
+ return conn.SetWriteDeadline(t)
}
- return errSetTimeout
+ return errSetDeadline
}
// Config returns the WebSocket config.