00001 #ifndef BOOTSTRAP_CLIENT_H 00002 #define BOOTSTRAP_CLIENT_H 00003 00004 00005 #include<string> 00006 #include<vector> 00007 00008 class CFileTransfer; 00009 class EventMessage; 00010 00014 class CBootStrapClient{ 00015 00016 public: 00020 CBootStrapClient(); 00021 00025 virtual ~CBootStrapClient(); 00026 00031 int Download(uint32_t server_ip, uint16_t server_port, const std::string& sDownloadDir); 00032 EventMessage* GetEventMessage()const{return m_pEventMsg;} 00033 00034 private: 00035 int Connect(); 00036 int InitSocketPair(); 00037 00041 int HandleNotification(int); 00042 00043 private: 00044 uint32_t m_uServerIP; 00045 uint16_t m_uServerPort; 00046 std::string m_sDownloadDir; 00047 int m_iSockPairFd[2]; 00048 typedef std::vector<CFileTransfer*> FileTransfer; 00049 FileTransfer m_filetrans; 00050 EventMessage* m_pEventMsg; 00051 00052 }; 00053 #endif//