/* */ #ifndef _D_ACTIVE_PEER_CONNECTION_COMMAND_H_ #define _D_ACTIVE_PEER_CONNECTION_COMMAND_H_ #include "Command.h" #include "BtContextAwareCommand.h" #include "DownloadEngine.h" #include "TimeA2.h" #include "RequestGroupAware.h" class ActivePeerConnectionCommand : public Command, public BtContextAwareCommand, public RequestGroupAware { private: int32_t interval; // UNIT: sec DownloadEngine* e; Time checkPoint; int32_t _lowestSpeedLimit; // UNIT: byte/sec int32_t _numNewConnection; // the number of the connection to establish. public: ActivePeerConnectionCommand(int cuid, RequestGroup* requestGroup, DownloadEngine* e, const BtContextHandle& btContext, int32_t interval); virtual ~ActivePeerConnectionCommand(); virtual bool execute(); void connectToPeer(const PeerHandle& peer); void setLowestSpeedLimit(int32_t speed) { _lowestSpeedLimit = speed; } void setNumNewConnection(int32_t numNewConnection) { _numNewConnection = numNewConnection; } }; #endif // _D_ACTIVE_PEER_CONNECTION_COMMAND_H_