Documentation
¶
Index ¶
- Constants
- func Accept(fd int) (int, syscall.Sockaddr, error)
- func Bind(fd int, sa syscall.Sockaddr) error
- func Close(fd int) error
- func Connect(fd int, sa syscall.Sockaddr) error
- func GetPeerName(fd int) (syscall.Sockaddr, error)
- func GetSockName(fd int) (syscall.Sockaddr, error)
- func GetSockOpt(fd, level, opt int, value unsafe.Pointer, len *uint32) error
- func GetSockOptInt(fd, level, opt int) (int, error)
- func GetSocketError(fd int) error
- func Iomap(fd int, buf []byte, prot int, flags int, offset int64) (int64, error)
- func Iounmap(fd int, buf []byte) error
- func Iowrite(fd int, buf []byte, offset int64, flags int) (int, error)
- func Listen(fd int, backlog int) error
- func Poll(fds []unix.PollFd, timeout int) (int, error)
- func Read(fd int, p []byte) (int, error)
- func RecvFrom(fd int, p []byte, flags int) (int, syscall.Sockaddr, error)
- func RecvMsg(fd int, msg *syscall.Msghdr, flags int) (int, error)
- func Select(nfds int, readfds, writefds, exceptfds *syscall.FdSet, ...) (int, error)
- func SendMsg(fd int, msg *syscall.Msghdr, flags int) (int, error)
- func SendTo(fd int, p []byte, flags int, sa syscall.Sockaddr) (int, error)
- func SetRDMAInline(fd int, value int) error
- func SetRDMARQSize(fd int, value int) error
- func SetRDMASQSize(fd int, value int) error
- func SetRecvBuffer(fd int, value int) error
- func SetReuseAddr(fd int, value bool) error
- func SetSendBuffer(fd int, value int) error
- func SetSockOpt(fd, level, opt int, value unsafe.Pointer, len uint32) error
- func SetSockOptInt(fd, level, opt, value int) error
- func SetTCPNoDelay(fd int, value bool) error
- func Socket(domain, typ, protocol int) (int, error)
- func Write(fd int, p []byte) (int, error)
- func Writev(fd int, iov []syscall.Iovec) (int, error)
- type OptionSocketFn
- type TCPConn
- func (c *TCPConn) Close() error
- func (c *TCPConn) File() int
- func (c *TCPConn) LocalAddr() net.Addr
- func (c *TCPConn) Read(p []byte) (int, error)
- func (c *TCPConn) RemoteAddr() net.Addr
- func (c *TCPConn) SetDeadline(time.Time) error
- func (c *TCPConn) SetReadDeadline(time.Time) error
- func (c *TCPConn) SetWriteDeadline(time.Time) error
- func (c *TCPConn) Write(p []byte) (int, error)
- type TCPListener
Constants ¶
const ( AF_INET = C.AF_INET AF_INET6 = C.AF_INET6 )
Socket domain constants
const ( SOCK_STREAM = C.SOCK_STREAM SOCK_DGRAM = C.SOCK_DGRAM )
Socket type constants
const ( IPPROTO_TCP = C.IPPROTO_TCP IPPROTO_UDP = C.IPPROTO_UDP )
Protocol constants
const ( SOL_RDMA = C.SOL_RDMA RDMA_SQSIZE = C.RDMA_SQSIZE RDMA_RQSIZE = C.RDMA_RQSIZE RDMA_INLINE = C.RDMA_INLINE RDMA_ROUTE = C.RDMA_ROUTE )
RDMA specific socket options
const ( // Socket level options SOL_SOCKET = syscall.SOL_SOCKET // Socket options SO_REUSEADDR = syscall.SO_REUSEADDR TCP_NODELAY = syscall.TCP_NODELAY SO_ERROR = syscall.SO_ERROR SO_SNDBUF = syscall.SO_SNDBUF SO_RCVBUF = syscall.SO_RCVBUF // RDMA specific options O_NONBLOCK = syscall.O_NONBLOCK )
Socket option constants
Variables ¶
This section is empty.
Functions ¶
func GetPeerName ¶
GetPeerName gets the address of the peer connected to the socket
func GetSockName ¶
GetSockName gets the local address of the socket
func GetSockOpt ¶
GetSockOpt gets a socket option
func GetSockOptInt ¶
GetSockOptInt gets an integer socket option
func Select ¶
func Select(nfds int, readfds, writefds, exceptfds *syscall.FdSet, timeout *syscall.Timeval) (int, error)
Select waits for some file descriptors to become ready to perform I/O
func SetRDMAInline ¶
SetRDMAInline sets RDMA inline size
func SetRDMARQSize ¶
SetRDMARQSize sets RDMA receive queue size
func SetRDMASQSize ¶
SetRDMASQSize sets RDMA send queue size
func SetRecvBuffer ¶
SetRecvBuffer sets SO_RCVBUF option
func SetReuseAddr ¶
SetReuseAddr sets SO_REUSEADDR option
func SetSendBuffer ¶
SetSendBuffer sets SO_SNDBUF option
func SetSockOpt ¶
SetSockOpt sets a socket option
func SetSockOptInt ¶
SetSockOptInt sets an integer socket option
func SetTCPNoDelay ¶
SetTCPNoDelay sets TCP_NODELAY option
Types ¶
type OptionSocketFn ¶
func WithLocalAddr ¶
func WithLocalAddr(ip string, port int) OptionSocketFn
type TCPConn ¶
type TCPConn struct {
// contains filtered or unexported fields
}
func DialTCP ¶
func DialTCP(address string, optFns ...OptionSocketFn) (*TCPConn, error)
DialTCP connects to the address on the named network based on rsocket.
func (*TCPConn) RemoteAddr ¶
RemoteAddr returns the remote network address.
func (*TCPConn) SetDeadline ¶
SetDeadline sets the read and write deadlines associated with the connection. not implementation.
func (*TCPConn) SetReadDeadline ¶
SetReadDeadline sets the read deadline on the connection. not implementation.
func (*TCPConn) SetWriteDeadline ¶
SetWriteDeadline sets the write deadline on the connection. not implementation.
type TCPListener ¶
type TCPListener struct {
// contains filtered or unexported fields
}
TCPListener is a TCP network listener baseded on rsocket.
func NewTCPListener ¶
func NewTCPListener(ip string, port int, backlog int, optFns ...OptionSocketFn) (*TCPListener, error)
NewTCPListener creates a new TCPListener. It binds the listener to the given ip and port.
func (*TCPListener) Accept ¶
func (l *TCPListener) Accept() (net.Conn, error)
Accept waits for and returns the next connection to the listener.
func (*TCPListener) Addr ¶
func (l *TCPListener) Addr() net.Addr
Addr returns the listener's network address.
func (*TCPListener) File ¶
func (l *TCPListener) File() int
File returns the listener's file descriptor.