B4J Question jOkHttpUtils2 - Which Library and Setting TimeOut

lip

Active Member
Licensed User
Longtime User
I'm using B4J on a RPi project and also on a Windows tool to control and monitor the RPi via HTTP requests.

I'm slightly confused by which libraries I should include for HTTP.

I've been using jOkHttpUtils2 for Windows and jOkHttpUtils2_NONUI for the Pi.

If I ONLY include jOkHttpUtils2 (or jOkHttpUtils2_NONUI) then all seems to work, but I can't see how to change the Job's Timeout property. Neither Job.Timeout nor Job.GetRequest.Timeout exist.

If I also include okHTTP then I can set Job.GetRequest.Timeout = x. The change to the Timeout is then implemented OK, however, the requests then seem to become unstable; about one in 5 requests is never received by the server and B4J reports a Timeout. This is the case for ALL requests, not just the ones where I have changed the Timeout.

I'm not sure if I need the "Ok" Versions. I'm just posting strings not multi-part requests.

I get the same problem of requests failing to send with both the Windows and the Pi project - if I include both libraries.
 
Top