public class PacketPeerUDP : PacketPeer
UDP packet peer. Can be used to send raw UDP packets as well as Variants.
public void Close()
public string GetPacketIp()
public int GetPacketPort()
public bool IsListening()
public Error Listen(int port, string bindAddress = "*", int recvBufSize = 65536)
PacketPeerUDPlisten on the “port” binding to “bind_address” with a buffer size “recv_buf_size”.
If “bind_address” is set as “*” (default), the peer will listen on all available addresses (both IPv4 and IPv6).
If “bind_address” is set as “0.0.0.0” (for IPv4) or “::” (for IPv6), the peer will listen on all available addresses matching that IP type.
If “bind_address” is set to any valid address (e.g. “192.168.1.101”, “::1”, etc), the peer will only listen on the interface with that addresses (or fail if no interface with the given address exists).
public Error SetDestAddress(string host, int port)
public Error Wait()
Wait for a packet to arrive on the listening port, see Listen(int, string, int).