Agora
1.2.0
Agora project
|
Go to the documentation of this file.
10 # error "include udp_client-windows.h instead"
16 #include <sys/socket.h>
17 #include <netinet/in.h>
18 #include <arpa/inet.h>
21 #include <netinet/udp.h>
46 socket_ = ::socket(PF_INET, SOCK_DGRAM, 0);
53 if (::setsockopt(
socket_, SOL_SOCKET, SO_SNDBUF,
reinterpret_cast<const char *
>(&option_value),
sizeof(option_value)) < 0)
62 if (::inet_aton(host.c_str(), &
sockAddr_.sin_addr) == 0)
86 socklen_t tolen =
sizeof(
struct sockaddr);
~udp_client()
Definition: udp_client.h:71
SOCKET socket_
Definition: udp_client-windows.h:27
static constexpr int TX_BUFFER_SIZE
Definition: udp_client-windows.h:26
void close()
Definition: matplotlibcpp.h:2567
SPDLOG_INLINE void throw_spdlog_ex(const std::string &msg, int last_errno)
Definition: common-inl.h:72
void send(const char *data, size_t n_bytes)
Definition: udp_client.h:83
void cleanup_()
Definition: udp_client.h:34
struct sockaddr_in sockAddr_
Definition: udp_client.h:32
udp_client(const std::string &host, uint16_t port)
Definition: udp_client.h:44
int fd() const
Definition: udp_client.h:76