Function anjay_transport_schedule_reconnect

Function Documentation

int anjay_transport_schedule_reconnect(anjay_t *anjay, anjay_transport_set_t transport_set)

Reconnects sockets associated with all servers and ongoing downloads over the specified transports. Should be called if something related to the connectivity over those transports changes.

The reconnection will be performed during the next anjay_sched_run call and will trigger sending any messages necessary to maintain valid registration (DTLS session resumption and/or Register or Update operations).

In case of ongoing downloads (started via anjay_download or the fw_update module), if the reconnection fails, the download will be aborted with an error.

Note: This function puts all the transports in transport_set into online mode.

Parameters:
  • anjay – Anjay object to operate on.

  • transport_set – Set of transports whose sockets shall be reconnected.

Returns:

0 on success, a negative value in case of error.