Net++
A class-based C++ encapsulation over the POSIX Sockets API
Loading...
Searching...
No Matches
conn_resolver::Resolver Class Reference

The Resolver class. More...

#include <resolver.hpp>

Public Member Functions

 Resolver (std::string hostname, std::string service)
 The Resolver constructor.
 
QueryResults results () const
 Returns attribute query_results_.
 
QueryResults udp_nodes () const
 Returns only UDP nodes in query_results_.
 
QueryResults tcp_nodes () const
 Returns only TCP nodes in query_results.
 
tcp::Connection::connection_ptr try_connect_tcp ()
 Attempts to connect to the target host using protocol TCP.
 
void try_connect_udp ()
 Attempts to connect to the target host using protocol UDP.
 
void print_results () const
 prints query results to stdout
 

Detailed Description

The Resolver class.

Encapsulates getaddrinfo functionality, providing methods to filter, print, and connect to results

Constructor & Destructor Documentation

◆ Resolver()

conn_resolver::Resolver::Resolver ( std::string  hostname,
std::string  service 
)

The Resolver constructor.

Parameters
hostnamethe host to connect to
servicethe desired service of the target host

Member Function Documentation

◆ print_results()

void conn_resolver::Resolver::print_results ( ) const

prints query results to stdout

◆ results()

QueryResults conn_resolver::Resolver::results ( ) const

Returns attribute query_results_.

◆ tcp_nodes()

QueryResults conn_resolver::Resolver::tcp_nodes ( ) const

Returns only TCP nodes in query_results.

◆ try_connect_tcp()

tcp::Connection::connection_ptr conn_resolver::Resolver::try_connect_tcp ( )

Attempts to connect to the target host using protocol TCP.

Returns
a TCP connection to the target host

◆ try_connect_udp()

void conn_resolver::Resolver::try_connect_udp ( )

Attempts to connect to the target host using protocol UDP.

Returns
a UDP connection to the target host

◆ udp_nodes()

QueryResults conn_resolver::Resolver::udp_nodes ( ) const

Returns only UDP nodes in query_results_.


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