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

The getnameinfo request. More...

#include <dns.h>

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

Public Member Functions

int name_info (const sockaddr &addr, int flags=0)
 Async getnameinfo.
 
int name_info (const std::string &ip, unsigned int port, int flags=0)
 Async getnameinfo.
 
int name_info (socket_address addr, int flags=0)
 Async getnameinfo.
 
std::pair< bool, std::pair< const char *, const char * > > name_info_sync (const sockaddr &addr, int flags=0)
 Sync getnameinfo.
 
std::pair< bool, std::pair< const char *, const char * > > name_info_sync (const std::string &ip, unsigned int port, int flags=0)
 Sync getnameinfo.
 
std::pair< bool, std::pair< const char *, const char * > > name_info_sync (socket_address addr, int flags=0)
 Sync getnameinfo.
 
- Public Member Functions inherited from uvw::request< get_name_info_req, uv_getnameinfo_t, name_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 getnameinfo request.

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

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

Definition at line 145 of file dns.h.

Member Function Documentation

◆ name_info() [1/3]

int uvw::get_name_info_req::name_info ( const sockaddr &  addr,
int  flags = 0 
)

Async getnameinfo.

Parameters
addrInitialized sockaddr_in or sockaddr_in6 data structure.
flagsOptional flags that modify the behavior of getnameinfo.
Returns
Underlying return value.

◆ name_info() [2/3]

int uvw::get_name_info_req::name_info ( const std::string &  ip,
unsigned int  port,
int  flags = 0 
)

Async getnameinfo.

Parameters
ipA valid IP address.
portA valid port number.
flagsOptional flags that modify the behavior of getnameinfo.
Returns
Underlying return value.

◆ name_info() [3/3]

int uvw::get_name_info_req::name_info ( socket_address  addr,
int  flags = 0 
)

Async getnameinfo.

Parameters
addrA valid instance of socket_address.
flagsOptional flags that modify the behavior of getnameinfo.
Returns
Underlying return value.

◆ name_info_sync() [1/3]

std::pair< bool, std::pair< const char *, const char * > > uvw::get_name_info_req::name_info_sync ( const sockaddr &  addr,
int  flags = 0 
)

Sync getnameinfo.

Parameters
addrInitialized sockaddr_in or sockaddr_in6 data structure.
flagsOptional flags that modify the behavior of getnameinfo.
Returns
A std::pair composed as it follows:
  • A boolean value that is true in case of success, false otherwise.
  • A std::pair composed as it follows:
    • A const char * containing a valid hostname.
    • A const char * containing a valid service name.

◆ name_info_sync() [2/3]

std::pair< bool, std::pair< const char *, const char * > > uvw::get_name_info_req::name_info_sync ( const std::string &  ip,
unsigned int  port,
int  flags = 0 
)

Sync getnameinfo.

Parameters
ipA valid IP address.
portA valid port number.
flagsOptional flags that modify the behavior of getnameinfo.
Returns
A std::pair composed as it follows:
  • A boolean value that is true in case of success, false otherwise.
  • A std::pair composed as it follows:
    • A const char * containing a valid hostname.
    • A const char * containing a valid service name.

◆ name_info_sync() [3/3]

std::pair< bool, std::pair< const char *, const char * > > uvw::get_name_info_req::name_info_sync ( socket_address  addr,
int  flags = 0 
)

Sync getnameinfo.

Parameters
addrA valid instance of socket_address.
flagsOptional flags that modify the behavior of getnameinfo.
Returns
A std::pair composed as it follows:
  • A boolean value that is true in case of success, false otherwise.
  • A std::pair composed as it follows:
    • A const char * containing a valid hostname.
    • A const char * containing a valid service name.

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