diff options
Diffstat (limited to 'src/pkg/net/tcpsock_plan9.go')
| -rw-r--r-- | src/pkg/net/tcpsock_plan9.go | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/src/pkg/net/tcpsock_plan9.go b/src/pkg/net/tcpsock_plan9.go index f4f6e9fee..f2444a4d9 100644 --- a/src/pkg/net/tcpsock_plan9.go +++ b/src/pkg/net/tcpsock_plan9.go @@ -8,6 +8,7 @@ package net import ( "os" + "time" ) // TCPConn is an implementation of the Conn interface @@ -16,17 +17,50 @@ type TCPConn struct { plan9Conn } +// SetDeadline implements the net.Conn SetDeadline method. +func (c *TCPConn) SetDeadline(t time.Time) error { + return os.EPLAN9 +} + +// SetReadDeadline implements the net.Conn SetReadDeadline method. +func (c *TCPConn) SetReadDeadline(t time.Time) error { + return os.EPLAN9 +} + +// SetWriteDeadline implements the net.Conn SetWriteDeadline method. +func (c *TCPConn) SetWriteDeadline(t time.Time) error { + return os.EPLAN9 +} + +// CloseRead shuts down the reading side of the TCP connection. +// Most callers should just use Close. +func (c *TCPConn) CloseRead() error { + if !c.ok() { + return os.EINVAL + } + return os.EPLAN9 +} + +// CloseWrite shuts down the writing side of the TCP connection. +// Most callers should just use Close. +func (c *TCPConn) CloseWrite() error { + if !c.ok() { + return os.EINVAL + } + return os.EPLAN9 +} + // DialTCP connects to the remote address raddr on the network net, // which must be "tcp", "tcp4", or "tcp6". If laddr is not nil, it is used // as the local address for the connection. -func DialTCP(net string, laddr, raddr *TCPAddr) (c *TCPConn, err os.Error) { +func DialTCP(net string, laddr, raddr *TCPAddr) (c *TCPConn, err error) { switch net { case "tcp", "tcp4", "tcp6": default: return nil, UnknownNetworkError(net) } if raddr == nil { - return nil, &OpError{"dial", "tcp", nil, errMissingAddress} + return nil, &OpError{"dial", net, nil, errMissingAddress} } c1, err := dialPlan9(net, laddr, raddr) if err != nil { @@ -46,14 +80,14 @@ type TCPListener struct { // Net must be "tcp", "tcp4", or "tcp6". // If laddr has a port of 0, it means to listen on some available port. // The caller can use l.Addr() to retrieve the chosen address. -func ListenTCP(net string, laddr *TCPAddr) (l *TCPListener, err os.Error) { +func ListenTCP(net string, laddr *TCPAddr) (l *TCPListener, err error) { switch net { case "tcp", "tcp4", "tcp6": default: return nil, UnknownNetworkError(net) } if laddr == nil { - return nil, &OpError{"listen", "tcp", nil, errMissingAddress} + return nil, &OpError{"listen", net, nil, errMissingAddress} } l1, err := listenPlan9(net, laddr) if err != nil { |
