Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
b58b5ba9
Commit
b58b5ba9
authored
Jan 19, 2012
by
Mikio Hara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: fix plan9 build
R=golang-dev, bradfitz CC=golang-dev
https://golang.org/cl/5554058
parent
2356e438
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
40 deletions
+66
-40
iprawsock_plan9.go
src/pkg/net/iprawsock_plan9.go
+17
-16
ipsock_plan9.go
src/pkg/net/ipsock_plan9.go
+7
-15
tcpsock_plan9.go
src/pkg/net/tcpsock_plan9.go
+16
-0
udpsock_plan9.go
src/pkg/net/udpsock_plan9.go
+18
-2
unixsock_plan9.go
src/pkg/net/unixsock_plan9.go
+7
-6
unixsock_posix.go
src/pkg/net/unixsock_posix.go
+1
-1
No files found.
src/pkg/net/iprawsock_plan9.go
View file @
b58b5ba9
...
@@ -8,12 +8,28 @@ package net
...
@@ -8,12 +8,28 @@ package net
import
(
import
(
"os"
"os"
"time"
)
)
// IPConn is the implementation of the Conn and PacketConn
// IPConn is the implementation of the Conn and PacketConn
// interfaces for IP network connections.
// interfaces for IP network connections.
type
IPConn
bool
type
IPConn
bool
// SetDeadline implements the net.Conn SetDeadline method.
func
(
c
*
IPConn
)
SetDeadline
(
t
time
.
Time
)
error
{
return
os
.
EPLAN9
}
// SetReadDeadline implements the net.Conn SetReadDeadline method.
func
(
c
*
IPConn
)
SetReadDeadline
(
t
time
.
Time
)
error
{
return
os
.
EPLAN9
}
// SetWriteDeadline implements the net.Conn SetWriteDeadline method.
func
(
c
*
IPConn
)
SetWriteDeadline
(
t
time
.
Time
)
error
{
return
os
.
EPLAN9
}
// Implementation of the Conn interface - see Conn for documentation.
// Implementation of the Conn interface - see Conn for documentation.
// Read implements the net.Conn Read method.
// Read implements the net.Conn Read method.
...
@@ -41,21 +57,6 @@ func (c *IPConn) RemoteAddr() Addr {
...
@@ -41,21 +57,6 @@ func (c *IPConn) RemoteAddr() Addr {
return
nil
return
nil
}
}
// SetTimeout implements the net.Conn SetTimeout method.
func
(
c
*
IPConn
)
SetTimeout
(
nsec
int64
)
error
{
return
os
.
EPLAN9
}
// SetReadTimeout implements the net.Conn SetReadTimeout method.
func
(
c
*
IPConn
)
SetReadTimeout
(
nsec
int64
)
error
{
return
os
.
EPLAN9
}
// SetWriteTimeout implements the net.Conn SetWriteTimeout method.
func
(
c
*
IPConn
)
SetWriteTimeout
(
nsec
int64
)
error
{
return
os
.
EPLAN9
}
// IP-specific methods.
// IP-specific methods.
// ReadFrom implements the net.PacketConn ReadFrom method.
// ReadFrom implements the net.PacketConn ReadFrom method.
...
@@ -68,7 +69,7 @@ func (c *IPConn) ReadFrom(b []byte) (n int, addr Addr, err error) {
...
@@ -68,7 +69,7 @@ func (c *IPConn) ReadFrom(b []byte) (n int, addr Addr, err error) {
//
//
// WriteToIP can be made to time out and return
// WriteToIP can be made to time out and return
// an error with Timeout() == true after a fixed time limit;
// an error with Timeout() == true after a fixed time limit;
// see Set
Timeout and SetWriteTimeout
.
// see Set
Deadline and SetWriteDeadline
.
// On packet-oriented connections, write timeouts are rare.
// On packet-oriented connections, write timeouts are rare.
func
(
c
*
IPConn
)
WriteToIP
(
b
[]
byte
,
addr
*
IPAddr
)
(
n
int
,
err
error
)
{
func
(
c
*
IPConn
)
WriteToIP
(
b
[]
byte
,
addr
*
IPAddr
)
(
n
int
,
err
error
)
{
return
0
,
os
.
EPLAN9
return
0
,
os
.
EPLAN9
...
...
src/pkg/net/ipsock_plan9.go
View file @
b58b5ba9
...
@@ -10,6 +10,7 @@ import (
...
@@ -10,6 +10,7 @@ import (
"errors"
"errors"
"io"
"io"
"os"
"os"
"time"
)
)
// probeIPv6Stack returns two boolean values. If the first boolean value is
// probeIPv6Stack returns two boolean values. If the first boolean value is
...
@@ -156,27 +157,18 @@ func (c *plan9Conn) RemoteAddr() Addr {
...
@@ -156,27 +157,18 @@ func (c *plan9Conn) RemoteAddr() Addr {
return
c
.
raddr
return
c
.
raddr
}
}
// SetTimeout implements the net.Conn SetTimeout method.
// SetDeadline implements the net.Conn SetDeadline method.
func
(
c
*
plan9Conn
)
SetTimeout
(
nsec
int64
)
error
{
func
(
c
*
plan9Conn
)
SetDeadline
(
t
time
.
Time
)
error
{
if
!
c
.
ok
()
{
return
os
.
EINVAL
}
return
os
.
EPLAN9
return
os
.
EPLAN9
}
}
// SetReadTimeout implements the net.Conn SetReadTimeout method.
// SetReadDeadline implements the net.Conn SetReadDeadline method.
func
(
c
*
plan9Conn
)
SetReadTimeout
(
nsec
int64
)
error
{
func
(
c
*
plan9Conn
)
SetReadDeadline
(
t
time
.
Time
)
error
{
if
!
c
.
ok
()
{
return
os
.
EINVAL
}
return
os
.
EPLAN9
return
os
.
EPLAN9
}
}
// SetWriteTimeout implements the net.Conn SetWriteTimeout method.
// SetWriteDeadline implements the net.Conn SetWriteDeadline method.
func
(
c
*
plan9Conn
)
SetWriteTimeout
(
nsec
int64
)
error
{
func
(
c
*
plan9Conn
)
SetWriteDeadline
(
t
time
.
Time
)
error
{
if
!
c
.
ok
()
{
return
os
.
EINVAL
}
return
os
.
EPLAN9
return
os
.
EPLAN9
}
}
...
...
src/pkg/net/tcpsock_plan9.go
View file @
b58b5ba9
...
@@ -8,6 +8,7 @@ package net
...
@@ -8,6 +8,7 @@ package net
import
(
import
(
"os"
"os"
"time"
)
)
// TCPConn is an implementation of the Conn interface
// TCPConn is an implementation of the Conn interface
...
@@ -16,6 +17,21 @@ type TCPConn struct {
...
@@ -16,6 +17,21 @@ type TCPConn struct {
plan9Conn
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.
// CloseRead shuts down the reading side of the TCP connection.
// Most callers should just use Close.
// Most callers should just use Close.
func
(
c
*
TCPConn
)
CloseRead
()
error
{
func
(
c
*
TCPConn
)
CloseRead
()
error
{
...
...
src/pkg/net/udpsock_plan9.go
View file @
b58b5ba9
...
@@ -9,6 +9,7 @@ package net
...
@@ -9,6 +9,7 @@ package net
import
(
import
(
"errors"
"errors"
"os"
"os"
"time"
)
)
// UDPConn is the implementation of the Conn and PacketConn
// UDPConn is the implementation of the Conn and PacketConn
...
@@ -17,6 +18,21 @@ type UDPConn struct {
...
@@ -17,6 +18,21 @@ type UDPConn struct {
plan9Conn
plan9Conn
}
}
// SetDeadline implements the net.Conn SetDeadline method.
func
(
c
*
UDPConn
)
SetDeadline
(
t
time
.
Time
)
error
{
return
os
.
EPLAN9
}
// SetReadDeadline implements the net.Conn SetReadDeadline method.
func
(
c
*
UDPConn
)
SetReadDeadline
(
t
time
.
Time
)
error
{
return
os
.
EPLAN9
}
// SetWriteDeadline implements the net.Conn SetWriteDeadline method.
func
(
c
*
UDPConn
)
SetWriteDeadline
(
t
time
.
Time
)
error
{
return
os
.
EPLAN9
}
// UDP-specific methods.
// UDP-specific methods.
// ReadFromUDP reads a UDP packet from c, copying the payload into b.
// ReadFromUDP reads a UDP packet from c, copying the payload into b.
...
@@ -24,7 +40,7 @@ type UDPConn struct {
...
@@ -24,7 +40,7 @@ type UDPConn struct {
// that was on the packet.
// that was on the packet.
//
//
// ReadFromUDP can be made to time out and return an error with Timeout() == true
// ReadFromUDP can be made to time out and return an error with Timeout() == true
// after a fixed time limit; see Set
Timeout and SetReadTimeout
.
// after a fixed time limit; see Set
Deadline and SetReadDeadline
.
func
(
c
*
UDPConn
)
ReadFromUDP
(
b
[]
byte
)
(
n
int
,
addr
*
UDPAddr
,
err
error
)
{
func
(
c
*
UDPConn
)
ReadFromUDP
(
b
[]
byte
)
(
n
int
,
addr
*
UDPAddr
,
err
error
)
{
if
!
c
.
ok
()
{
if
!
c
.
ok
()
{
return
0
,
nil
,
os
.
EINVAL
return
0
,
nil
,
os
.
EINVAL
...
@@ -62,7 +78,7 @@ func (c *UDPConn) ReadFrom(b []byte) (n int, addr Addr, err error) {
...
@@ -62,7 +78,7 @@ func (c *UDPConn) ReadFrom(b []byte) (n int, addr Addr, err error) {
//
//
// WriteToUDP can be made to time out and return
// WriteToUDP can be made to time out and return
// an error with Timeout() == true after a fixed time limit;
// an error with Timeout() == true after a fixed time limit;
// see Set
Timeout and SetWriteTimeout
.
// see Set
Deadline and SetWriteDeadline
.
// On packet-oriented connections, write timeouts are rare.
// On packet-oriented connections, write timeouts are rare.
func
(
c
*
UDPConn
)
WriteToUDP
(
b
[]
byte
,
addr
*
UDPAddr
)
(
n
int
,
err
error
)
{
func
(
c
*
UDPConn
)
WriteToUDP
(
b
[]
byte
,
addr
*
UDPAddr
)
(
n
int
,
err
error
)
{
if
!
c
.
ok
()
{
if
!
c
.
ok
()
{
...
...
src/pkg/net/unixsock_plan9.go
View file @
b58b5ba9
...
@@ -8,6 +8,7 @@ package net
...
@@ -8,6 +8,7 @@ package net
import
(
import
(
"os"
"os"
"time"
)
)
// UnixConn is an implementation of the Conn interface
// UnixConn is an implementation of the Conn interface
...
@@ -44,18 +45,18 @@ func (c *UnixConn) RemoteAddr() Addr {
...
@@ -44,18 +45,18 @@ func (c *UnixConn) RemoteAddr() Addr {
return
nil
return
nil
}
}
// Set
Timeout implements the net.Conn SetTimeout
method.
// Set
Deadline implements the net.Conn SetDeadline
method.
func
(
c
*
UnixConn
)
Set
Timeout
(
nsec
int64
)
error
{
func
(
c
*
UnixConn
)
Set
Deadline
(
t
time
.
Time
)
error
{
return
os
.
EPLAN9
return
os
.
EPLAN9
}
}
// SetRead
Timeout implements the net.Conn SetReadTimeout
method.
// SetRead
Deadline implements the net.Conn SetReadDeadline
method.
func
(
c
*
UnixConn
)
SetRead
Timeout
(
nsec
int64
)
error
{
func
(
c
*
UnixConn
)
SetRead
Deadline
(
t
time
.
Time
)
error
{
return
os
.
EPLAN9
return
os
.
EPLAN9
}
}
// SetWrite
Timeout implements the net.Conn SetWriteTimeout
method.
// SetWrite
Deadline implements the net.Conn SetWriteDeadline
method.
func
(
c
*
UnixConn
)
SetWrite
Timeout
(
nsec
int64
)
error
{
func
(
c
*
UnixConn
)
SetWrite
Deadline
(
t
time
.
Time
)
error
{
return
os
.
EPLAN9
return
os
.
EPLAN9
}
}
...
...
src/pkg/net/unixsock_posix.go
View file @
b58b5ba9
...
@@ -387,7 +387,7 @@ func (l *UnixListener) Close() error {
...
@@ -387,7 +387,7 @@ func (l *UnixListener) Close() error {
// Addr returns the listener's network address.
// Addr returns the listener's network address.
func
(
l
*
UnixListener
)
Addr
()
Addr
{
return
l
.
fd
.
laddr
}
func
(
l
*
UnixListener
)
Addr
()
Addr
{
return
l
.
fd
.
laddr
}
// Set
Timeout
sets the deadline associated with the listener.
// Set
Deadline
sets the deadline associated with the listener.
// A zero time value disables the deadline.
// A zero time value disables the deadline.
func
(
l
*
UnixListener
)
SetDeadline
(
t
time
.
Time
)
(
err
error
)
{
func
(
l
*
UnixListener
)
SetDeadline
(
t
time
.
Time
)
(
err
error
)
{
if
l
==
nil
||
l
.
fd
==
nil
{
if
l
==
nil
||
l
.
fd
==
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment