Skip to content
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

Disconnect Close Status Codes #48

Open
Kraigie opened this issue Nov 2, 2016 · 2 comments
Open

Disconnect Close Status Codes #48

Kraigie opened this issue Nov 2, 2016 · 2 comments
Assignees
Milestone

Comments

@Kraigie
Copy link

Kraigie commented Nov 2, 2016

It's my understanding that it is currently not possible to get close codes upon disconnect.

The _Reason variable holds this close code information, it's being ignored here.

These codes would be very useful when consuming 3rd party websockets that define their own event codes in the 3000..4999 range

@sanmiguel
Copy link
Owner

Great idea!

Apologies for the long silence on this - I've been unable to set aside enough time to look at this library for quite a while. I'm trying to at least catch up with the issues raised right now, while I have some spare time.

I'm looking at how we'd propagate that close code back out to the caller and it's not immediately obvious to me. I think perhaps the appropriate thing to do would be to call disconnect(Reason, Context) from that case clause you linked - this would call your ondisconnect(Reason, State) callback. Does that allow you to do what you need?

@sanmiguel sanmiguel self-assigned this Jun 16, 2017
@sanmiguel sanmiguel added this to the 2.0 milestone Jun 16, 2017
@Kraigie
Copy link
Author

Kraigie commented Jun 19, 2017

Yes, I believe that would be sufficient. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants