/* */ #ifndef _D_PEER_INTERACTION_COMMAND_H_ #define _D_PEER_INTERACTION_COMMAND_H_ #include "PeerAbstractCommand.h" #include "RequestGroupAware.h" #include "BtContextAwareCommand.h" namespace aria2 { class BtInteractive; class PeerConnection; class PeerInteractionCommand : public PeerAbstractCommand, public BtContextAwareCommand, public RequestGroupAware { public: enum Seq { INITIATOR_SEND_HANDSHAKE, INITIATOR_WAIT_HANDSHAKE, RECEIVER_WAIT_HANDSHAKE, WIRED}; private: Seq sequence; SharedHandle btInteractive; int32_t maxDownloadSpeedLimit; protected: virtual bool executeInternal(); virtual bool prepareForNextPeer(int32_t wait); virtual void onAbort(Exception* ex); virtual bool exitBeforeExecute(); public: PeerInteractionCommand(int32_t cuid, RequestGroup* requestGroup, const SharedHandle& peer, DownloadEngine* e, const SharedHandle& btContext, const SharedHandle& s, Seq sequence, const SharedHandle& peerConnection = 0); virtual ~PeerInteractionCommand(); }; } // namespace aria2 #endif // _D_PEER_INTERACTION_COMMAND_H_