-
Notifications
You must be signed in to change notification settings - Fork 63
refactor TCP Server to close open connections, refactor TCP Client to handle multiple messages and close event #105
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
base: v4.0.1
Are you sure you want to change the base?
Conversation
| }); | ||
| callback(); | ||
| }); | ||
| self.client.on('close', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On server side close, it would not clean up
| if (!self.keepalive) { | ||
| self.close(); | ||
| } | ||
| self.callback(null, ack); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't allow another message to be queued up right after the first one completed
| self.callback = callback || self.callback; | ||
| if (self.awaitingResponse) { | ||
| self.callback(new Error("Can't send while awaiting response")); | ||
| callback(new Error("Can't send while awaiting response")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced the callback, so that the first message callback didn't receive the ack, but the second one did
| this.handler = handler; | ||
| this.server = null; | ||
| this.socket = null; | ||
| this.sockets = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added socket tracking
No description provided.