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

async/await URLSessionWebSocketTask receive #281

Open
yeahphil opened this issue Feb 3, 2025 · 1 comment
Open

async/await URLSessionWebSocketTask receive #281

yeahphil opened this issue Feb 3, 2025 · 1 comment

Comments

@yeahphil
Copy link

yeahphil commented Feb 3, 2025

Just looking over #280 -- @dsrees I haven't independently verified this but want to call your attention to this post: https://www.donnywals.com/iterating-over-web-socket-messages-with-async-await-in-swift/

Check the last part of the post (search for "If you're targetting iOS 17 or newer you can ignore this next part")

Apparently there's a bug with cancelling URLSessionWebSocketTask in older iOS that may impact this (otherwise very appealing) change. Causing Tasks that never finish, hanging on an await.

@dsrees
Copy link
Collaborator

dsrees commented Feb 3, 2025

Hm maybe the best thing is to check OS and switch between async and a callback.

I also want to explore using the Network framework for the underlying connection

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

No branches or pull requests

2 participants