uvcc
libuv C++ bindings
uv::getnameinfo Class Reference

Getnameinfo request type. More...

#include "request-dns.hpp"

Inheritance diagram for uv::getnameinfo:
uv::request

Public Types

using uv_t = ::uv_getnameinfo_t
 
using on_request_t = std::function< void(getnameinfo _request) >
 The function type of the callback called with the getnameinfo request result once complete. More...
 
- Public Types inherited from uv::request
using uv_t = ::uv_req_t
 
using on_destroy_t = std::function< void(void *_data) >
 The function type of the callback called when the request object is about to be destroyed.
 

Public Member Functions

 getnameinfo (const getnameinfo &)=default
 
getnameinfooperator= (const getnameinfo &)=default
 
 getnameinfo (getnameinfo &&) noexcept=default
 
getnameinfooperator= (getnameinfo &&) noexcept=default
 
on_request_ton_request () const noexcept
 
uv::loop loop () const noexcept
 The libuv loop that started this getnameinfo request and where completion will be reported. More...
 
const char(& host () const noexcept)[NI_MAXHOST]
 The char array containing the resulting host. It’s null terminated.
 
const char(& service () const noexcept)[NI_MAXSERV]
 The char array containing the resulting service. It’s null terminated.
 
template<typename _T_ , typename = std::enable_if_t< is_one_of< _T_, ::sockaddr, ::sockaddr_in, ::sockaddr_in6, ::sockaddr_storage >::value >>
int run (uv::loop &_loop, const _T_ &_sa, int _NI_FLAGS=0)
 Run the request. More...
 
 operator const uv_t * () const noexcept
 
 operator uv_t * () noexcept
 
- Public Member Functions inherited from uv::request
 request (const request &_that)
 
requestoperator= (const request &_that)
 
 request (request &&_that) noexcept
 
requestoperator= (request &&_that) noexcept
 
void swap (request &_that) noexcept
 
std::uintptr_t id () const noexcept
 
long nrefs () const noexcept
 The current number of existing references to the same object as this request variable refers to.
 
int uv_status () const noexcept
 The status value returned by the last executed libuv API function on this request.
 
on_destroy_ton_destroy () const noexcept
 
::uv_req_type type () const noexcept
 The tag indicating a libuv type of the request. More...
 
const char * type_name () const noexcept
 A string containing the name of the request type.
 
void *const & data () const noexcept
 The pointer to the user-defined arbitrary data. libuv and uvcc does not use this field.
 
void *& data () noexcept
 
int cancel () noexcept
 Cancel a pending request. More...
 
 operator const uv_t * () const noexcept
 
 operator uv_t * () noexcept
 
 operator bool () const noexcept
 Equivalent to (uv_status() >= 0).
 

Detailed Description

Getnameinfo request type.

See also
libuv API documentation: DNS utility functions.

Definition at line 154 of file request-dns.hpp.

Member Typedef Documentation

◆ on_request_t

The function type of the callback called with the getnameinfo request result once complete.

See also
libuv API documentation: uv_getnameinfo_cb.

Definition at line 164 of file request-dns.hpp.

Member Function Documentation

◆ loop()

uv::loop uv::getnameinfo::loop ( ) const
inlinenoexcept

The libuv loop that started this getnameinfo request and where completion will be reported.

It is guaranteed that it will be a valid instance at least within the request callback.

Definition at line 196 of file request-dns.hpp.

◆ run()

template<typename _T_ , typename = std::enable_if_t< is_one_of< _T_, ::sockaddr, ::sockaddr_in, ::sockaddr_in6, ::sockaddr_storage >::value >>
int uv::getnameinfo::run ( uv::loop _loop,
const _T_ &  _sa,
int  _NI_FLAGS = 0 
)
inline

Run the request.

See also
libuv API documentation: uv_getnameinfo().
Note
If the request callback is empty (has not been set), the request runs synchronously.

Available _NI_FLAGS are:

  • NI_DGRAM
  • NI_NAMEREQD
  • NI_NOFQDN
  • NI_NUMERICHOST
  • NI_NUMERICSERV
See also
Linux: getnameinfo().
Windows: getnameinfo().

Definition at line 217 of file request-dns.hpp.


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