Skip to content

Commit

Permalink
fix(http/server): flaky 'address in use' error (#3333)
Browse files Browse the repository at this point in the history
  • Loading branch information
tetraphobia authored Apr 28, 2023
1 parent 92d1fb8 commit aa57bf3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion http/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,13 @@ export async function serve(
once: true,
});

const s = server.listenAndServe();
const listener = Deno.listen({
port,
hostname,
transport: "tcp",
});

const s = server.serve(listener);

port = (server.addrs[0] as Deno.NetAddr).port;

Expand Down

0 comments on commit aa57bf3

Please sign in to comment.