-
Notifications
You must be signed in to change notification settings - Fork 743
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
Adjusting the reconnection behaviour of WebSocketTransport
#1333
Comments
Does |
I'd like to keep existing |
So you're thinking more like this: public func pauseWebSocketConnection() {
self.reconnect.value = false
self.websocket.disconnect()
}
public func resumeWebSocketConnection(autoReconnect: Bool = true) {
self.reconnect.value = autoReconnect
self.websocket.connect()
} I think that could work with a sufficient documentation warning that if you call |
Yes that's essentially what I want. Thanks for the suggestion, I'll have something in the next few days. |
Eh, if that's all you need i'll just do it and throw in a test 😇 |
Ok, thank you so much! |
你好 我想问下 如果 在 APP 进入后台时,手动断开长连接. APP 重新唤起时连接长连接呢 |
This has shipped with |
Hello!
I have a similar setup to #1224 but with the caveat of requiring the user to login again in some cases. With an invalid
connectingPayload
the server closes the connection immediately, andWebSocketTransport
will keep retrying. TheconnectingPayload
can be updated with the new authentication token after the user logs in again.I would like to add in the ability to either prevent
WebSocketTransport
from reconnecting or be able to pause the websocket.If we go the route of adjusting the reconnection behaviour I was thinking of adding something similar to
HTTPNetworkTransportRetryDelegate
but that kind of goes against the idea of passingreconnect
as part of the initialization. So maybe having a getter/setter might be best.Hope that I can get some guidance/feedback on this. Thanks!
The text was updated successfully, but these errors were encountered: