Skip to content

How to disconnect a socket temporarily #25

Answered by matehat
cachapa asked this question in Q&A
Discussion options

You must be logged in to vote

Currently it's not possible to do that, and I don't think the reference implementation from the core Phoenix team supports that either. A solution would be to close and dispose of the socket when you go in the background, and re-instantiate a new PhoenixSocket when your app resumes.

The reconnect flag is used internally following a connection close, due to protocol error or transient network failure, for cases where you can get a new connection by re-connecting.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@cachapa
Comment options

@matehat
Comment options

Answer selected by cachapa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants