Open
Description
Version: Deno 2.2.X
Whenever we run a server and receive connections, the endpoint/listener will respect the time out amount and throw an exception: Error: timed out
This exception comes from the closed method (from my testing..)
Client code :
const wt = new WebTransport("https://xxxxxx");
await wt.ready;
console.log(wt);
wt.closed.then(() => console.log("Connection closed"));
//wait 10 second and close the connection
setTimeout(() => wt.close(), 10000);
Server code :
const cert = Deno.readTextFileSync("cert.pem");
const key = Deno.readTextFileSync("private.pem");
const server = new Deno.QuicEndpoint({
hostname: "0.0.0.0",
port: 443,
});
try {
const listener = server.listen({
cert,
key,
alpnProtocols: ["h3"],
});
try {
console.log("waiting first connection");
const nextCon = await listener.accept();
const wt = await Deno.upgradeWebTransport(nextCon);
await wt.ready;
console.log("Client connected");
wt.closed.then(() => {
console.log("Client closed the connection");
Deno.exit(0);
});
} catch {
console.log("Something wrong happened");
}
} catch {
console.error("any catch error");
}
The client auto disconnect after 10 seconds, tho the webtransport closed promise is never reached.
Tried on 2.2.2 and 2.2.3
deno 2.2.2 (stable, release, x86_64-unknown-linux-gnu)
v8 13.4.114.9-rusty
typescript 5.7.3
Activity