B4J Question [Solved]httpclient : increase concurrent request limits

billzhan

Active Member
Licensed User
Longtime User
Hi,

How can I increase concurrent request limits of HttpClient (HttpUtils2)? Current limit is about 5.

I have asked the similar thing for OkHttp. OkHttp(with default concurrent limits ,and one request after another ) seems not to response after large number of requests been made.

Thanks
 
Last edited:

billzhan

Active Member
Licensed User
Longtime User
I've only test one request after another. Win7 64bit. Server is another B4J server(4.20 ,released mode, localhost) return text "ok"

OkHttp:
Debug mode: stop to response after 100-300 requests. Jobdone event not fire ( even after timeout)
Release mode : 50% chance to stop at about 2000 or 3000 requests (Stop testing after 5000 req)

HttpClient works fine after 10000 reqs.

Maybe it's caused by my computer. I've tested in Vmware Ubuntu 14.04, similar result with OkHttp

Code attached
 

Attachments

  • OkHttpUtils2_request.zip
    4 KB · Views: 263
  • OkHttpUtils2_sever.zip
    1.2 KB · Views: 287
Upvote 0

billzhan

Active Member
Licensed User
Longtime User
I've tested it twice in release mode. In both tests I stopped it after 10000 requests.

I tested with Win7 64bit, Winxp 32bit, Ubuntu 14.04 32bit and Win8.1 32bit. Only works well with Win8.1.

Which OS did you test with?
 
Upvote 0

billzhan

Active Member
Licensed User
Longtime User
Updated the core library. Simple tests with Win7 64bit & Ubuntu 14.04 32bit.

Single thread/multiple threads requests work well now, jobdone events are called when time_out.

So the issue with OkHttp seems fixed.

Thanks
 
Upvote 0
Top