Skip to content

Conversation

@jssuttles
Copy link

No description provided.

});
callback();
});
self.client.on('close', function() {
Copy link
Author

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);
Copy link
Author

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"));
Copy link
Author

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 = [];
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added socket tracking

@jssuttles jssuttles changed the title refactor TCP client and server to manage connections and responses more effectively refactor TCP Server to close open connections, refactor TCP Client to handle multiple messages and close event Mar 21, 2025
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.

1 participant