HttpResponseListener.handleHttpResponse is called if no internet connection on gwt
See original GitHub issueIssue details
If client no internet connection, method Gdx.net.sendHttpRequest(request, listener)
not call failed or cancelled. Exception not thrown.
Only for GWT. On desktop and android failed method called.
Reproduction steps/code
Send request multiple time (every 5 sec). Turn off internet, responce listener not called failed or cancelled. Exception print in console.
Version of LibGDX and/or relevant dependencies
1.9.10
Stacktrace
net::ERR_INTERNET_DISCONNECTED
of infinity time with timeout.
Please select the affected platforms
- Android
- iOS
- HTML/GWT
- Windows
- Linux
- MacOS
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
How should I handle "No internet connection" with Retrofit on ...
If no network, throw an exception as appropriate. This allows one to specifically handle network connectivity issues before hitting Retrofit. import java.io.
Read more >No Internet Connection? How to Troubleshoot Internet Issues
Is your Wi-Fi connected but you still aren't getting internet? We've put together a guide to help you troubleshoot your network and get...
Read more >Fix internet connection problems on Android devices
If you can't access the Internet on your Android device, either through an app or a website, try these troubleshooting steps. Signs of...
Read more >If your iPhone or iPad won't connect to a Wi-Fi network
Go to Settings > Wi-Fi and make sure that Wi-Fi is on. Tap the name of your Wi-Fi network to join. A blue...
Read more >Troubleshooting Wi-Fi connection on your Surface
Your Surface shows that it's connected to your wireless network but it's not working or “limited” may appear under your Wi-Fi network name...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s very odd behavior for GWT to call onResponseReceived when no response was, in fact, received. I wouldn’t think that other platforms treat this scenario the same way as they’d likely hit an IOException and call
failed
.According to the GWT documentation,
onResponseReceived
may get called for failed requests with status code 0:We could handle this and call failed() from here with an own exception:
https://github.com/libgdx/libgdx/blob/bc314368a18e0c916437f3dd7b4172714e6abf8b/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/GwtNet.java#L163
It would be “more correct”, but a behaviour change. I am not familiar if other platforms might not call handleHttpResponse with status code 0 though - @MobiDevelop @Tom-Ski what’s your opinion on this?