/* */ #include "DHTPingMessage.h" #include "DHTNode.h" #include "Data.h" #include "DHTConstants.h" #include "DHTMessageDispatcher.h" #include "DHTMessageFactory.h" #include "DHTMessageCallback.h" DHTPingMessage::DHTPingMessage(const DHTNodeHandle& localNode, const DHTNodeHandle& remoteNode, const string& transactionID): DHTQueryMessage(localNode, remoteNode, transactionID) {} DHTPingMessage::~DHTPingMessage() {} void DHTPingMessage::doReceivedAction() { // send back ping reply DHTMessageHandle reply = _factory->createPingReplyMessage(_remoteNode, _localNode->getID(), _transactionID); _dispatcher->addMessageToQueue(reply); } Dictionary* DHTPingMessage::getArgument() { Dictionary* a = new Dictionary(); a->put("id", new Data(reinterpret_cast(_localNode->getID()), DHT_ID_LENGTH)); return a; } string DHTPingMessage::getMessageType() const { return "ping"; } void DHTPingMessage::validate() const {}