AUI Framework
master
Cross-platform module-based framework for developing C++20 desktop applications
|
A bidirectional UDP socket. More...
A bidirectional UDP socket.
Public Member Functions | |
AUdpSocket (uint16_t port) | |
Creates socket. More... | |
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. More... | |
void | read (AByteBuffer &buf, AInet4Address &dst) |
Read data. More... | |
Public Member Functions inherited from AAbstractSocket | |
AAbstractSocket (const AAbstractSocket &)=delete | |
void | close () |
void | setTimeout (int secs) |
const AInet4Address & | getAddress () const |
Protected Member Functions | |
int | createSocket () override |
Create socket handle. Use ::socket() More... | |
Protected Member Functions inherited from AAbstractSocket | |
int | getHandle () const |
AAbstractSocket (int handle, const AInet4Address &selfAddress) | |
void | init () |
Initialise socket. | |
void | bind (uint16_t bindingPort) |
Bind socket for port. Used for ATcpServerSocket and AUdpSocket. More... | |
Additional Inherited Members | |
Static Protected Member Functions inherited from AAbstractSocket | |
static AString | getErrorString () |
static void | handleError (const AString &message, int code) |
AUdpSocket::AUdpSocket | ( | uint16_t | port | ) |
Creates socket.
port | port |
|
overrideprotectedvirtual |
Create socket handle. Use ::socket()
Implements AAbstractSocket.
void AUdpSocket::read | ( | AByteBuffer & | buf, |
AInet4Address & | dst | ||
) |
Read data.
buf | (out) received data |
dst | (out) sender address |
void AUdpSocket::write | ( | AByteBufferView | buf, |
const AInet4Address & | dst | ||
) |
Sends data by address.
buf | data buffer |
dst | destination delivery address |
#include <AUI/Network/AUdpSocket.h>