From d5d9f92e67f2e6760e71be356f4796548832b69b Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 12 Jan 2019 15:10:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84httpclientpool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cpp/httpclientpool.cc | 8 ++------ cpp/httpclientpool.h | 3 +-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/cpp/httpclientpool.cc b/cpp/httpclientpool.cc index a3b4944..7e04bee 100644 --- a/cpp/httpclientpool.cc +++ b/cpp/httpclientpool.cc @@ -300,7 +300,7 @@ namespace f8 std::vector http_thread_pool; }; - void HttpClientPool::Init() + void HttpClientPool::Init(int thread_num) { impl_ = new HttpClientPoolImpl(); impl_->Init(); @@ -317,6 +317,7 @@ namespace f8 } } ); + impl_->SetThreadNum(thread_num); } void HttpClientPool::UnInit() @@ -325,11 +326,6 @@ namespace f8 impl_ = nullptr; } - void HttpClientPool::SetThreadNum(int thread_num) - { - impl_->SetThreadNum(thread_num); - } - void HttpClientPool::HttpGet(a8::XParams param, AsyncHttpOnOkFunc on_ok, AsyncHttpOnErrorFunc on_error, const char* url, a8::XObject url_params, long long hash_code, a8::XObject* headers) diff --git a/cpp/httpclientpool.h b/cpp/httpclientpool.h index 96c13ad..ca47d3c 100644 --- a/cpp/httpclientpool.h +++ b/cpp/httpclientpool.h @@ -14,9 +14,8 @@ namespace f8 friend class a8::Singleton; public: - void Init(); + void Init(int thread_num); void UnInit(); - void SetThreadNum(int thread_num); //执行异步http get void HttpGet(a8::XParams param, AsyncHttpOnOkFunc on_ok, AsyncHttpOnErrorFunc on_error,