|
using | OnReceive = std::function<PacketList(PacketList&& packets)> |
|
|
virtual int | sendTo (const SockAddr &dest, const uint8_t *data, size_t size, bool replied)=0 |
|
void | setOnReceive (OnReceive &&cb) |
|
virtual bool | hasIPv4 () const =0 |
|
virtual bool | hasIPv6 () const =0 |
|
SockAddr | getBound (sa_family_t family=AF_UNSPEC) const |
|
in_port_t | getPort (sa_family_t family=AF_UNSPEC) const |
|
virtual const SockAddr & | getBoundRef (sa_family_t family=AF_UNSPEC) const =0 |
|
virtual std::vector< SockAddr > | resolve (const std::string &host, const std::string &service={}) |
|
virtual void | stop ()=0 |
|
Definition at line 62 of file network_utils.h.
◆ OnReceive
A function that takes a list of new received packets and optionally returns consumed packets for recycling.
Definition at line 67 of file network_utils.h.
◆ ~DatagramSocket()
virtual dht::net::DatagramSocket::~DatagramSocket |
( |
| ) |
|
|
inlinevirtual |
◆ getBound()
SockAddr dht::net::DatagramSocket::getBound |
( |
sa_family_t | family = AF_UNSPEC | ) |
const |
|
inline |
◆ getNewPacket()
PacketList dht::net::DatagramSocket::getNewPacket |
( |
| ) |
|
|
inlineprotected |
◆ getPort()
in_port_t dht::net::DatagramSocket::getPort |
( |
sa_family_t | family = AF_UNSPEC | ) |
const |
|
inline |
◆ onReceived()
void dht::net::DatagramSocket::onReceived |
( |
PacketList && | packets | ) |
|
|
inlineprotected |
◆ resolve()
virtual std::vector< SockAddr > dht::net::DatagramSocket::resolve |
( |
const std::string & | host, |
|
|
const std::string & | service = {} ) |
|
inlinevirtual |
Virtual resolver mothod allows to implement custom resolver
Definition at line 92 of file network_utils.h.
◆ setOnReceive()
void dht::net::DatagramSocket::setOnReceive |
( |
OnReceive && | cb | ) |
|
|
inline |
◆ lock
std::mutex dht::net::DatagramSocket::lock |
|
mutableprotected |
The documentation for this class was generated from the following file: