Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

ofURLFileLoader doesn't timeout or handle exceptions #1312

Open
damiannz opened this Issue · 3 comments

4 participants

@damiannz

If you issue a URL to ofURLFileLoader and the http subsystem triggers an exception (no route to host is the easiest to test -- just unplug your network), then the URL request will sit in the request queue forever. Turn on OF_LOG_VERBOSE and watch the console output.

There should be better exception handling, and/or there should be a timeout of some kind.

@gorkacortazar

Right bilderbchi, seems connected with this. One think that i didn't understand is why ofLoadURL and the async version differs in the error catching

@arturoc
Owner

there's actually a timeout, if not the connection will last forever, when the timeout is triggered if the response is asynchronous the status should be -1 indicating that the server is not available, you can catch that response in the newResponse event and remove the request from the queue using ofRemoveURLRequest(response.request.id) if you want or just let the class keep retrying till the connection is available again.

in my opinion setting an arbitrary timeout for every response when the connection is not available can make some applications not work as intended. what we could do is add a method to activate that kind of timeout?

@kylemcdonald

if i understand correctly, it seems like the timeout should be present by default. then there should be a method to disable that timeout for special applications.

if we did that, would it also close #1344? or is that a separate issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.