diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-02-08 15:53:45 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-02-08 15:53:45 +0000 |
| commit | 1b7c1982896dba1d38e1fe84ba9660996607f5f9 (patch) | |
| tree | d12047cb37ded1e18d4d5b97844412538beb19ff /src/DHTPingTask.cc | |
| parent | d82e183d346375ac8a58a298a58728be615f947e (diff) | |
2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed "using namespace std;" from all sources. Appended std::
prefix to c++
standard classes.
Included string.h where mem* function are used.
Diffstat (limited to 'src/DHTPingTask.cc')
| -rw-r--r-- | src/DHTPingTask.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/DHTPingTask.cc b/src/DHTPingTask.cc index 9f31b388..4eb03025 100644 --- a/src/DHTPingTask.cc +++ b/src/DHTPingTask.cc @@ -40,7 +40,9 @@ #include "DHTNode.h" #include "DHTConstants.h" -DHTPingTask::DHTPingTask(const DHTNodeHandle& remoteNode, size_t numMaxRetry): +namespace aria2 { + +DHTPingTask::DHTPingTask(const SharedHandle<DHTNode>& remoteNode, size_t numMaxRetry): _remoteNode(remoteNode), _numMaxRetry(numMaxRetry), _numRetry(0), @@ -52,24 +54,24 @@ DHTPingTask::~DHTPingTask() {} void DHTPingTask::startup() { - DHTMessageHandle m = _factory->createPingMessage(_remoteNode); + SharedHandle<DHTMessage> m = _factory->createPingMessage(_remoteNode); _dispatcher->addMessageToQueue(m, _timeout, new DHTMessageCallbackImpl(this)); } -void DHTPingTask::onReceived(const DHTMessageHandle& message) +void DHTPingTask::onReceived(const SharedHandle<DHTMessage>& message) { _pingSuccessful = true; _finished = true; } -void DHTPingTask::onTimeout(const DHTNodeHandle& node) +void DHTPingTask::onTimeout(const SharedHandle<DHTNode>& node) { ++_numRetry; if(_numRetry >= _numMaxRetry) { _pingSuccessful = false; _finished = true; } else { - DHTMessageHandle m = _factory->createPingMessage(_remoteNode); + SharedHandle<DHTMessage> m = _factory->createPingMessage(_remoteNode); _dispatcher->addMessageToQueue(m, _timeout, new DHTMessageCallbackImpl(this)); } } @@ -78,3 +80,5 @@ bool DHTPingTask::isPingSuccessful() const { return _pingSuccessful; } + +} // namespace aria2 |
