#include <UDP.h>
Public Member Functions | |
bool | Send (const Address &addr, const void *data, uint dataLen) |
Sends a packet of data to a specific address. Returns false if the send failed. | |
uint16 | GetLocalPort () const |
Returns the local port. | |
bool | Receive (std::vector< uint8 > &data, Address *source=0) |
Receives the next packet and appends it to data. source (if not 0) will be filled with the address the packet came from. Returns false if there was nothing to receive (does not block). | |
Static Public Member Functions | |
static UDPClient * | Create (uint16 localPort=0, bool allowBroadcast=false, bool openNatAutomatically=true) |
Creates a socket to be used to send/receivee upd packets. If localPort is 0, the system picks a random port to use. Returns 0 on failure. | |
static void | FreeClient (UDPClient *client) |
Frees a UDPClient. |