Skip to content
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

feat(core) support AbortSignal in Deno.listen #11569

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
signal ref
  • Loading branch information
benjamingr committed Aug 3, 2021
commit 3873c435007d25863a4264ef2de4395db162c04b
4 changes: 2 additions & 2 deletions extensions/net/02_tls.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
hostname = "0.0.0.0",
transport = "tcp",
alpnProtocols,
signal,
}) {
const res = opListenTls({
port,
Expand All @@ -60,12 +61,11 @@
hostname,
transport,
alpnProtocols,
signal,
});
const listener = new TLSListener(res.rid, res.localAddr);
if (signal) {
// TODO(benjamingr) there is memory leak potential here. See comment in 01_net.js
options?.signal?.addEventListener("abort", () => listener.close(), {
signal.addEventListener("abort", () => listener.close(), {
once: true,
});
}
Expand Down