summaryrefslogtreecommitdiff
path: root/src/resolver.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2009-03-04 20:32:22 +0000
committerChristian Pointner <equinox@anytun.org>2009-03-04 20:32:22 +0000
commit352a4127cfb100a3fb59064e4b4e0de7a3b885a0 (patch)
tree8ff1814e5e952d88af67bbc2a8f7ddbd611eed4c /src/resolver.cpp
parent - extended gResolver: supports completion-callback (diff)
fix build
Diffstat (limited to 'src/resolver.cpp')
-rw-r--r--src/resolver.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/resolver.cpp b/src/resolver.cpp
index c4df658..5a230ae 100644
--- a/src/resolver.cpp
+++ b/src/resolver.cpp
@@ -30,21 +30,22 @@
*/
#include <boost/bind.hpp>
+#include <boost/system/error_code.hpp>
#include "resolver.h"
#include "log.h"
-template<class Proto> ResolveHandler<Proto>::ResolveHandler(const std::string& addr, const std::string& port, boost::function<void(boost::asio::ip::udp::endpoint)> const& onResolve) : addr_(addr), port_(port), callback_(onResolve)
+template<class Proto> ResolveHandler<Proto>::ResolveHandler(const std::string& addr, const std::string& port, boost::function<void(boost::asio::ip::basic_endpoint<Proto>)> const& onResolve) : addr_(addr), port_(port), callback_(onResolve)
{
}
template<class Proto> void ResolveHandler<Proto>::operator()(const boost::system::error_code& e, const boost::asio::ip::basic_resolver_iterator<Proto> endpointIt)
{
cLog.msg(Log::PRIO_DEBUG) << "ResolveHandler<" << typeid(Proto).name() << ">() called, addr='" << addr_ << "', port='" << port_ << "'";
- if(boost::system::errc:success == e) {
+ if(boost::system::posix_error::success == e) {
callback_(*endpointIt);
} else {
- cLog.msg(Log::PRIO_ERROR) << << "ResolveHandler<" << typeid(Proto).name() << ">(): " << e;
+ cLog.msg(Log::PRIO_ERROR) << "ResolveHandler<" << typeid(Proto).name() << ">(): " << e;
}
}
@@ -100,7 +101,7 @@ void Resolver::resolveUdp(const std::string& addr, const std::string& port, boos
udp_resolver_.async_resolve(query, handler);
}
-void Resolver::resolveTcp(const std::string& addr, const std::string& port, boost::function<void (boost::asio::ip::udp::endpoint)> const& onResolve)
+void Resolver::resolveTcp(const std::string& addr, const std::string& port, boost::function<void (boost::asio::ip::tcp::endpoint)> const& onResolve)
{
cLog.msg(Log::PRIO_DEBUG) << "trying to resolv TCP: " << addr << " " << port;