/* */ #ifndef D_PEER_INITIATE_CONNECTION_H #define D_PEER_INITIATE_CONNECTION_H #include "PeerAbstractCommand.h" namespace aria2 { class RequestGroup; class BtRuntime; class PeerStorage; class PieceStorage; class PeerInitiateConnectionCommand : public PeerAbstractCommand { private: RequestGroup* requestGroup_; std::shared_ptr btRuntime_; std::shared_ptr peerStorage_; std::shared_ptr pieceStorage_; bool mseHandshakeEnabled_; protected: virtual bool executeInternal() CXX11_OVERRIDE; virtual bool prepareForNextPeer(time_t wait) CXX11_OVERRIDE; virtual void onAbort() CXX11_OVERRIDE; virtual bool exitBeforeExecute() CXX11_OVERRIDE; public: PeerInitiateConnectionCommand(cuid_t cuid, RequestGroup* requestGroup, const std::shared_ptr& peer, DownloadEngine* e, const std::shared_ptr& btRuntime, bool mseHandshakeEnabled = true); virtual ~PeerInitiateConnectionCommand(); void setPeerStorage(const std::shared_ptr& peerStorage); void setPieceStorage(const std::shared_ptr& pieceStorage); }; } // namespace aria2 #endif // D_PEER_INITIATE_CONNECTION_H