-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
wdt reset when websocket client disconnect #48
Comments
I see similiar problem of kosmonavtX in your example: |
can you guys please post some code that I can have a look at. the lib is asynchronous which means that if you do not waste time in the callbacks, there is no way for it to cause wdt. All calls return immediately and process the data in background. |
Thanks a lot |
@me-no-dev, code is large enough. |
@kosmonavtX interesting.. the code looks fine. How should I run it to trigger the error? |
when you say disconnect, do you mean that you run through the disconnect routine, or that the browser closes, or how? |
Wdt reset when the page is refreshed, the client is disconnected. |
what browser are you using? I used to see those problems sometimes with chrome but I believe I fixed them |
Most firefox. Less chrome. |
cool, will give it a go and see what the results will be. |
So I was having the same problem and tracked it down to this piece of code. If I comment out this line, all works well. I am unsure what other ramifications this has but I imagine that it is meant to free memory after the socket closes. I suspect that the 'cl' would pass out of scope anyway and the delete is not needed. But, there is a high probability that I am wrong. Also, I don't know if the line above it does anything at all. The function it calls just returns a bool. Hope this helps, BTW ... This is a great little piece of code me-no-dev. |
this is interesting... the line you talk about just frees the client from the memory. Are there any stack traces coming out? onDisconnect should be actually the very last piece of code that get's executed before the connection is totally closed, so why would it error? Btw I have tested this extensively with Chrome and Safari (mac user here) and did find differences in how they handle disconnects, but got to fix all of that. |
ok I think I might have a pointer to what could be going wrong (maybe). |
_server->_handleDisconnect(this):
Maybe somewhere here?
|
hmmm... that's not it... if you see |
O.K. a little update... Yes, my last edit caused a mem leak but I traced the problem a little further and have isolated it to the following code If I comment out:
everything works as written and there is no mem leak as far as I can tell. To this point I have not been able to understand why it does not look like the PCB is closed or why the abort statement causes a reset. Any thoughts? |
I scratched my head quite some time today also. I could not find a way to reproduce it constantly though... I had chrome and firefox both open refreshing, reconnecting and whatnot and every now and then I'll get wdt or funky exception on connect. Saw some strange packets coming from chrome about already closed connections. I saw chrome to ack one less byte (maybe some sort of keep alive), but nothing that can get me a clue at what point exactly the code breaks. |
ok... if you replace this line with |
latest ESPAsyncTCP commits are needed for this to properly work fixing: #48
guys, this is fixed! Please update your TCP libs as well and give it a go! |
me-no-dev ... works great. I can not repeat the reset. Thanks for the effort, sorry I could not have been more help. Quick question, you said the fix opened another problem. Did you solve that one as well? |
Yes i did :) all should be good now :) there are some new features you might like. You can check the readme for more info |
What is application of FSBrowser? |
it lets you browse, edit, download and delete contents from SPIFFS through the browser. |
Thanks a lot, |
When the client disconnects are wdt reset:
ws[/ws][3] disconnect: 0
ets Jan 8 2013,rst cause:4, boot mode:(3,1)
wdt reset
Error instable.
The text was updated successfully, but these errors were encountered: