Skip to content

Commit

Permalink
fix(win): close or destroy tcp socket for net.connect & net.createServer
Browse files Browse the repository at this point in the history
- use socket.destroy for node 16 compat on windows
  • Loading branch information
YOU54F committed Jul 18, 2024
1 parent 10a18ff commit 86a2f8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/matt.consumer.integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const sendMattMessageTCP = (
return new Promise((resolve) => {
socket.on('data', (data) => {
resolve(parseMattMessage(data.toString()));
socket.destroy();
});
});
};
Expand Down
1 change: 1 addition & 0 deletions test/matt.provider.integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const startTCPServer = (host: string, port: number) => {
sock.write(generateMattMessage('message not understood'));
}
sock.write('\n');
sock.destroy();
});
});

Expand Down

0 comments on commit 86a2f8d

Please sign in to comment.