uvw 3.4.0
Loading...
Searching...
No Matches
uvw::get_addr_info_req Class Referencefinal

The getaddrinfo request. More...

#include <dns.h>

Inheritance diagram for uvw::get_addr_info_req:
Collaboration diagram for uvw::get_addr_info_req:

Public Member Functions

int node_addr_info (const std::string &node, addrinfo *hints=nullptr)
 Async getaddrinfo.
std::pair< bool, std::unique_ptr< addrinfo, deleter > > node_addr_info_sync (const std::string &node, addrinfo *hints=nullptr)
 Sync getaddrinfo.
int service_addr_info (const std::string &service, addrinfo *hints=nullptr)
 Async getaddrinfo.
std::pair< bool, std::unique_ptr< addrinfo, deleter > > service_addr_info_sync (const std::string &service, addrinfo *hints=nullptr)
 Sync getaddrinfo.
int addr_info (const std::string &node, const std::string &service, addrinfo *hints=nullptr)
 Async getaddrinfo.
std::pair< bool, std::unique_ptr< addrinfo, deleter > > addr_info_sync (const std::string &node, const std::string &service, addrinfo *hints=nullptr)
 Sync getaddrinfo.
Public Member Functions inherited from uvw::request< get_addr_info_req, uv_getaddrinfo_t, addr_info_event >
int cancel ()
 Cancels a pending request.
std::size_t size () const noexcept
 Returns the size of the underlying request type.
Public Member Functions inherited from uvw::resource< get_addr_info_req, uv_getaddrinfo_t, E... >
std::shared_ptr< R > data () const
 Gets user-defined data. uvw won't use this field in any case.
Public Member Functions inherited from uvw::uv_type< uv_getaddrinfo_t >
loopparent () const noexcept
 Gets the loop from which the resource was originated.
const uv_getaddrinfo_t * raw () const noexcept
 Gets the underlying raw data structure.
Public Member Functions inherited from uvw::emitter< get_addr_info_req, E... >
void on (listener_t< Type > f)
 Registers a long-lived listener with the event emitter.
void reset () noexcept
 Disconnects the listener for the given event type.
bool has () const noexcept
 Checks if there is a listener registered for the specific event.

Detailed Description

The getaddrinfo request.

Wrapper for getaddrinfo.
It offers either asynchronous and synchronous access methods.

To create a get_addr_info_req through a loop, no arguments are required.

Definition at line 58 of file dns.h.

Member Function Documentation

◆ addr_info()

int uvw::get_addr_info_req::addr_info ( const std::string & node,
const std::string & service,
addrinfo * hints = nullptr )

Async getaddrinfo.

Parameters
nodeEither a numerical network address or a network hostname.
serviceEither a service name or a port number as a string.
hintsOptional addrinfo data structure with additional address type constraints.
Returns
Underlying return value.

◆ addr_info_sync()

std::pair< bool, std::unique_ptr< addrinfo, deleter > > uvw::get_addr_info_req::addr_info_sync ( const std::string & node,
const std::string & service,
addrinfo * hints = nullptr )

Sync getaddrinfo.

Parameters
nodeEither a numerical network address or a network hostname.
serviceEither a service name or a port number as a string.
hintsOptional addrinfo data structure with additional address type constraints.
Returns
A std::pair composed as it follows:
  • A boolean value that is true in case of success, false otherwise.
  • A std::unique_ptr<addrinfo, deleter> containing the data requested.

◆ node_addr_info()

int uvw::get_addr_info_req::node_addr_info ( const std::string & node,
addrinfo * hints = nullptr )

Async getaddrinfo.

Parameters
nodeEither a numerical network address or a network hostname.
hintsOptional addrinfo data structure with additional address type constraints.
Returns
Underlying return value.

◆ node_addr_info_sync()

std::pair< bool, std::unique_ptr< addrinfo, deleter > > uvw::get_addr_info_req::node_addr_info_sync ( const std::string & node,
addrinfo * hints = nullptr )

Sync getaddrinfo.

Parameters
nodeEither a numerical network address or a network hostname.
hintsOptional addrinfo data structure with additional address type constraints.
Returns
A std::pair composed as it follows:
  • A boolean value that is true in case of success, false otherwise.
  • A std::unique_ptr<addrinfo, deleter> containing the data requested.

◆ service_addr_info()

int uvw::get_addr_info_req::service_addr_info ( const std::string & service,
addrinfo * hints = nullptr )

Async getaddrinfo.

Parameters
serviceEither a service name or a port number as a string.
hintsOptional addrinfo data structure with additional address type constraints.
Returns
Underlying return value.

◆ service_addr_info_sync()

std::pair< bool, std::unique_ptr< addrinfo, deleter > > uvw::get_addr_info_req::service_addr_info_sync ( const std::string & service,
addrinfo * hints = nullptr )

Sync getaddrinfo.

Parameters
serviceEither a service name or a port number as a string.
hintsOptional addrinfo data structure with additional address type constraints.
Returns
A std::pair composed as it follows:
  • A boolean value that is true in case of success, false otherwise.
  • A std::unique_ptr<addrinfo, deleter> containing the data requested.

The documentation for this class was generated from the following file: