I noticed that the OTA windows simulator demo does not resume correctly after the network connection was dropped and resumed again during an OTA download (LAN cable unplug/re-plug).
For my own application, my connection relies on a cellular connection, which frequently drops when travelling around. I have written my own layer that interfaces the OTA transport layer to the low level modem AT interface. It uses a state machine that continuously tries to reconnect after the connection has dropped. My current socket implementation still needs to implement how to handle these connection drops. And I wonder how to best implement that.
For instance, can my own socket implementation in the transport interface simply return
pdFREERTOS_ERRNO_ENOTCONN -128 // Socket is not connected
and when the connection comes back up again return:
pdFREERTOS_ERRNO_NONE 0 // No errors
or do I need to take additional actions? like perhaps halting the OTA agent thread upon a drop and resuming upon a connection.
Another possible approach could be to simply kill the OTA agent thread if the connection drops and restart it when the connection comes back up again. Eventually there will be a intermitting period which is long enough for a successful download, but that seems like a rather ugly way of doing it.