9int main(
int argc,
char **argv) {
11 std::cerr <<
"Usage: " << argv[0] <<
" <path>\n";
17 std::cout <<
"Sending. UDP datagram on socket: " << argv[1] <<
"...\n";
18 std::string data =
"Hello, World!\n";
19 sock.
sendto(data.c_str(), data.length());
22 std::cerr <<
"Exception: " << e.
text() <<
"\n";
Lightweight exception wrapper for MXNetwork failures.
std::string text() const
Return the stored error text.
C++ wrapper around the MXNetwork socket API.
ssize_t sendto(const void *buf, size_t bytes)
Send a datagram using the configured socket type.
bool connect_unix(const std::string_view path)
Connect to a UNIX-domain endpoint.
@ TYPE_UNIX_DGRAM
UNIX-domain datagram socket.