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

Add alternative websocket implementation via URLSessionWebSocketTask #84

Merged
merged 9 commits into from
Aug 3, 2023

Conversation

antonselyanin
Copy link
Contributor

This PR adds an alternative websocket implementation (via URLSessionWebSocketTask).
It is disabled by default but you can enable it via flag useNativeWebSockets (works starting from iOS 13.0).

Sources/SwiftCentrifuge/Client.swift Outdated Show resolved Hide resolved
Sources/SwiftCentrifuge/Helpers.swift Show resolved Hide resolved
Sources/SwiftCentrifuge/Client.swift Outdated Show resolved Hide resolved
Sources/SwiftCentrifuge/Client.swift Outdated Show resolved Hide resolved
@antonselyanin antonselyanin marked this pull request as ready for review May 16, 2023 08:06
Copy link
Member

@FZambia FZambia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Great improvement! Let's wait for the testing round results and proceed if no issues araise.

Anton Selyanin and others added 9 commits August 1, 2023 15:43
…t, a remove reference cycle caused by URLSession
…cessary `syncQueue.async` calls; remove "race condition" which was occurring during disconnection process.
…n NativeWebSocket (make sure `onDisconnect` is being invoked after manual disconnect)
…s an already active connection.

This should be safe, the client has it own state management (connecting, disconnected, connecting).
@FZambia FZambia merged commit 783e7a2 into centrifugal:master Aug 3, 2023
1 check passed
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 this pull request may close these issues.

2 participants