Skip to content

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