Documentation ¶
Overview ¶
Package udp provides a connection-oriented listener over a UDP PacketConn
Index ¶
- Variables
- func Listen(network string, laddr *net.UDPAddr) (net.Listener, error)
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) Read(p []byte) (int, 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) (n int, err error)
- type ListenConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrClosedListener = errors.New("udp: listener closed") ErrListenQueueExceeded = errors.New("udp: listen queue exceeded") )
Typed errors
Functions ¶
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn augments a connection-oriented connection over a UDP PacketConn
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 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 }
ListenConfig stores options for listening to an address.
Click to show internal directories.
Click to hide internal directories.