Scarlet icon indicating copy to clipboard operation
Scarlet copied to clipboard

Closing and canceling WebSocket

Open lolloz98 opened this issue 4 years ago • 2 comments

I am trying to build an app which should connect via WebSocket to a server at runtime (the user will be prompt to give the address of the server and should be able to switch server at any time).

How could I cancel a WebSocket? @zhxnlai what do you think?

lolloz98 avatar Apr 19 '20 14:04 lolloz98

For now, the best solution I have been able to achieve has been to close forever the connection when the user changes URL. Once the application gets destroyed, the previous connection is destroyed as well. However, this is not a really good solution and I believe it could bring memory leaks.

lolloz98 avatar Apr 23 '20 00:04 lolloz98

i am facing the same problem and i couldn't come with a better solution.

atefetman avatar May 22 '20 01:05 atefetman