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