package net
import (
)
type netFD struct {
pfd poll.FD
family int
sotype int
isConnected bool
net string
laddr Addr
raddr Addr
}
func ( *netFD) (, Addr) {
.laddr =
.raddr =
runtime.SetFinalizer(, (*netFD).Close)
}
func ( *netFD) () error {
runtime.SetFinalizer(, nil)
return .pfd.Close()
}
func ( *netFD) ( int) error {
:= .pfd.Shutdown()
runtime.KeepAlive()
return wrapSyscallError("shutdown", )
}
func ( *netFD) () error {
return .shutdown(syscall.SHUT_RD)
}
func ( *netFD) () error {
return .shutdown(syscall.SHUT_WR)
}
func ( *netFD) ( []byte) ( int, error) {
, = .pfd.Read()
runtime.KeepAlive()
return , wrapSyscallError(readSyscallName, )
}
func ( *netFD) ( []byte) ( int, syscall.Sockaddr, error) {
, , = .pfd.ReadFrom()
runtime.KeepAlive()
return , , wrapSyscallError(readFromSyscallName, )
}
func ( *netFD) ( []byte, []byte) (, , int, syscall.Sockaddr, error) {
, , , , = .pfd.ReadMsg(, )
runtime.KeepAlive()
return , , , , wrapSyscallError(readMsgSyscallName, )
}
func ( *netFD) ( []byte) ( int, error) {
, = .pfd.Write()
runtime.KeepAlive()
return , wrapSyscallError(writeSyscallName, )
}
func ( *netFD) ( []byte, syscall.Sockaddr) ( int, error) {
, = .pfd.WriteTo(, )
runtime.KeepAlive()
return , wrapSyscallError(writeToSyscallName, )
}
func ( *netFD) ( []byte, []byte, syscall.Sockaddr) ( int, int, error) {
, , = .pfd.WriteMsg(, , )
runtime.KeepAlive()
return , , wrapSyscallError(writeMsgSyscallName, )
}
func ( *netFD) ( time.Time) error {
return .pfd.SetDeadline()
}
func ( *netFD) ( time.Time) error {
return .pfd.SetReadDeadline()
}
func ( *netFD) ( time.Time) error {
return .pfd.SetWriteDeadline()
}