Created
May 30, 2025 06:36
-
-
Save jacobsapps/a865b98151ac8e3a0e6794d6cc12f173 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private var webSocketTask: URLSessionWebSocketTask? | |
| private func setupWebSocket(url: URL) { | |
| let session = URLSession(configuration: .default) | |
| webSocketTask = session.webSocketTask(with: url) | |
| webSocketTask?.resume() | |
| Task { | |
| while true { | |
| try await receiveNextMessage() | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment