/* */ #ifndef D_INITIATE_CONNECTION_COMMAND_H #define D_INITIATE_CONNECTION_COMMAND_H #include "AbstractCommand.h" namespace aria2 { class InitiateConnectionCommand : public AbstractCommand { protected: /** * Connect to the server. * This method just send connection request to the server. * Using nonblocking mode of socket, this funtion returns immediately * after send connection packet to the server. */ virtual bool executeInternal(); // hostname and port are the hostname and port number we are going // to connect. If proxy server is used, these values are hostname // and port of proxy server. addr is one of resolved address and we // use this address this time. resolvedAddresses are all addresses // resolved. proxyRequest is set if we are going to use proxy // server. virtual Command* createNextCommand (const std::string& hostname, const std::string& addr, uint16_t port, const std::vector& resolvedAddresses, const SharedHandle& proxyRequest) = 0; void setConnectedAddrInfo (const SharedHandle& req, const std::string& hostname, const SharedHandle& socket); public: InitiateConnectionCommand(cuid_t cuid, const SharedHandle& req, const SharedHandle& fileEntry, RequestGroup* requestGroup, DownloadEngine* e); virtual ~InitiateConnectionCommand(); }; } // namespace aria2 #endif // D_INITIATE_CONNECTION_COMMAND_H