/* */ #ifndef _D_ACTIVE_PEER_CONNECTION_COMMAND_H_ #define _D_ACTIVE_PEER_CONNECTION_COMMAND_H_ #include "Command.h" #include "SharedHandle.h" #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; SharedHandle _btRuntime; SharedHandle _pieceStorage; SharedHandle _peerStorage; SharedHandle _btAnnounce; time_t _interval; // UNIT: sec DownloadEngine* _e; Timer _checkPoint; unsigned int _numNewConnection; // the number of the connection to establish. public: ActivePeerConnectionCommand(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e, time_t interval); virtual ~ActivePeerConnectionCommand(); virtual bool execute(); void connectToPeer(const SharedHandle& peer); void setNumNewConnection(size_t numNewConnection) { _numNewConnection = numNewConnection; } void setBtRuntime(const SharedHandle& btRuntime); void setPieceStorage(const SharedHandle& pieceStorage); void setPeerStorage(const SharedHandle& peerStorage); void setBtAnnounce(const SharedHandle& btAnnounce); }; } // namespace aria2 #endif // _D_ACTIVE_PEER_CONNECTION_COMMAND_H_