/* */ #ifndef D_PEER_LISTEN_COMMAND_H #define D_PEER_LISTEN_COMMAND_H #include "Command.h" #include "SharedHandle.h" #include "SegList.h" namespace aria2 { class DownloadEngine; class SocketCore; class PeerListenCommand : public Command { private: DownloadEngine* e_; int family_; SharedHandle socket_; public: PeerListenCommand(cuid_t cuid, DownloadEngine* e, int family); virtual ~PeerListenCommand(); virtual bool execute(); /** * Binds port. If successful, the binded port number is assinged to port and * returns true, otherwise port is undefined and returns false. */ bool bindPort(uint16_t& port, SegList& seq); // Returns binded port uint16_t getPort() const; }; } // namespace aria2 #endif // D_PEER_LISTEN_COMMAND_H