Documentation ¶
Index ¶
- type Network
- type UDPConn
- func (c *UDPConn) Close() error
- func (c *UDPConn) LocalAddr() net.Addr
- func (c *UDPConn) Read(buffer []byte) (int, error)
- func (c *UDPConn) ReadFrom(buffer []byte) (int, net.Addr, error)
- func (c *UDPConn) RemoteAddr() net.Addr
- func (c *UDPConn) SetDeadline(t time.Time) error
- func (c *UDPConn) SetReadDeadline(t time.Time) error
- func (c *UDPConn) SetWriteDeadline(t time.Time) error
- func (c *UDPConn) Write(data []byte) (int, error)
- func (c *UDPConn) WriteTo(data []byte, addr net.Addr) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network simulates a TCP/IP network. The zero value is invalid; please, use NewNetwork to construct.
func NewNetwork ¶
func NewNetwork() *Network
NewNetwork constructs an Network instance and spawns a background goroutine for processing network events that runs until you call the Close method.
type UDPConn ¶
type UDPConn struct {
// contains filtered or unexported fields
}
UDPConn is an UDP connection. The zero value of this struct is invalid; please, use NewUDPConn to construct.
func NewUDPConn ¶
NewUDPConn creates a new UDPConn instance.
Arguments:
- network is the Network to use;
- localAddr is the local address of the connection;
- peerAddr is the OPTIONAL peer address.
A zero value remoteAddr implies this socket is not connected.
func (*UDPConn) RemoteAddr ¶
RemoteAddr returns the POSSIBLY NIL remote addr.
func (*UDPConn) SetDeadline ¶
SetDeadline sets the read and the write deadlines.
func (*UDPConn) SetReadDeadline ¶
SetReadDeadline sets the read deadline.
func (*UDPConn) SetWriteDeadline ¶
SetWriteDeadline sets the read deadline.