Skip to content

AUdpSocket#

A bidirectional UDP socket.

Header:#include <AUI/Network/AUdpSocket.h>
CMake:aui_link(my_target PUBLIC aui::network)

Public Methods#

AUdpSocket#


AUdpSocket::AUdpSocket(uint16_t port)

Creates socket

Arguments
port
port

AUdpSocket::AUdpSocket()

Creates socket with random port (used for "client" socket)

read#


void AUdpSocket::read(AByteBuffer& buf, AInet4Address& dst)

Read data.

Arguments
buf
(out) received data
dst
(out) sender address

write#


void AUdpSocket::write(AByteBufferView buf, const AInet4Address& dst)

Sends data by address.

Arguments
buf
data buffer
dst
destination delivery address