To add more info to this I tried the following.
I have this going in my app:
let m = NWPathMonitor()
m.pathUpdateHandler = { [weak self] path in
print("pathUpdateHandler: \(path)")
print("path.debugDescription: \(path.debugDescription)")
print("path.unsatisfiedReason: \(path.unsatisfiedReason)")
print("path.status: \(path.status)")
print("path.isExpensive: \(path.isExpensive)")
print("path.isConstrained: \(path.isConstrained)")
print("path.isUltraConstrained: \(path.isUltraConstrained)")
print("path.availableInterfaces: \(path.availableInterfaces)")
print("path.availableInterfaces.count: \(path.availableInterfaces.count)")
path.availableInterfaces.forEach { print("interface: \($0)") }
Task { await self?.broadcast(path) }
}
On the iPhone with NO cellular (device A) - while on the wifi network - I see [en0, en0] for availableInterfaces
On the iPhone with cellular (device B) - while on the wifi network - I see [en0, en0, pdp_ip0, pdp_ip0] for availableInterfaces
When i cut off the wifi network device A shows [] for availableInterfaces
When i cut off the wifi network device B shows [pdp_ip0, pdp_ip0] for availableInterfaces
When i then toggle on airplane mode on device B but toggle on wifi I see [] for availableInterfaces
So at this point device A and device B are showing the same availableInterfaces - but they still can't connect. They can discovery each other but the connection never makes it to the TLS stage.
Below are my logs from having no wifi network, device A has its Device Discovery running (ie NetworkBrowser up and running and NetworkListener up and running) - device A has its wifi toggle on
device B has its Device Discovery running (ie NetworkBrowser up and running and NetworkListener up and running) - device B has its wifi toggle on
[MessageService] new subscriber added
local network service -> browser state update handler: ready
unsubscribe voice control commands
here in on termination of voice control
local network service -> browser state update handler: cancelled
[startBrowser]: browser is ready
[L1 ready, local endpoint: <NULL>, parameters: quic, local: ::.0, definite, attribution: developer, server, port: 61566, path satisfied (Path is satisfied), viable, interface: pdp_ip0[lte], ipv4, ipv6, dns, expensive, uses cell, LQM: good, service: 8FB0D9E1-303A-47E2-B15A-6826279577D7._captadoh._udp.<NULL> txtLength:0]: ready
Listener ready
onServiceRegistrationUpdate: added 8FB0D9E1-303A-47E2-B15A-6826279577D7._captadoh._udp.local.
[NetworkingService] handleBrowserEndpoints skipping self endpoint: 8FB0D9E1-303A-47E2-B15A-6826279577D7
handleOutboundConnection: connection added
here in setupConnectionReceiveTask
nw_resolver_start_query_timer_block_invoke [C2.1.1] Query fired: did not receive all answers in time for b4f40bc0-c586-4946-a2f3-950fb21fddeb.local.:64458
[NetworkingService] handleBrowserEndpoints skipping self endpoint: 8FB0D9E1-303A-47E2-B15A-6826279577D7
[NetworkingService] handleEndpointRemoved removed endpoint for 354C4D39-2CA4-4A06-9F41-8A9B755C025B
nw_connection_copy_protocol_metadata_internal_block_invoke [C3] Client called nw_connection_copy_protocol_metadata_internal on unconnected nw_connection
nw_connection_copy_protocol_metadata_internal_block_invoke [C3] Client called nw_connection_copy_protocol_metadata_internal on unconnected nw_connection
nw_connection_copy_connected_local_endpoint_block_invoke [C3] Client called nw_connection_copy_connected_local_endpoint on unconnected nw_connection
nw_connection_copy_connected_remote_endpoint_block_invoke [C3] Client called nw_connection_copy_connected_remote_endpoint on unconnected nw_connection
nw_endpoint_flow_failed_with_error [C2.1.1.1 fe80::7cc9:daff:fea6:9151%awdl0.64458 in_progress channel-flow (satisfied (Path is satisfied), viable, interface: awdl0[802.11], scoped, uses wifi, LQM: good)] already failing, returning
[NetworkingService] handleBrowserEndpoints skipping self endpoint: 8FB0D9E1-303A-47E2-B15A-6826279577D7
handleOutboundConnection: connection added
here in setupConnectionReceiveTask
nw_resolver_start_query_timer_block_invoke [C4.1.1] Query fired: did not receive all answers in time for b4f40bc0-c586-4946-a2f3-950fb21fddeb.local.:64458
[NetworkingService] handleBrowserEndpoints skipping self endpoint: 8FB0D9E1-303A-47E2-B15A-6826279577D7
[NetworkingService] handleEndpointRemoved removed endpoint for 354C4D39-2CA4-4A06-9F41-8A9B755C025B
nw_connection_copy_protocol_metadata_internal_block_invoke [C5] Client called nw_connection_copy_protocol_metadata_internal on unconnected nw_connection
nw_connection_copy_protocol_metadata_internal_block_invoke [C5] Client called nw_connection_copy_protocol_metadata_internal on unconnected nw_connection
nw_connection_copy_connected_local_endpoint_block_invoke [C5] Client called nw_connection_copy_connected_local_endpoint on unconnected nw_connection
nw_connection_copy_connected_remote_endpoint_block_invoke [C5] Client called nw_connection_copy_connected_remote_endpoint on unconnected nw_connection
nw_endpoint_flow_failed_with_error [C4.1.1.1 fe80::7cc9:daff:fea6:9151%awdl0.64458 in_progress channel-flow (satisfied (Path is satisfied), viable, interface: awdl0[802.11], scoped, uses wifi, LQM: good)] already failing, returning
Note that device A has the device ID 354C4D39-2CA4-4A06-9F41-8A9B755C025B - device B has the device ID 8FB0D9E1-303A-47E2-B15A-6826279577D7