-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection not Closing #24
Comments
Not very fluent at php, but I think that in addition to the HTTP header, it is sending back a payload with either "ok" or "Invalid JSON received.". That would be the data received by asyncHTTPrequest. Ordinarily, an application would read that data, either in the ondata callback, or elsewhere upon some event signaled by the callback. In your case, it looks as if you never actually retrieve the data, as a result the ondata callback continues to be invoked. Unfortunately, I have not provided a flush function, so you will need to actually read the data. Presumably this is something you should do anyway to verify that the json parsed. Once you retrieve the data, the callbacks should stop. BTW/ It is advisable to check the return from open and send as they can and do fail for reasons beyond the control of the program. |
Aha! That seems reasonable. I'll try that as soon as I get of this call. Thank you! |
That was it, thank you sir! |
This is not a bug, it's likely me being a dumba%$, but I'm willing to accept ridicule right now. I am unit testing some code and POSTing a JSON to a PHP endpoint just to get the code working. It looks as if the session never closes, therefore the onData callback keeps firing. If I were to place money on it, I'd say I messed up my PHP somewhere but I am not sure where.
Here's my C++ code snippet:
And here is the receiving PHP code:
Here's my serial log when this fires:
The last line repeats every second or so till the next POST event.
As I said, the
Debug( 74): *all data received - no disconnect
points to me not doing something right at the webserver level. Does my problem jump out at you?The text was updated successfully, but these errors were encountered: