You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
onClose would return a SocketCloseEvent, which contains the code (URLSessionWebSocketTask.CloseCode) and the reason. You could pass this into the .close method:
ws.close(SocketCloseEvent(code:.goingAway, reason:"I had a problem!"))
ws.close(code:.goingAway, reason:nil)
This will be built atop URLSessionWebSocketTask, available in iOS 13. Custom frames will not be supported with this implementation.
AnySocket
A Socket with Codable support. It could be used with the onObject callback:
Socket
Web socket support is a large task, so it may be a while. Here's an example of what the syntax could look like:
onClose
would return aSocketCloseEvent
, which contains the code (URLSessionWebSocketTask.CloseCode
) and the reason. You could pass this into the.close
method:This will be built atop
URLSessionWebSocketTask
, available in iOS 13. Custom frames will not be supported with this implementation.AnySocket
A
Socket
withCodable
support. It could be used with theonObject
callback:SocketView
SwiftUI compatibility is key. It could look something like this:
It gives you an array of the response type. The example above shows
Codable
support.The text was updated successfully, but these errors were encountered: