/* */ #ifndef _D_ACTIVE_PEER_CONNECTION_COMMAND_H_ #define _D_ACTIVE_PEER_CONNECTION_COMMAND_H_ #include "Command.h" #include "BtContextAwareCommand.h" #include "RequestGroupAware.h" #include "TimeA2.h" namespace aria2 { class DownloadEngine; class Peer; class ActivePeerConnectionCommand : public Command, public BtContextAwareCommand, public RequestGroupAware { private: time_t interval; // UNIT: sec DownloadEngine* e; Time checkPoint; unsigned int _thresholdSpeed; // UNIT: byte/sec unsigned int _maxUploadSpeedLimit; unsigned int _numNewConnection; // the number of the connection to establish. public: ActivePeerConnectionCommand(int cuid, RequestGroup* requestGroup, DownloadEngine* e, const SharedHandle& btContext, time_t interval); virtual ~ActivePeerConnectionCommand(); virtual bool execute(); void connectToPeer(const SharedHandle& peer); void setNumNewConnection(size_t numNewConnection) { _numNewConnection = numNewConnection; } }; } // namespace aria2 #endif // _D_ACTIVE_PEER_CONNECTION_COMMAND_H_