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

listeners should not be removed on close #721

Closed
pabigot opened this issue Apr 3, 2016 · 7 comments
Closed

listeners should not be removed on close #721

pabigot opened this issue Apr 3, 2016 · 7 comments

Comments

@pabigot
Copy link
Contributor

pabigot commented Apr 3, 2016

I don't expect this to be fixed since it'd be a behavior change, but for the record:

SerialPort.prototype.close improperly removes all listeners that the application might have registered with the instance. Although the serial port can subsequently be re-opened with no difficulty and will re-use the configuration passed on construction the poor developer has to reconstruct the listeners and re-install them.

It'd probably be worth documenting that behavior.

@rwaldron
Copy link
Contributor

rwaldron commented Apr 3, 2016

Duplicate #638

@rwaldron
Copy link
Contributor

rwaldron commented Apr 3, 2016

Also, everyone hates that it does this and @reconbot and I currently have our sights set to eliminate it

@reconbot
Copy link
Member

reconbot commented Apr 3, 2016

And also in disconnect, it shouldn't be there either

@reconbot
Copy link
Member

reconbot commented Apr 3, 2016

@pabigot
Copy link
Contributor Author

pabigot commented Apr 3, 2016

OK, I see it now. I would have seen it before if it wasn't "hidden" down inside the discussion of the callback parameter.

I am glad to see there's serious effort going towards cleaning this module up. Thanks.

@reconbot
Copy link
Member

reconbot commented Apr 3, 2016

agreed, it's poorly documented

@reconbot reconbot closed this as completed Apr 3, 2016
@reconbot
Copy link
Member

reconbot commented Apr 3, 2016

@pabigot I made the docs a bit better around this situation

https://github.com/voodootikigod/node-serialport/blob/master/README.md#close-callback
https://github.com/voodootikigod/node-serialport/blob/master/README.md#ondisconect-callback

We'll stop doing that in a major release sometime soon.

And thank you for noticing and for being a part of it. =)

@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants