Hello,
I came accros a wired behaviour in my app, using local network.
My app is connecting to a local device, sending messages, and closing the tcp connection.
Sometimes (when the device handle lots of data) the device send TPC packets with a window size value of: 0.
But using the NWConnection (of the Network Framework) this is transparent, we have no clue about the window size, the system will send the data when the window size will update.
However, using NWConnection.send, we got the send completion closure being call without any error while the data has not been sent to the device.
So our app closes the connection (NWConnection.cancel) successfuly (data still to sent to the device).
If the TCP Window is updated, after that, while the app is still open, there is no issue, iOS sends the data to the device and then actually closes the TCP Connection.
But if the device is locked, or the app being sent to the background before the TCP Window Size is updated, then iOS sent a RST packet to the device and the connection terminates without the data ever reaching the device. From the app point of view, the data was sent and it seams that we have no way to informe the user that the message was not sent to the device.
Does any one have an idea of how the app can be aware of this data not sent to the device?
Thanks for your help!