/* */ #ifndef D_ACTIVE_PEER_CONNECTION_COMMAND_H #define D_ACTIVE_PEER_CONNECTION_COMMAND_H #include "Command.h" #include #include "TimerA2.h" namespace aria2 { class RequestGroup; class DownloadEngine; class Peer; class BtRuntime; class PieceStorage; class PeerStorage; class BtAnnounce; class ActivePeerConnectionCommand : public Command { private: RequestGroup* requestGroup_; std::shared_ptr btRuntime_; std::shared_ptr pieceStorage_; std::shared_ptr peerStorage_; std::shared_ptr btAnnounce_; std::chrono::seconds interval_; DownloadEngine* e_; Timer checkPoint_; int numNewConnection_; // the number of the connection to establish. public: ActivePeerConnectionCommand(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e, std::chrono::seconds interval); virtual ~ActivePeerConnectionCommand(); virtual bool execute() CXX11_OVERRIDE; void makeNewConnections(int num); void setNumNewConnection(int numNewConnection) { numNewConnection_ = numNewConnection; } void setBtRuntime(const std::shared_ptr& btRuntime); void setPieceStorage(const std::shared_ptr& pieceStorage); void setPeerStorage(const std::shared_ptr& peerStorage); void setBtAnnounce(const std::shared_ptr& btAnnounce); }; } // namespace aria2 #endif // D_ACTIVE_PEER_CONNECTION_COMMAND_H