summaryrefslogtreecommitdiff
path: root/libgo/go/net/tcpsock_posix.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/net/tcpsock_posix.go')
-rw-r--r--libgo/go/net/tcpsock_posix.go46
1 files changed, 23 insertions, 23 deletions
diff --git a/libgo/go/net/tcpsock_posix.go b/libgo/go/net/tcpsock_posix.go
index 740a63d3038..a726b45c15a 100644
--- a/libgo/go/net/tcpsock_posix.go
+++ b/libgo/go/net/tcpsock_posix.go
@@ -39,7 +39,7 @@ func (a *TCPAddr) family() int {
return syscall.AF_INET6
}
-func (a *TCPAddr) sockaddr(family int) (syscall.Sockaddr, os.Error) {
+func (a *TCPAddr) sockaddr(family int) (syscall.Sockaddr, error) {
return ipToSockaddr(family, a.IP, a.Port)
}
@@ -67,7 +67,7 @@ func (c *TCPConn) ok() bool { return c != nil && c.fd != nil }
// Implementation of the Conn interface - see Conn for documentation.
// Read implements the net.Conn Read method.
-func (c *TCPConn) Read(b []byte) (n int, err os.Error) {
+func (c *TCPConn) Read(b []byte) (n int, err error) {
if !c.ok() {
return 0, os.EINVAL
}
@@ -75,7 +75,7 @@ func (c *TCPConn) Read(b []byte) (n int, err os.Error) {
}
// ReadFrom implements the io.ReaderFrom ReadFrom method.
-func (c *TCPConn) ReadFrom(r io.Reader) (int64, os.Error) {
+func (c *TCPConn) ReadFrom(r io.Reader) (int64, error) {
if n, err, handled := sendFile(c.fd, r); handled {
return n, err
}
@@ -83,7 +83,7 @@ func (c *TCPConn) ReadFrom(r io.Reader) (int64, os.Error) {
}
// Write implements the net.Conn Write method.
-func (c *TCPConn) Write(b []byte) (n int, err os.Error) {
+func (c *TCPConn) Write(b []byte) (n int, err error) {
if !c.ok() {
return 0, os.EINVAL
}
@@ -91,7 +91,7 @@ func (c *TCPConn) Write(b []byte) (n int, err os.Error) {
}
// Close closes the TCP connection.
-func (c *TCPConn) Close() os.Error {
+func (c *TCPConn) Close() error {
if !c.ok() {
return os.EINVAL
}
@@ -102,7 +102,7 @@ func (c *TCPConn) Close() os.Error {
// CloseRead shuts down the reading side of the TCP connection.
// Most callers should just use Close.
-func (c *TCPConn) CloseRead() os.Error {
+func (c *TCPConn) CloseRead() error {
if !c.ok() {
return os.EINVAL
}
@@ -111,7 +111,7 @@ func (c *TCPConn) CloseRead() os.Error {
// CloseWrite shuts down the writing side of the TCP connection.
// Most callers should just use Close.
-func (c *TCPConn) CloseWrite() os.Error {
+func (c *TCPConn) CloseWrite() error {
if !c.ok() {
return os.EINVAL
}
@@ -135,7 +135,7 @@ func (c *TCPConn) RemoteAddr() Addr {
}
// SetTimeout implements the net.Conn SetTimeout method.
-func (c *TCPConn) SetTimeout(nsec int64) os.Error {
+func (c *TCPConn) SetTimeout(nsec int64) error {
if !c.ok() {
return os.EINVAL
}
@@ -143,7 +143,7 @@ func (c *TCPConn) SetTimeout(nsec int64) os.Error {
}
// SetReadTimeout implements the net.Conn SetReadTimeout method.
-func (c *TCPConn) SetReadTimeout(nsec int64) os.Error {
+func (c *TCPConn) SetReadTimeout(nsec int64) error {
if !c.ok() {
return os.EINVAL
}
@@ -151,7 +151,7 @@ func (c *TCPConn) SetReadTimeout(nsec int64) os.Error {
}
// SetWriteTimeout implements the net.Conn SetWriteTimeout method.
-func (c *TCPConn) SetWriteTimeout(nsec int64) os.Error {
+func (c *TCPConn) SetWriteTimeout(nsec int64) error {
if !c.ok() {
return os.EINVAL
}
@@ -160,7 +160,7 @@ func (c *TCPConn) SetWriteTimeout(nsec int64) os.Error {
// SetReadBuffer sets the size of the operating system's
// receive buffer associated with the connection.
-func (c *TCPConn) SetReadBuffer(bytes int) os.Error {
+func (c *TCPConn) SetReadBuffer(bytes int) error {
if !c.ok() {
return os.EINVAL
}
@@ -169,7 +169,7 @@ func (c *TCPConn) SetReadBuffer(bytes int) os.Error {
// SetWriteBuffer sets the size of the operating system's
// transmit buffer associated with the connection.
-func (c *TCPConn) SetWriteBuffer(bytes int) os.Error {
+func (c *TCPConn) SetWriteBuffer(bytes int) error {
if !c.ok() {
return os.EINVAL
}
@@ -187,7 +187,7 @@ func (c *TCPConn) SetWriteBuffer(bytes int) os.Error {
//
// If sec > 0, Close blocks for at most sec seconds waiting for
// data to be sent and acknowledged.
-func (c *TCPConn) SetLinger(sec int) os.Error {
+func (c *TCPConn) SetLinger(sec int) error {
if !c.ok() {
return os.EINVAL
}
@@ -196,7 +196,7 @@ func (c *TCPConn) SetLinger(sec int) os.Error {
// SetKeepAlive sets whether the operating system should send
// keepalive messages on the connection.
-func (c *TCPConn) SetKeepAlive(keepalive bool) os.Error {
+func (c *TCPConn) SetKeepAlive(keepalive bool) error {
if !c.ok() {
return os.EINVAL
}
@@ -207,7 +207,7 @@ func (c *TCPConn) SetKeepAlive(keepalive bool) os.Error {
// packet transmission in hopes of sending fewer packets
// (Nagle's algorithm). The default is true (no delay), meaning
// that data is sent as soon as possible after a Write.
-func (c *TCPConn) SetNoDelay(noDelay bool) os.Error {
+func (c *TCPConn) SetNoDelay(noDelay bool) error {
if !c.ok() {
return os.EINVAL
}
@@ -217,12 +217,12 @@ func (c *TCPConn) SetNoDelay(noDelay bool) os.Error {
// File returns a copy of the underlying os.File, set to blocking mode.
// It is the caller's responsibility to close f when finished.
// Closing c does not affect f, and closing f does not affect c.
-func (c *TCPConn) File() (f *os.File, err os.Error) { return c.fd.dup() }
+func (c *TCPConn) File() (f *os.File, err error) { return c.fd.dup() }
// 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) {
if raddr == nil {
return nil, &OpError{"dial", "tcp", nil, errMissingAddress}
}
@@ -244,7 +244,7 @@ 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) {
fd, err := internetSocket(net, laddr.toAddr(), nil, syscall.SOCK_STREAM, 0, "listen", sockaddrToTCP)
if err != nil {
return nil, err
@@ -261,7 +261,7 @@ func ListenTCP(net string, laddr *TCPAddr) (l *TCPListener, err os.Error) {
// AcceptTCP accepts the next incoming call and returns the new connection
// and the remote address.
-func (l *TCPListener) AcceptTCP() (c *TCPConn, err os.Error) {
+func (l *TCPListener) AcceptTCP() (c *TCPConn, err error) {
if l == nil || l.fd == nil || l.fd.sysfd < 0 {
return nil, os.EINVAL
}
@@ -274,7 +274,7 @@ func (l *TCPListener) AcceptTCP() (c *TCPConn, err os.Error) {
// Accept implements the Accept method in the Listener interface;
// it waits for the next call and returns a generic Conn.
-func (l *TCPListener) Accept() (c Conn, err os.Error) {
+func (l *TCPListener) Accept() (c Conn, err error) {
c1, err := l.AcceptTCP()
if err != nil {
return nil, err
@@ -284,7 +284,7 @@ func (l *TCPListener) Accept() (c Conn, err os.Error) {
// Close stops listening on the TCP address.
// Already Accepted connections are not closed.
-func (l *TCPListener) Close() os.Error {
+func (l *TCPListener) Close() error {
if l == nil || l.fd == nil {
return os.EINVAL
}
@@ -295,7 +295,7 @@ func (l *TCPListener) Close() os.Error {
func (l *TCPListener) Addr() Addr { return l.fd.laddr }
// SetTimeout sets the deadline associated with the listener
-func (l *TCPListener) SetTimeout(nsec int64) os.Error {
+func (l *TCPListener) SetTimeout(nsec int64) error {
if l == nil || l.fd == nil {
return os.EINVAL
}
@@ -305,4 +305,4 @@ func (l *TCPListener) SetTimeout(nsec int64) os.Error {
// File returns a copy of the underlying os.File, set to blocking mode.
// It is the caller's responsibility to close f when finished.
// Closing c does not affect f, and closing f does not affect c.
-func (l *TCPListener) File() (f *os.File, err os.Error) { return l.fd.dup() }
+func (l *TCPListener) File() (f *os.File, err error) { return l.fd.dup() }