Scarlet
Scarlet copied to clipboard
Closing and canceling WebSocket
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?
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.
i am facing the same problem and i couldn't come with a better solution.