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. | |
| UdpClient (std::string ipAddress, uint16_t port, std::string nicIpAddress, std::string multicastIpAddress, bool shareAddress=true) | |
| Multicast UDP socket constructor. | |
| int | Connection () const noexcept override |
| Connection descriptor for sending and receiving. | |
| bool | TrySetup () noexcept override |
| Try to setup the communicator. | |
| 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. | |
| 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. | |
Public Member Functions inherited from AsyncBsdSocketLib::Communicator | |
| int | Descriptor () const noexcept |
| File descriptor. | |
| virtual bool | TryClose () noexcept |
| Try to close the communicator. | |
Additional Inherited Members | |
Protected Member Functions inherited from AsyncBsdSocketLib::NetworkSocket | |
| NetworkSocket (std::string ipAddress, uint16_t port) | |
| Constructor. | |
Protected Attributes inherited from AsyncBsdSocketLib::NetworkSocket | |
| const std::string | IpAddress |
| Listening/Connecting IP address for server/client. | |
| const uint16_t | Port |
| Listening/Connecting port number for server/client. | |
Protected Attributes inherited from AsyncBsdSocketLib::Communicator | |
| 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.