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

I3IpcClient "connect" emit order is corrected. #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ndvtr
Copy link

@ndvtr ndvtr commented Apr 23, 2017

I3IpcClient "connect" event emit is placed after "self._stream" assign.

I3IpcClient "connect" event emit is placed after "self._stream" assign.
@sidorares
Copy link
Owner

why this was a problem? Does any code outside relies on ._stream being set?

@ndvtr
Copy link
Author

ndvtr commented Apr 23, 2017

yes, you are right, ._stream from the outside is not very good, but I needed for example a ._stream.destroy()

@sidorares
Copy link
Owner

can you elaborate why? Maybe we need to add public api for that?

@ndvtr
Copy link
Author

ndvtr commented Apr 23, 2017

Close/destroy socket connection after a timeout: I'm waiting a window event but not longer than 30 seconds or another logic, for example.
Yes, .destroy() would be nice:

@@ -178,0 +179,5 @@ I3IpcClient.prototype.on = function(event, handler) {
+I3IpcClient.prototype.destroy = function() {
+  if (!this._stream) return;
+  this._stream.destroy();
+}

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

Successfully merging this pull request may close these issues.

2 participants