Comments (9)
from asynchttprequest.
Here you go... I've left some of my debug messages in there which you (hopefully) will be able to match to the scenario above.
Note that the "crash" occurs right at the time that the response from the third request (the one launched with a http.readyState() of 0) would be expected to arrive.
[6709] Ready State: 0
[6709] Push Sent
Debug(6710): setDebug(on) version 1.1.15
Debug(6710): open(GET, http://192.168.59.184:2002/?valu)
Debug( 1): _parseURL() HTTP://192.168.59.184:2002/?value=1
Debug( 6): _connect()
Debug( 11): send()
Debug( 11): _buildRequest()
Debug( 12): _send() 126
Debug( 14): *can't send
Debug(30127): _onError handler error=-13
Debug(30128): _onDisconnect handler
Debug(30128): _setReadyState(4)
[36838] HTTP Status Code:-4
Debug(30129): responseText() Debug(30131): responseText() no data
[43161] Ready State: 4
[43161] Push Sent
Debug(36452): setTimeout(2)
Debug(36452): setDebug(on) version 1.1.15
Debug(36452): open(GET, http://192.168.59.184:2002/?valu)
Debug( 1): _parseURL() HTTP://192.168.59.184:2002/?value=0
Debug( 5): _connect()
Debug( 9): send()
Debug( 10): _buildRequest()
Debug( 12): _send() 126
Debug( 14): *can't send
Debug(30845): _onError handler error=-13
Debug(30845): _onDisconnect handler
Debug(30846): _setReadyState(4)
[74011] HTTP Status Code:-4
Debug(30846): responseText() Debug(30849): responseText() no data
[80021] Ready State: 4
[80021] Push Sent
Debug(36857): setTimeout(2)
Debug(36857): setDebug(on) version 1.1.15
Debug(36857): open(GET, http://192.168.59.184:2002/?valu)
Debug( 1): _parseURL() HTTP://192.168.59.184:2002/?value=0
Debug( 5): _connect()
Debug( 9): send()
Debug( 10): _buildRequest()
Debug( 12): _send() 126
Debug( 14): *can't send
[88459] Ready State: 0
[88460] Push Sent
Debug(8435): setTimeout(2)
Debug(8435): setDebug(on) version 1.1.15
Debug(8435): open(GET, http://192.168.59.184:2002/?valu)
Debug( 1): _parseURL() HTTP://192.168.59.184:2002/?value=1
Debug( 6): _connect()
Debug( 9): send()
Debug( 9): _buildRequest()
Debug( 12): _send() 126
Debug( 14): *can't send
Debug(21244): _onError handler error=-13
Debug(21245): _onDisconnect handler
Debug(21245): _setReadyState(4)
[109709] HTTP Status Code:-4
Debug(21246): responseText() Debug(21249): responseText() no data
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
from asynchttprequest.
I had a quick look at this. The restart appears to be caused by (in my example above) the second connection attempt de-allocating _client when the onDisconnect handler fires while the the third connection attempt is still active. The third attempt then tries to re-use the already deallocated _client causing the restart. As I said, I can work around this by looking for the http.readyState() to be 4 (not 0) (after the first connect attempt) and queuing/retrying subsequent messages until the previous attempt has timed out. This stops the resets.
However, we still have the issue that there is a (+/-) 30 sec timeout before the onDisconnect event turns up even though the application "knows" it "*can't send" after less than 20 ms. Any thoughts on how to abort the connection and/or fire the onDisconnect event? I've tried using the abort() command after a timeout however that has no effect. Any thoughts appreciated.
from asynchttprequest.
Hello, I have the excact same problems.
Here is my example code and here is the reboot msg.
from asynchttprequest.
@andrewk123 did you solve the timout problem?
from asynchttprequest.
I tried AsyncHTTPRequest_Generic and found the same issue, however Khoi was able to resolve it so I use that version now. It's functionally identical to asyncHTTPrequest. There were some small changes to integrate it but nothing that took more than a few minutes. The fix was in 1.4.0.
https://github.com/khoih-prog/AsyncHTTPRequest_Generic
from asynchttprequest.
@andrewk123 Hi first of all thanks for your answer!
Thats actually pretty funny because I struggeled for weeks to get either boblemaire's or khoih-progs library to work properly.
After days of no success I created a issue which let khoih to make a new version with a fix. Here is his answer to my issue.
Unfortunately till today I didn't get a working version..
After the "fix" it still takes always 18 seconds to get a bad connection response. You can see my demo-code + debug output here.
Which microcontroller do you use?
from asynchttprequest.
Looks like a solution was found in another's fork.
from asynchttprequest.
@boblemaire Wich one?
from asynchttprequest.
Related Issues (20)
- ESP32 crashes when making simultaneous requests with 2 instances HOT 3
- Connection not Closing HOT 3
- Question: Identifying Caller in Callback HOT 3
- Question: Use of Optional Argument in asyncHTTPRequest::onReadyStateChange() HOT 1
- Crash on Loading Data HOT 2
- Basic Authentication using URL Encoding (in POST) Crashes with Guru Meditation Error
- URL without trailing '/' after address causes crash on ESP32 HOT 1
- Issue when assigning result to a string HOT 2
- Following redirects? HOT 1
- HTTPS HOT 1
- Compilation error on esp32 HOT 3
- Compilation error on ESP8285 and PlatformIO
- Feature request: make readyStates public HOT 1
- HTTP Basic Auth login password HOT 1
- Hello ! HOT 1
- Want to make 2 different requests, but how to say to the "void requestCB" function to which requests the result belongs ? HOT 8
- "Off by one" error in header values ? HOT 1
- assert failed: block_trim_free HOT 1
- Strange issue with ESP32
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asynchttprequest.