Function anjay_download_reconnect

Function Documentation

int anjay_download_reconnect(anjay_t *anjay, anjay_download_handle_t dl_handle)

Reconnects a download identified by dl_handle while retaining the download progress.

If the download has been previously suspended using anjay_download_suspend, it will be resumed. If the download is suspended due to the transport being offline (see anjay_transport_set_online), no immediate action is performed, but the suspended state as per anjay_download_suspend will be cleared.

This function only schedules the actual reconnect operation. The socket will be actually reconnected during subsequent calls to anjay_sched_run.

Parameters:
  • anjay – Anjay object managing the download process.

  • dl_handle – Download handle previously returned by anjay_download.

Returns:

0 for success; -1 if dl_handle does not represent a valid download handle, or if the reconnect job could not be scheduled (e.g. due to an out-of-memory condition).