RO: Java. No Read Timeout on HttpClientChannel

Hello,
The HttpClientChannel in Java appears to set the ConnectTimeout but not the ReadTimeout on the HttpURLConnection. Could you add this in please.
I have customers complaining that their android devices are ‘hanging’ due to this error. Could you please tell me if it is possible to recompile the java library using the command line oxygene compiler or do I need the paid for version of Oxygene to do this?

Regards,
Will.

Thanks, logged as bugs://67928: RO: Java. No Read Timeout on HttpClientChannel

Hi,
sorry for delay. Yes you can command line oxygene compiler for this.

Hello,
Sorry to bump an old topic but this is not fixed in RO 9.7.115.1441. The Http client channel has no read timeout set, so on android mobile devices on 4G networks we get devices waiting forever for data which will never come.

I’ve added a pic of my changes for HTTPClientChannel. The TCPClient* units don’t appear to set any timeouts at all (connect or read). Could that be fixed as well please?

Regards,
Will.

One other thing with this, the property “TimeOut” should probably be renamed to “ConnectTimeout” as that better describes what it is doing.

Thanks for the suggestion. I’ll log issues to do this (no defined ETA, but soon™)

Thanks, logged as bugs://82835

Thanks, logged as bugs://82836

bugs://82836 got closed with status fixed.

bugs://82835 got closed with status fixed.

Thanks for doing that. I’ll check it out when the next release comes out.

Hello,
I’m afraid this is still not fixed in 10.0.0.1457. I can see that the readTimeout property has been added to HTTPClientChannel but it is never hooked up to anything so has no effect. The code needs the readtimeout added as per the below

method HttpClientChannel.initHttpRequest(contentType: String;  contentLength: Integer):    HttpURLConnection;
begin
  var request: HttpURLConnection := HttpURLConnection(self.TargetUrl.toURL().openConnection());
  request.DoInput := true;
  request.DoOutput := true;
  request.RequestMethod := "POST";
  request.FollowRedirects := self.FollowRedirects;
  request.ConnectTimeout := self.ConnectTimeout;
  request.ReadTimeout := self.ReadTimeout;   <---------ADD THIS LINE.
  if (self.Authorization <> nil) and (self.Authorization.length() > 0) then begin
    request.setRequestProperty("Authorization", self.Authorization);
  end;

  request.setRequestProperty("Content-Type", contentType);
  request.setRequestProperty("Content-Length", contentLength.toString());

  self.setupHttpRequest(request);

  exit request;
end;

Hello

Yes, good catch. Will be fixed ASAP

1 Like

Thanks, logged as bugs://83589

bugs://83589 got closed with status fixed.