Woman, Life, Freedom |
Async BSD Sockets Library
Library protected and public interface header documentation
|
UDP client which can play both client and listener roles. More...
#include <udp_client.h>
Public Member Functions | |
UdpClient (std::string ipAddress, uint16_t port) | |
Unicast UDP socket constructor. More... | |
UdpClient (std::string ipAddress, uint16_t port, std::string nicIpAddress, std::string multicastIpAddress, bool shareAddress=true) | |
Multicast UDP socket constructor. More... | |
int | Connection () const noexcept override |
Connection descriptor for sending and receiving. More... | |
bool | TrySetup () noexcept override |
Try to setup the communicator. More... | |
template<std::size_t N> | |
ssize_t | Send (const std::array< uint8_t, N > &buffer, std::string ipAddress, uint16_t port) const noexcept |
Send a byte array to a destination. More... | |
template<std::size_t N> | |
ssize_t | Receive (std::array< uint8_t, N > &buffer, std::string &ipAddress, uint16_t &port) const noexcept |
Receive a byte array from a source. More... | |
![]() | |
int | Descriptor () const noexcept |
File descriptor. More... | |
virtual bool | TryClose () noexcept |
Try to close the communicator. More... | |
Additional Inherited Members | |
![]() | |
NetworkSocket (std::string ipAddress, uint16_t port) | |
Constructor. More... | |
![]() | |
const std::string | IpAddress |
Listening/Connecting IP address for server/client. | |
const uint16_t | Port |
Listening/Connecting port number for server/client. | |
![]() | |
int | FileDescriptor |
File descriptor. | |
UDP client which can play both client and listener roles.
AsyncBsdSocketLib::UdpClient::UdpClient | ( | std::string | ipAddress, |
uint16_t | port | ||
) |
Unicast UDP socket constructor.
ipAddress | Binding IP address |
port | Binding port number |
AsyncBsdSocketLib::UdpClient::UdpClient | ( | std::string | ipAddress, |
uint16_t | port, | ||
std::string | nicIpAddress, | ||
std::string | multicastIpAddress, | ||
bool | shareAddress = true |
||
) |
Multicast UDP socket constructor.
ipAddress | Binding IP address |
port | Binding port number |
nicIpAddress | Multicast traffic network interface IP address |
multicastIpAddress | Multicast group traffic IP address |
shareAddress | Indicates whether to share the multicast listening address or not |
|
overridevirtualnoexcept |
Connection descriptor for sending and receiving.
Implements AsyncBsdSocketLib::Communicator.
|
inlinenoexcept |
Receive a byte array from a source.
N | Receive buffer size |
buffer | Receive buffer byte array |
ipAddress | Source IP address |
port | Source port number |
|
inlinenoexcept |
Send a byte array to a destination.
N | Send buffer size |
buffer | Send buffer byte array |
ipAddress | Destination IP address |
port | Destination port number |
|
overridevirtualnoexcept |
Try to setup the communicator.
Implements AsyncBsdSocketLib::Communicator.