You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I raise this issue because I was mistakenly using on and not bind so events we're firing, but there is something odd about the implementation as such, its managing two lifecycles one on the Socket, one internally on Events.
Perhaps as a solution, on could proxy to bind when sensible to maintain a consistent event emitter implementation
The text was updated successfully, but these errors were encountered:
Good question, I notice the implementation for bind and hook have blacklist checks -- it could simply be that @chjj wanted to protect the event emitter in applicaitons like bcoin and hsd.
My guess is it to differentiate some Socket events and the internal events. That said, I don't see how a blacklist really provides any benefit here. Thanks
It's odd that
Socket
inherits from EventEmitter but implements its own event cycle withbind
https://github.com/bcoin-org/bsock/blob/master/lib/socket.js#L19
https://github.com/bcoin-org/bsock/blob/master/lib/socket.js#L837-L887
I raise this issue because I was mistakenly using
on
and notbind
so events we're firing, but there is something odd about the implementation as such, its managing two lifecycles one on the Socket, one internally on Events.Perhaps as a solution,
on
could proxy tobind
when sensible to maintain a consistent event emitter implementationThe text was updated successfully, but these errors were encountered: