diff options
author | Christian Pointner <equinox@anytun.org> | 2010-01-08 02:42:23 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2010-01-08 02:42:23 +0000 |
commit | 951d51c32f93d9fb1e6e697843b19b9b698e39a1 (patch) | |
tree | d3af3018b8a435c92e05b209a3f3f5839c727509 /src/resolver.cpp | |
parent | added visual studio build targets with gcrypt (diff) |
moved to resolver iterator at onResolve callback functions
Diffstat (limited to 'src/resolver.cpp')
-rw-r--r-- | src/resolver.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/resolver.cpp b/src/resolver.cpp index 66f1e7e..36b2c2e 100644 --- a/src/resolver.cpp +++ b/src/resolver.cpp @@ -40,20 +40,20 @@ using ::boost::asio::ip::udp; using ::boost::asio::ip::tcp; template<class Proto> -void waitAndEnqueue(u_int32_t s, const std::string& addr, const std::string& port, boost::function<void(boost::asio::ip::basic_endpoint<Proto>)> const& onResolve, ErrorCallback const& onError, ResolvAddrType r) +void waitAndEnqueue(u_int32_t s, const std::string& addr, const std::string& port, boost::function<void(const boost::asio::ip::basic_resolver_iterator<Proto>)> const& onResolve, ErrorCallback const& onError, ResolvAddrType r) { cLog.msg(Log::PRIO_ERROR) << "the resolver only supports udp and tcp"; } template<> -void waitAndEnqueue(u_int32_t s, const std::string& addr, const std::string& port, boost::function<void(boost::asio::ip::basic_endpoint<udp>)> const& onResolve, ErrorCallback const& onError, ResolvAddrType r) +void waitAndEnqueue(u_int32_t s, const std::string& addr, const std::string& port, boost::function<void(const boost::asio::ip::basic_resolver_iterator<udp>)> const& onResolve, ErrorCallback const& onError, ResolvAddrType r) { boost::this_thread::sleep(boost::posix_time::milliseconds(s * 1000)); gResolver.resolveUdp(addr, port, onResolve, onError, r); } template<> -void waitAndEnqueue(u_int32_t s, const std::string& addr, const std::string& port, boost::function<void(boost::asio::ip::basic_endpoint<tcp>)> const& onResolve, ErrorCallback const& onError, ResolvAddrType r) +void waitAndEnqueue(u_int32_t s, const std::string& addr, const std::string& port, boost::function<void(const boost::asio::ip::basic_resolver_iterator<tcp>)> const& onResolve, ErrorCallback const& onError, ResolvAddrType r) { boost::this_thread::sleep(boost::posix_time::milliseconds(s * 1000)); gResolver.resolveTcp(addr, port, onResolve, onError, r); @@ -61,7 +61,7 @@ void waitAndEnqueue(u_int32_t s, const std::string& addr, const std::string& por 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, ErrorCallback const& onError, ResolvAddrType r) : addr_(addr), port_(port), onResolve_(onResolve), onError_(onError), resolv_addr_type_(r) +ResolveHandler<Proto>::ResolveHandler(const std::string& addr, const std::string& port, boost::function<void(const boost::asio::ip::basic_resolver_iterator<Proto>)> const& onResolve, ErrorCallback const& onError, ResolvAddrType r) : addr_(addr), port_(port), onResolve_(onResolve), onError_(onError), resolv_addr_type_(r) { } @@ -70,7 +70,7 @@ void ResolveHandler<Proto>::operator()(const boost::system::error_code& e, const { if(boost::system::posix_error::success == e) { try { - onResolve_(*endpointIt); + onResolve_(endpointIt); } catch(const std::runtime_error& e) { |