AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::Asio::Resolver Class Reference

#include "Resolver.h"

Public Member Functions

 Resolver (IoContext &ioContext)
 
Optional< boost::asio::ip::tcp::endpoint > Resolve (boost::asio::ip::tcp const &protocol, std::string const &host, std::string const &service)
 

Private Attributes

boost::asio::ip::tcp::resolver _impl
 

Detailed Description

Hack to make it possible to forward declare resolver (one of its template arguments is a typedef to something super long and using nested classes)

Constructor & Destructor Documentation

◆ Resolver()

Acore::Asio::Resolver::Resolver ( IoContext ioContext)
inlineexplicit
33: _impl(ioContext) { }
boost::asio::ip::tcp::resolver _impl
Definition: Resolver.h:47

Member Function Documentation

◆ Resolve()

Optional< boost::asio::ip::tcp::endpoint > Acore::Asio::Resolver::Resolve ( boost::asio::ip::tcp const &  protocol,
std::string const &  host,
std::string const &  service 
)
inline
36 {
37 boost::system::error_code ec;
38 boost::asio::ip::resolver_base::flags flagsResolver = boost::asio::ip::resolver_base::all_matching;
39 boost::asio::ip::tcp::resolver::results_type results = _impl.resolve(protocol, host, service, flagsResolver, ec);
40 if (results.begin() == results.end() || ec)
41 return {};
42
43 return results.begin()->endpoint();
44 }

References _impl.

Referenced by LoadRealmInfo().

Member Data Documentation

◆ _impl

boost::asio::ip::tcp::resolver Acore::Asio::Resolver::_impl
private

Referenced by Resolve().