Documentation ¶
Overview ¶
Package gonet provides a Go net package compatible wrapper for a tcpip stack.
Index ¶
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) Read(b []byte) (int, error)
- func (c *Conn) RemoteAddr() net.Addr
- func (d *Conn) SetDeadline(t time.Time) error
- func (d *Conn) SetReadDeadline(t time.Time) error
- func (d *Conn) SetWriteDeadline(t time.Time) error
- func (c *Conn) Write(b []byte) (int, error)
- type Listener
- type PacketConn
- func (c *PacketConn) Close() error
- func (c *PacketConn) LocalAddr() net.Addr
- func (c *PacketConn) ReadFrom(b []byte) (int, net.Addr, error)
- func (d *PacketConn) SetDeadline(t time.Time) error
- func (d *PacketConn) SetReadDeadline(t time.Time) error
- func (d *PacketConn) SetWriteDeadline(t time.Time) error
- func (c *PacketConn) WriteTo(b []byte, addr net.Addr) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
A Conn is a wrapper around a tcpip.Endpoint that implements the net.Conn interface.
func DialTCP ¶
func DialTCP(s *stack.Stack, addr tcpip.FullAddress, network tcpip.NetworkProtocolNumber) (*Conn, error)
DialTCP creates a new TCP Conn connected to the specified address.
func (*Conn) RemoteAddr ¶
RemoteAddr implements net.Conn.RemoteAddr.
func (*Conn) SetDeadline ¶
SetDeadline implements net.Conn.SetDeadline and net.PacketConn.SetDeadline.
func (*Conn) SetReadDeadline ¶
SetReadDeadline implements net.Conn.SetReadDeadline and net.PacketConn.SetReadDeadline.
func (*Conn) SetWriteDeadline ¶
SetWriteDeadline implements net.Conn.SetWriteDeadline and net.PacketConn.SetWriteDeadline.
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
A Listener is a wrapper around a tcpip endpoint that implements net.Listener.
func NewListener ¶
func NewListener(s *stack.Stack, addr tcpip.FullAddress, network tcpip.NetworkProtocolNumber) (*Listener, error)
NewListener creates a new Listener.
type PacketConn ¶
type PacketConn struct {
// contains filtered or unexported fields
}
A PacketConn is a wrapper around a tcpip endpoint that implements net.PacketConn.
func NewPacketConn ¶
func NewPacketConn(s *stack.Stack, addr tcpip.FullAddress, network tcpip.NetworkProtocolNumber) (*PacketConn, error)
NewPacketConn creates a new PacketConn.
func (*PacketConn) Close ¶
func (c *PacketConn) Close() error
Close implements net.PacketConn.Close.
func (*PacketConn) LocalAddr ¶
func (c *PacketConn) LocalAddr() net.Addr
LocalAddr implements net.PacketConn.LocalAddr.
func (*PacketConn) SetDeadline ¶
SetDeadline implements net.Conn.SetDeadline and net.PacketConn.SetDeadline.
func (*PacketConn) SetReadDeadline ¶
SetReadDeadline implements net.Conn.SetReadDeadline and net.PacketConn.SetReadDeadline.
func (*PacketConn) SetWriteDeadline ¶
SetWriteDeadline implements net.Conn.SetWriteDeadline and net.PacketConn.SetWriteDeadline.