Skip to content

Commit

Permalink
server: Do not close ws when on TCP client error
Browse files Browse the repository at this point in the history
  • Loading branch information
peterkuma committed Aug 11, 2021
1 parent 4e635d4 commit 50c0ba3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ module.exports = function(options) {
let client = tcpClient(mx, options.tcpPort, options.tcpHostname);
client.on('connection', data => obj.emit('tcp-connection', data, stream));
client.on('close', () => obj.emit('tcp-close'));
client.on('error', err => {
mx.destroy();
stream.destroy();
obj.emit('error', err);
});
client.on('error', err => obj.emit('error', err));
}
stream.on('end', () => {
mx.destroy();
Expand Down

0 comments on commit 50c0ba3

Please sign in to comment.