Timeout on Http request

This is a very generic topic :slight_smile: that’s for sure related to haxe itself and not to haxeui.

I’m wondering if anyone has faced this issue using http request and timeout.
For some reason I can’t get the timeout working, no matter the value, the connection closes only after a minute.
I have a simple Http object for which I set 1s timeout

    this.httpCall = new Http(this.httpUrl);
    this.httpCall.cnxTimeout = 1;

    this.httpCall.onError = function (error) {
       trace( Date.now() + ' - ' + 'onerror');
    trace( Date.now() + ' - ' + 'request');

The cnxTimeout value is correctly set as I traced the request in sys.Http
If the url isn’t available the request get stuck for 1 min at least.
I didn’t found anything on haxe github or googling

targeting neko atm, I’ll try later targeting android


Just for everyone knowledge, it seems to work as expected on android.

1 Like

Great, neko is fairly old and afaik unmaintained (?) so it may be that it just doesnt honour the timeout param.

Have you tried HL btw (HashLink), its the successor to neko, compiles just as fast and runs MUCH faster.

If you are looking for iteration speed that might be your best bet.


I’ll surely give it a try