24 #include "rpcserver.h"
29 class AddressResolver;
36 class KClosestNodesSearch;
38 const bt::Uint32 MAX_CONCURRENT_REQS = 16;
106 bool canDoRequest()
const {
return outstanding_reqs < MAX_CONCURRENT_REQS;}
114 bool isQueued()
const {
return queued;}
158 bt::Uint32 outstanding_reqs;
virtual void callFinished(RPCCall *c, RPCMsg::Ptr rsp)=0
void start(const KClosestNodesSearch &kns, bool queued)
bt::Uint32 getNumOutstandingRequests() const
Get the number of outstanding requests.
bool canDoRequest() const
See if we can do a request.
void kill()
Kills the task.
void onTimeout(RPCCall *c) override
Decrements the outstanding_reqs.
bool isFinished() const
Is the task finished.
void addDHTNode(const QString &ip, bt::Uint16 port)
void onResponse(RPCCall *c, RPCMsg::Ptr rsp) override
Decrements the outstanding_reqs.
Task(RPCServer *rpc, Node *node, QObject *parent)
virtual void callTimeout(RPCCall *c)=0
bool rpcCall(RPCMsg::Ptr req)