profile
viewpoint

Ask questionsTCP accept loop doesn't use for-await

Currently to accept connections from TCP server the API is this:

  const listener = Deno.listen({ port: 1234 });
  console.log("Listening on", addr);
  while (true) {
    const conn = await listener.accept();
    handle(conn);
  }

Would it be better to instead use a for-await loop? (Especially since top-level-for-await is now supported).

If the API is changed, we should also make sure that listenTCP is similarly updated.

denoland/deno

Answer questions ry

Oops I forgot about that :)

useful!

Related questions

{WSL 2} Permission denied (os error 13) hot 1
gRPC in Deno? hot 1
deno remove/uninstall subcommand hot 1
Insight required: Resource (TCP) errors hot 1
Support d.ts files hot 1
Restore runtime lib generation capability hot 1
disable flaky tests _048_media_types_jsx and _019_media_types hot 1
Typescript Custom Transformers Support hot 1
reorg directory structure hot 1
Centos 7 GLIBC_2.18 not found hot 1
"deno ast script.ts" hot 1
Text decoding performance abysmally slow. hot 1
"deno ast script.ts" hot 1
Can't build master hot 1
Can't build master hot 1
Github User Rank List