Is there a good way to access the web socket task actual close code?
when looking at the task delegate:
urlSession(_ session: URLSession, webSocketTask: URLSessionWebSocketTask, didCloseWith closeCode: URLSessionWebSocketTask.CloseCode, reason: Data?)
I can see my custom code _closeCode = (long long) 4231 but the delegate (and the task's) closeCode variable is an enum (URLSessionWebSocketTask.CloseCode) so it have a fallback to the default invalid (0) for unknown values.
I wonder if using
webSocketTask.value(forKey: "_closeCode")
Count as accessing private api, or if there is a cleaner way to access this raw value.