Documentation ¶
Index ¶
- Constants
- Variables
- func Dial(network, address string) (net.Conn, error)
- func Listen(network, addr string) (net.Listener, error)
- func ListenConn(conn net.PacketConn) (net.Listener, error)
- func NewConn(pc net.PacketConn, addr net.Addr) (net.Conn, error)
- type Packet
- type PacketType
- type ProtocolPacketError
Constants ¶
View Source
const ( PacketData = PacketType(iota) PacketInit PacketCookie PacketCookieEcho PacketCookieAck PacketShutdown PacketShutdownAck PacketShutdownComplete PacketAbort )
Variables ¶
View Source
var ( ErrConnectionReset = errors.New("Connection has been reset") ErrConnectionClosed = errors.New("Connection has been closed") ErrReadTimeout = errors.New("Read operation timeout") )
View Source
var ( ErrBadProcolPacket = errors.New("Unexpected packet from peer") ErrBadDataPacketLength = errors.New("Bad peer DATA packet length") ErrPeerAckedUnsentData = errors.New("Peer acked unsent data") ErrPeerNotResponding = errors.New("Peer not responding to traffic") )
View Source
var ( ErrBadAddress = errors.New("Bad peer address") ErrNotPacketConn = errors.New("Not a packet connection network") ErrConnectFailed = errors.New("Connection to remote peer failed") )
View Source
var ErrListenerClosed = errors.New("Listener has been closed")
Functions ¶
func Dial ¶
Connects to a remote host The network net must be a packet-oriented netowrk: "udp", "udp4", "udp6", "unixgram".
func Listen ¶
Listen announces on the local network address laddr. The network net must be a packet-oriented netowrk: "udp", "udp4", "udp6", "unixgram".
func ListenConn ¶
func ListenConn(conn net.PacketConn) (net.Listener, error)
Listen announces on existing packet-based connection
Types ¶
type PacketType ¶
type PacketType byte
type ProtocolPacketError ¶
type ProtocolPacketError struct {
Type PacketType
}
func (ProtocolPacketError) Error ¶
func (err ProtocolPacketError) Error() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.