On my Mac in the Apple Swift version 5.2.4 (swiftlang-1126.96.36.199 clang-1188.8.131.52) REPL this works:
import Foundation let task = URLSession.shared.webSocketTask(with: URL(string: "wss://example")!)
But on Ubuntu in Swift for Tensorflow version 5.3-dev (LLVM 55d27a5828, Swift 6a5d84ec08), this does not work:
import Foundation import FoundationNetworking let task = URLSession.shared.webSocketTask(with: URL(string: "wss://example")!)
Compiler error: value of type 'URLSession' has no member 'webSocketTask'
I see this is the discussion on splitting FoundationNetworking out of Foundation: Pitch: Move URLSession to new FoundationNetworking module
Is there no WebSocket support in FoundationNetworking, despite its presence in Foundation?
Typically I've been referring to the Apple Developer Swift docs as an API reference: https://developer.apple.com/documentation/technologies
Is there anywhere I can find a FoundationNetworking-specific API reference?
I believe the library underlying Foundation's WebSocket functionality is Apple's SwiftNIO (?) found here: https://github.com/apple/swift-nio. It indicates on its GitHub page that it supports Ubuntu. Perhaps it will be necessary to install this library as a dependency and drop down to the NIO layer to get WebSocket functionality in linux?