Agora
1.2.0
Agora project
|
Go to the documentation of this file.
17 explicit UDPServer(std::string local_address, uint16_t local_port,
18 size_t rx_buffer_size = 0)
22 explicit UDPServer(std::string local_address, std::string local_port,
23 size_t rx_buffer_size = 0)
39 inline ssize_t
Connect(
const std::string& remote_address,
40 const std::string& remote_port) {
43 inline ssize_t
Connect(
const std::string& remote_address,
44 uint16_t remote_port) {
58 inline ssize_t
Recv(
const std::string& src_address, uint16_t
src_port,
72 inline const std::string&
Port()
const {
return port_; }
83 #endif // UDP_SERVER_IPV6_H_
byte
Definition: core.h:388
Declaration file for the UDPComm class. This class is used to send messages and receive messages from...
void MakeBlocking(size_t rx_timeout_sec=0) const
Configures the socket in blocking mode. Any calls to recv / send will now block.
Definition: udp_comm.cc:449
Definition: udp_comm.h:18
uint16_t src_port
Definition: eth_common.h:60
UDPComm comm_object_
Definition: udp_server.h:80
const std::string & Port() const
Definition: udp_server.h:72
ssize_t Connect(const std::string &remote_address, const std::string &remote_port)
The remote_address | remote_port is the only address to which datagrams are received....
Definition: udp_server.h:39
UDPServer(std::string local_address, std::string local_port, size_t rx_buffer_size=0)
Definition: udp_server.h:22
Basic UDP server class based on OS sockets that supports receiving messages.
Definition: udp_server.h:13
ssize_t Recv(const std::string &src_address, uint16_t src_port, std::byte *buf, size_t len)
Definition: udp_server.h:58
const std::string & Address() const
Definition: udp_server.h:71
uint16_t len
Definition: eth_common.h:62
UDPServer(std::string local_address, uint16_t local_port, size_t rx_buffer_size=0)
Definition: udp_server.h:17
ssize_t Recv(std::byte *buf, size_t len) const
Try to receive up to len bytes in buf by default this will not block.
Definition: udp_comm.cc:372
ssize_t Connect(const std::string &remote_address, uint16_t remote_port) const
The remote_address | remote_port is the address to which datagrams are sent. 1:1 association me<->rem...
Definition: udp_comm.cc:250
Definition: json.hpp:5213
void MakeBlocking(size_t timeout_sec=0) const
Configures the socket in blocking mode. Any calls to recv / send will now block.
Definition: udp_server.h:67
std::string to_string() const
Definition: eth_common.h:64
UDPServer & operator=(const UDPServer &)=delete
ssize_t Recv(std::byte *buf, size_t len) const
Try to receive up to len bytes in buf by default this will not block.
Definition: udp_server.h:55
ssize_t Connect(const std::string &remote_address, uint16_t remote_port)
Definition: udp_server.h:43
const std::string address_
The UDP port to server is listening on.
Definition: udp_server.h:78
const std::string port_
Definition: udp_server.h:79