Parcourir la source

Add UDPQuery::stop()

It will be used internally when some terminating condition happens. But
it might be useful from outside as well possibly.

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/vorner-recursor-timeouts@3397 e5f2f494-b856-4b98-b285-d166d9295462
Michal Vaner il y a 14 ans
Parent
commit
3c7604d41a
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. 4 1
      src/lib/asiolink/internal/udpdns.h

+ 4 - 1
src/lib/asiolink/internal/udpdns.h

@@ -189,7 +189,8 @@ public:
      */
     enum Result {
         SUCCESS,
-        TIME_OUT
+        TIME_OUT,
+        STOPPED
     };
     /// Abstract callback for the UDPQuery.
     class Callback {
@@ -204,6 +205,8 @@ public:
                       boost::shared_ptr<Callback> callback, int timeout = -1);
     void operator()(asio::error_code ec = asio::error_code(),
                     size_t length = 0); 
+    /// Terminate the query.
+    void stop(Result reason = STOPPED);
 private:
     enum { MAX_LENGTH = 4096 };