/* */ #ifndef D_DHT_PING_TASK_H #define D_DHT_PING_TASK_H #include "DHTAbstractTask.h" #include "a2time.h" namespace aria2 { class DHTPingReplyMessage; class DHTPingTask:public DHTAbstractTask { private: SharedHandle remoteNode_; size_t numMaxRetry_; size_t numRetry_; bool pingSuccessful_; time_t timeout_; void addMessage(); public: DHTPingTask(const SharedHandle& remoteNode, size_t numMaxRetry = 0); virtual ~DHTPingTask(); virtual void startup(); void onReceived(const DHTPingReplyMessage* message); void onTimeout(const SharedHandle& node); void setTimeout(time_t timeout) { timeout_ = timeout; } bool isPingSuccessful() const; }; } // namespace aria2 #endif // D_DHT_PING_TASK_H