MCPcopy Create free account
hub / github.com/acl-dev/acl / CHttpDownload

Class CHttpDownload

lib_acl_cpp/samples/HttpClient/HttpDownload.h:10–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8class acl::aio_handle;
9
10class CHttpDownload : public acl::http_service_request
11{
12public:
13 CHttpDownload(const char* domain, unsigned short port,
14 acl::aio_handle* handle);
15
16#ifdef WIN32
17 void SetHWnd(HWND hWnd);
18#endif
19
20 // ������ӿڣ����ٹ��̣��� http_service �ദ����Ϻ��Զ����øûص�
21 virtual void destroy();
22
23protected:
24 ~CHttpDownload(void);
25
26 //////////////////////////////////////////////////////////////////////////
27 // ������ӿ�
28
29 // ���HTTP�����������ʱ�Ļص��ӿڣ�ע��ú����ĵ��ÿռ���������������ͬ
30 // һ���߳̿ռ䣬��������ú�������������������ͬ����Դʱ��Ҫע�⻥��
31 virtual const acl::string* get_body();
32 // �������� HTTP ��Ӧͷʱ�Ļص��ӿ�
33 virtual void on_hdr(const char* addr, const HTTP_HDR_RES* hdr);
34 // ������ HTTP ��Ӧ��ʱ�Ļص�����
35 virtual void on_body(const char* data, size_t dlen);
36 // ���������Ӧʧ��ʱ�Ļص�����
37 virtual void on_error(acl::http_status_t errnum);
38private:
39 acl::ofstream out_;
40 acl::aio_handle* handle_;
41#ifdef WIN32
42 HWND hWnd_;
43#endif
44 http_off_t read_length_;
45 http_off_t content_length_;
46 time_t begin_;
47};

Callers 1

OnBnClickedDownloadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…