-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Comments
Duplicate #638 |
Also, everyone hates that it does this and @reconbot and I currently have our sights set to eliminate it |
And also in disconnect, it shouldn't be there either |
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. |
agreed, it's poorly documented |
@pabigot I made the docs a bit better around this situation https://github.com/voodootikigod/node-serialport/blob/master/README.md#close-callback We'll stop doing that in a major release sometime soon. And thank you for noticing and for being a part of it. =) |
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.
The text was updated successfully, but these errors were encountered: