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

Websocket API dying on Deno but not on Chrome #8972

Closed
elizeuangelo opened this issue Jan 3, 2021 · 2 comments · Fixed by #8974
Closed

Websocket API dying on Deno but not on Chrome #8972

elizeuangelo opened this issue Jan 3, 2021 · 2 comments · Fixed by #8974

Comments

@elizeuangelo
Copy link

elizeuangelo commented Jan 3, 2021

There are two different streams im trying connecting my client using the standard WebSocket API (I have no libraries imported).

In Deno the connections always die after a couple of minutes... in Chrome Browser they dont. Using the exact same code. I have not tested in a third web stream but I believe its no coincidence.

Testing code:

let connection = new WebSocket('wss://stream.binance.com:9443/ws/btcbrl@trade');
connection.onmessage = (message) => console.log(new Date(), 'msg received');
setInterval(() => console.log('idle'), 30000); // So Deno dont closes?

In one manual they mention to kill any connections that dont answer pings for 3 minutes, hypothesis one.

I have noticed if you dont 'setInterval' or wait for something deno closes the application after some time without provocation... maybe its not a ping issue but Deno itself doing something to the websocket (while the process is still running and the socket receiving msgs) believing its idle? hypothesis two

@elizeuangelo elizeuangelo changed the title Websocket API dying, maybe not answering pings Websocket API dying, Deno is closing it OR ping issue? Jan 3, 2021
@elizeuangelo elizeuangelo changed the title Websocket API dying, Deno is closing it OR ping issue? Websocket API dying on Deno but not on Chrome Jan 3, 2021
@glowingblue-dev
Copy link

I think this is related to some of the comments in this issue #7457 (comment)

@lucacasonato
Copy link
Member

lucacasonato commented Jan 5, 2021

In one manual they mention to kill any connections that dont answer pings for 3 minutes, hypothesis one.

This should be fixed in the latest deno canary build (will be available in about 40 minutes). You can try it out with deno upgrade --canary.

It will be in Deno stable 1.7 which is due to release on Jan 19 2021.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants