I’ve a easy SwiftUI software that sends a URLRequest as proven within the code snippet under:
import SwiftUI
@major
struct GOGODemoApp: App {
var physique: some Scene {
WindowGroup {
MyView()
}
}
}
struct MyView: View {
var physique: some View {
Button("Click on") {
sendHTTPRequest(to: "https://www.google.com") { code, err in
print("Completed, code: (code ?? -1), err: (String(describing: err))")
}
}
}
}
func sendHTTPRequest(to urlString: String, completion: @escaping (Int?, Error?) -> Void) {
guard let url = URL(string: urlString) else {
completion(nil, NSError(area: "InvalidURL", code: 0, userInfo: nil))
return
}
let process = URLSession.shared.dataTask(with: url) { _, resp, error in
if let httpResponse = resp as? HTTPURLResponse {
completion(httpResponse.statusCode, error)
} else {
completion(-1, error)
}
}
process.resume()
}
Nevertheless, Xcode prints the next warning messages:
nw_connection_copy_connected_local_endpoint_block_invoke [C1] Connection has no native endpoint
nw_connection_copy_connected_local_endpoint_block_invoke [C1] Connection has no native endpoint
nw_connection_copy_connected_local_endpoint_block_invoke [C3] Connection has no native endpoint
nw_connection_copy_connected_local_endpoint_block_invoke [C3] Connection has no native endpoint
Completed, code: 200, err: nil
What does the warning ‘Connection has no native endpoint’ imply?
Thanks on your help!