-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
bugSomething isn't working correctlySomething isn't working correctlyext/websocketrelated to the ext/websocket craterelated to the ext/websocket crate
Description
Version: Deno 1.45.5
OS: Linux
Steps: start a server which accepts a ws connection, not necessary to send anything from the server. Can use this one from another issue I’ve filed, just please comment out the part where it sends tons of messages. Start the client script (below). Exit the server script, in my case the client gets Unexpected EOF
error.
Somehow I get unhandled rejection, though in the client code below I can’t see where it pops up from. Is possible it gets thrown and not intercepted somewhere internally?
const wss = new WebSocketStream('ws://localhost:3333/');
const conn = await wss.opened;
const reader = conn.readable.getReader();
addEventListener('unhandledrejection', (event) => {
event.preventDefault();
console.log('unhandledrejection', event);
});
wss.closed.then((x) => {
console.log('closed', x);
}).catch((err) => {
console.log('err', err);
});
while (true) {
try {
const { value, done } = await reader.read();
if (done) {
console.log('done');
break;
}
console.log('msg', value);
} catch (error) {
console.log('read_loop_error', error);
break;
}
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't working correctlySomething isn't working correctlyext/websocketrelated to the ext/websocket craterelated to the ext/websocket crate