sockpp
Modern C++ socket library wrapper
Public Member Functions | List of all members
sockpp::getaddrinfo_error Class Reference

Errors from getaddrinfo. More...

#include <exception.h>

Inheritance diagram for sockpp::getaddrinfo_error:

Public Member Functions

 getaddrinfo_error (int err, const std::string &hostname)
 Constructs an error with the specified getaddrinfo error code. More...
 
int error () const
 Get the error number. More...
 
const std::string & hostname () const
 Get the hostname that triggered the error. More...
 

Detailed Description

Errors from getaddrinfo.

These are errors relating to DNS lookup, returned from the getaddrinfo system call. Their codes are declared in <netdb.h>.

Constructor & Destructor Documentation

◆ getaddrinfo_error()

sockpp::getaddrinfo_error::getaddrinfo_error ( int  err,
const std::string &  hostname 
)

Constructs an error with the specified getaddrinfo error code.

Parameters
errThe error number, as returned by getaddrinfo.
hostnameThe DNS name being resolved that triggered the error.

Member Function Documentation

◆ error()

int sockpp::getaddrinfo_error::error ( ) const
inline

Get the error number.

Returns
The error number returned by getaddrinfo.

◆ hostname()

const std::string& sockpp::getaddrinfo_error::hostname ( ) const
inline

Get the hostname that triggered the error.

Returns
The hostname that getaddrinfo failed to resolve.

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