AUI Framework
master
Cross-platform base for C++ UI apps
|
A bidirectional UDP socket.
#include <AUI/Network/AUdpSocket.h>
Public Member Functions# | |
AUdpSocket (uint16_t port) | |
Creates socket. | |
AUdpSocket () | |
Creates socket with random port (used for "client" socket) | |
AUdpSocket (const AUdpSocket &)=delete | |
void | write (AByteBufferView buf, const AInet4Address &dst) |
Sends data by address. | |
void | read (AByteBuffer &buf, AInet4Address &dst) |
Read data. | |
![]() | |
AAbstractSocket (const AAbstractSocket &)=delete | |
void | close () |
void | setTimeout (int secs) |
const AInet4Address & | getAddress () const |
Protected Member Functions# | |
int | createSocket () override |
Creates socket handle. | |
![]() | |
int | getHandle () const |
AAbstractSocket (int handle, const AInet4Address &selfAddress) | |
void | init () |
Initialise socket. | |
void | bind (uint16_t bindingPort) |
Binds socket for port. Used for ATcpServerSocket and AUdpSocket. | |
Additional Inherited Members# | |
![]() | |
static AString | getErrorString () |
static void | handleError (const AString &message, int code) |
AUdpSocket::AUdpSocket | ( | uint16_t | port | ) |
port | port |
|
overrideprotectedvirtual |
Implements AAbstractSocket.
void AUdpSocket::read | ( | AByteBuffer & | buf, |
AInet4Address & | dst ) |
buf | (out) received data |
dst | (out) sender address |
void AUdpSocket::write | ( | AByteBufferView | buf, |
const AInet4Address & | dst ) |
buf | data buffer |
dst | destination delivery address |