uvw 3.1.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
uvw::get_addr_info_req Class Referencefinal

The getaddrinfo request. More...

#include <dns.h>

Inheritance diagram for uvw::get_addr_info_req:
Inheritance graph
[legend]
Collaboration diagram for uvw::get_addr_info_req:
Collaboration graph
[legend]

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< T, U, E >
template<typename R = void>
std::shared_ptr< R > data () const
 Gets user-defined data. uvw won't use this field in any case.
 
void data (std::shared_ptr< void > udata)
 Sets arbitrary data. uvw won't use this field in any case.
 
- Public Member Functions inherited from uvw::uv_type< U >
virtual int init ()
 Initializes the handle.
 
loopparent () const noexcept
 Gets the loop from which the resource was originated.
 
const U * raw () const noexcept
 Gets the underlying raw data structure.
 
U * raw () noexcept
 Gets the underlying raw data structure.
 
- Public Member Functions inherited from uvw::emitter< T, E... >
void on (listener_t< U > f)
 Registers a long-lived listener with the event emitter.
 
void reset () noexcept
 Disconnects the listener for the given event type.
 
void reset () noexcept
 Disconnects all listeners.
 
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: