summaryrefslogtreecommitdiff
path: root/src/ActivePeerConnectionCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-10-11 16:58:24 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-10-11 16:58:24 +0000
commit048a2cf59737f761876e81a77e8d064c45c752d7 (patch)
tree65c9d5498aafe6a8c8e640ddfcc43c7013504d0d /src/ActivePeerConnectionCommand.cc
parente26bbbb9eee140ba24402fe872a752b42f0077de (diff)
2007-10-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented BitTorrent/http/ftp integrated download. I've rewritten lots of files and now some headers have forward class declarations to reduce compile time. The implementation is extremely alpha stage, I recommend to use this for testing purpose only.
Diffstat (limited to 'src/ActivePeerConnectionCommand.cc')
-rw-r--r--src/ActivePeerConnectionCommand.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/ActivePeerConnectionCommand.cc b/src/ActivePeerConnectionCommand.cc
index d85b1225..27c0798d 100644
--- a/src/ActivePeerConnectionCommand.cc
+++ b/src/ActivePeerConnectionCommand.cc
@@ -37,6 +37,22 @@
#include "CUIDCounter.h"
#include "message.h"
+ActivePeerConnectionCommand::ActivePeerConnectionCommand(int cuid,
+ RequestGroup* requestGroup,
+ DownloadEngine* e,
+ const BtContextHandle& btContext,
+ int32_t interval)
+ :Command(cuid),
+ BtContextAwareCommand(btContext),
+ RequestGroupAware(requestGroup),
+ interval(interval),
+ e(e),
+ _lowestSpeedLimit(20*1024),
+ _numNewConnection(5)
+{}
+
+ActivePeerConnectionCommand::~ActivePeerConnectionCommand() {}
+
bool ActivePeerConnectionCommand::execute() {
if(btRuntime->isHalt()) {
return true;
@@ -63,7 +79,7 @@ void ActivePeerConnectionCommand::connectToPeer(const PeerHandle& peer)
}
peer->cuid = CUIDCounterSingletonHolder::instance()->newID();
PeerInitiateConnectionCommand* command =
- new PeerInitiateConnectionCommand(peer->cuid, peer, e, btContext);
+ new PeerInitiateConnectionCommand(peer->cuid, _requestGroup, peer, e, btContext);
e->commands.push_back(command);
logger->info(MSG_CONNECTING_TO_PEER,
cuid, peer->ipaddr.c_str());