diff options
Diffstat (limited to 'libgo/go/net/tcpsock.go')
-rw-r--r-- | libgo/go/net/tcpsock.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libgo/go/net/tcpsock.go b/libgo/go/net/tcpsock.go index e957aa3..9528140 100644 --- a/libgo/go/net/tcpsock.go +++ b/libgo/go/net/tcpsock.go @@ -225,6 +225,18 @@ type TCPListener struct { fd *netFD } +// SyscallConn returns a raw network connection. +// This implements the syscall.Conn interface. +// +// The returned RawConn only supports calling Control. Read and +// Write return an error. +func (l *TCPListener) SyscallConn() (syscall.RawConn, error) { + if !l.ok() { + return nil, syscall.EINVAL + } + return newRawListener(l.fd) +} + // AcceptTCP accepts the next incoming call and returns the new // connection. func (l *TCPListener) AcceptTCP() (*TCPConn, error) { |