Skip to content

Commit

Permalink
Close TCP socket when writable stream is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Mar 14, 2024
1 parent bc9499f commit 7e74082
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/pink-rings-listen.md
@@ -0,0 +1,5 @@
---
"nxjs-runtime": patch
---

Close TCP socket when writable stream is closed
3 changes: 3 additions & 0 deletions packages/runtime/src/tcp.ts
Expand Up @@ -128,6 +128,9 @@ export class Socket {
}
await (i.tls ? tlsWrite(i.tls, chunk) : write(i.fd, chunk));
},
close() {
socket.close();
},
});

connect(address)
Expand Down

0 comments on commit 7e74082

Please sign in to comment.