-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
1005 status code is incorrectly treated as "abnormal" shutdown #3
Comments
When do you encounter a 1005 code in a normal setting? In my experience, a 1005 is always unexpected, meaning a closure happened before something had time to write a proper code & reason. |
A simple |
Yeah, I suppose this is the result of my habit(s). I always send The 1005 code is basically the 204 of WebSockets. Technically okay, but not all that informative/useful. I'll look into accepting |
To clarify: if the server sends an empty close frame (
It's your lib so you can obviously do whatever you want but it is inconsistent with what browsers do. If you don't specify a close code, the close frame should be empty. You prevent the user from sending an empty close frame by forcing a 1000 close code and increase the bandwidth usage by 2 bytes per frame 😄 . |
Yea, for sure! I've always preferred to be explicit with my codes & am not closing connections on a high frequency, so the extra 2 bytes hasn't been an issue 😆. I'll look at this tonight. Forcing this practice on others probably isn't the right approach... And, unfortunately, changing this probably requires a really sudden Thanks for the feedback~! |
Hey @lpinca, do you mind taking a quick peek and verifying the change for me? Dropped it into my apps and it's still working as expected~ |
It looks good. If I'm not wrong you can also remove the |
Ah, right! What I get with hurried coding... I'll fix that, but what do you think about the server? Does this constitute a major change, or is it just a minor after all since the interface API hasn't changed |
The reconnection change is a bug fix. The |
Released in 1.1.0 -- a minor felt more accurate. Thanks again! |
If the close frame contains no status code (payload length == 0), the close code is 1005. In this case sockette should not reconnect.
Ref: https://tools.ietf.org/html/rfc6455#section-7.1.5
The text was updated successfully, but these errors were encountered: