Documentation ¶
Index ¶
- Variables
- func DialOOB(ctx context.Context, raddr proto.OOBAddr, pc *OOBPacketConn) (net.Conn, error)
- func LeastMTU(node config.Node, defaultMTU uint16) uint16
- func ListenOOB(ctx context.Context, pc *OOBPacketConn) (net.Listener, error)
- func New(ctx context.Context, addr proto.IP, name string, opts ...func(*npOpts)) (proto.Netopus, error)
- func WithMTU(mtu uint16) func(*npOpts)
- func WithNewConfigFunc(ncf func([]byte, []byte)) func(*npOpts)
- type OOBCloseFunc
- type OOBConn
- type OOBListener
- type OOBOutboundFunc
- type OOBPacketConn
- func (c *OOBPacketConn) Close() error
- func (c *OOBPacketConn) IncomingPacket(msg *proto.OOBMessage) error
- func (c *OOBPacketConn) LocalAddr() net.Addr
- func (c *OOBPacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)
- func (c *OOBPacketConn) SetDeadline(t time.Time) error
- func (c *OOBPacketConn) SetReadDeadline(t time.Time) error
- func (c *OOBPacketConn) SetWriteDeadline(_ time.Time) error
- func (c *OOBPacketConn) WriteTo(p []byte, addr net.Addr) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotImplemented = fmt.Errorf("not implemented")
View Source
var ErrPortInUse = fmt.Errorf("port in use")
View Source
var ErrTimeout = fmt.Errorf("timeout")
Functions ¶
func LeastMTU ¶
LeastMTU gives the smallest MTU of any backend defined on a node. If there are no backends, defaultMTU is returned.
func New ¶
func New(ctx context.Context, addr proto.IP, name string, opts ...func(*npOpts)) (proto.Netopus, error)
New constructs and returns a new network node on a given address
func WithNewConfigFunc ¶
Types ¶
type OOBCloseFunc ¶
type OOBCloseFunc func() error
type OOBListener ¶
type OOBListener struct { *kcp.Listener // contains filtered or unexported fields }
type OOBOutboundFunc ¶
type OOBOutboundFunc func(message *proto.OOBMessage) error
type OOBPacketConn ¶
type OOBPacketConn struct {
// contains filtered or unexported fields
}
func NewPacketConn ¶
func NewPacketConn(ctx context.Context, sendFunc OOBOutboundFunc, closeFunc OOBCloseFunc, sourceAddr proto.IP, sourcePort uint16) (*OOBPacketConn, error)
func (*OOBPacketConn) Close ¶
func (c *OOBPacketConn) Close() error
func (*OOBPacketConn) IncomingPacket ¶
func (c *OOBPacketConn) IncomingPacket(msg *proto.OOBMessage) error
func (*OOBPacketConn) LocalAddr ¶
func (c *OOBPacketConn) LocalAddr() net.Addr
func (*OOBPacketConn) SetDeadline ¶
func (c *OOBPacketConn) SetDeadline(t time.Time) error
func (*OOBPacketConn) SetReadDeadline ¶
func (c *OOBPacketConn) SetReadDeadline(t time.Time) error
func (*OOBPacketConn) SetWriteDeadline ¶
func (c *OOBPacketConn) SetWriteDeadline(_ time.Time) error
Click to show internal directories.
Click to hide internal directories.