I'm trying to establish a tcp connection to server using Network Framework (nw_connection_t in obj-c). As a draft I use tcp echo server tcpbin.com with default connection parameters. Everything works fine: connection establishing, sending and receiving data.
But when I disable wifi network via Control Center, established connection doesn't drop, connection status doesn't change in nw_connection_set_state_changed_handler until remote side drops connection by timeout.
Meantime nw_connection_set_path_changed_handler reports that wifi network path is "unsatisfied" and cellular connection is available.
The same thing happens when I switch from cellular to wifi network via Control Center.
Questions are:
Should nw_connection_t change its state to nw_connection_state_failed and\or nw_connection_state_waiting when the current network path becomes unavailable?
What is the recommended way to switch from the inactive interface (or interface without internet) to working one?
iOS version is 17.3.
Selecting any option will automatically load the page