Documentation
¶
Overview ¶
Package conn provides a connection-oriented listener over a UDP PacketConn
Index ¶
- func Dial(network string, laddr *net.UDPAddr, raddr *net.UDPAddr) (types.PacketConn, error)
- func Listen(network string, laddr *net.UDPAddr) (types.SuperConn, error)
- func WrapConnectedConn(rawConn types.RawConn, dc *ConnConfig) (types.PacketConn, error)
- func WrapListenConn(rawConn types.RawConn, lc *ListenConfig) (types.SuperConn, error)
- func WrapUnconnectedConn(rawConn types.RawConn, rAddr net.Addr, dc *ConnConfig) (types.PacketConn, error)
- type Conn
- func (c *Conn) Capabilities() types.ConnCapabilities
- func (c *Conn) Close() error
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) Read(p []byte, oob []byte) (int, int, types.ECN, error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) SetDeadline(t time.Time) error
- func (c *Conn) SetReadDeadline(t time.Time) error
- func (c *Conn) SetWriteDeadline(t time.Time) error
- func (c *Conn) Write(p []byte, oob []byte, gsoSize int, ecn types.ECN) (n int, oobN int, err error)
- type ConnConfig
- type ListenConfig
- type SingleAddrConn
- func (c *SingleAddrConn) Capabilities() types.ConnCapabilities
- func (c *SingleAddrConn) Close() error
- func (c *SingleAddrConn) LocalAddr() net.Addr
- func (c *SingleAddrConn) Read(p []byte, oob []byte) (dataN int, oobN int, ecn types.ECN, err error)
- func (c *SingleAddrConn) RemoteAddr() net.Addr
- func (c *SingleAddrConn) SetDeadline(t time.Time) error
- func (c *SingleAddrConn) SetReadDeadline(t time.Time) error
- func (c *SingleAddrConn) SetWriteDeadline(t time.Time) error
- func (c *SingleAddrConn) Write(p []byte, oob []byte, gsoSize int, ecn types.ECN) (dataN int, oobN int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapConnectedConn ¶
func WrapConnectedConn(rawConn types.RawConn, dc *ConnConfig) (types.PacketConn, error)
func WrapListenConn ¶
func WrapUnconnectedConn ¶
func WrapUnconnectedConn(rawConn types.RawConn, rAddr net.Addr, dc *ConnConfig) (types.PacketConn, error)
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn augments a connection-oriented connection over a UDP PacketConn.
func (*Conn) Capabilities ¶
func (c *Conn) Capabilities() types.ConnCapabilities
func (*Conn) RemoteAddr ¶
RemoteAddr implements net.Conn.RemoteAddr.
func (*Conn) SetDeadline ¶
SetDeadline implements net.Conn.SetDeadline.
func (*Conn) SetReadDeadline ¶
SetReadDeadline implements net.Conn.SetDeadline.
func (*Conn) SetWriteDeadline ¶
SetWriteDeadline implements net.Conn.SetDeadline.
type ConnConfig ¶
type ConnConfig struct {
// ReadBufferSize sets the size of the operating system's
// receive buffer associated with the dialed connection.
// The only time this is effective is when a super-connection
// is being created.
ReadBufferSize int
// WriteBufferSize sets the size of the operating system's
// send buffer associated with the connection.
// The only time this is effective is when a super-connection
// is being created.
WriteBufferSize int
// WriteIntervals sets the duration that takes the connection to
// automatically flush the buffers. If set to zero, buffering
// will be disabled.
WriteInterval time.Duration
}
ConnConfig stores options for dialing an address or received connections.
type ListenConfig ¶
type ListenConfig struct {
// Backlog defines the maximum length of the queue of pending
// connections. It is equivalent of the backlog argument of
// POSIX listen function.
// If a connection request arrives when the queue is full,
// the request will be silently discarded, unlike TCP.
// Set zero to use default value 128 which is same as Linux default.
Backlog int
// AcceptFilter determines whether the new conn should be made for
// the incoming packet. If not set, any packet creates new conn.
AcceptFilter func([]byte) bool
ConnConfig
}
ListenConfig stores options for listening to an address.
type SingleAddrConn ¶
type SingleAddrConn struct {
// contains filtered or unexported fields
}
func (*SingleAddrConn) Capabilities ¶
func (c *SingleAddrConn) Capabilities() types.ConnCapabilities
func (*SingleAddrConn) Close ¶
func (c *SingleAddrConn) Close() error
func (*SingleAddrConn) LocalAddr ¶
func (c *SingleAddrConn) LocalAddr() net.Addr
func (*SingleAddrConn) RemoteAddr ¶
func (c *SingleAddrConn) RemoteAddr() net.Addr
func (*SingleAddrConn) SetDeadline ¶
func (c *SingleAddrConn) SetDeadline(t time.Time) error
func (*SingleAddrConn) SetReadDeadline ¶
func (c *SingleAddrConn) SetReadDeadline(t time.Time) error
func (*SingleAddrConn) SetWriteDeadline ¶
func (c *SingleAddrConn) SetWriteDeadline(t time.Time) error