Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is AndroidHttpClient thread safe

I was wondering, whether is AndroidHttpClient thread safe, as this is not being mentioned in documentation. Means, a single instance of AndroidHttpClient can be shared among multiple threads.

like image 646
Cheok Yan Cheng Avatar asked Dec 12 '22 01:12

Cheok Yan Cheng


1 Answers

Yes, it is thread safe.

AndroidHttpClient is a special implementation of DefaultHttpClient which is pre-configured for Android. It registers the ThreadSafeClientConnManager which allows thread safe HTTP access via a managed connection pool. AndroidHttpClient also applies reasonable default settings for timeouts and socket buffer sizes. It also supports HTTPS by default.

You can find the source code here.

like image 152
Alex Lockwood Avatar answered Dec 29 '22 22:12

Alex Lockwood