Function anjay_schedule_register
Defined in File core.h
Function Documentation
-
int anjay_schedule_register(anjay_t *anjay, anjay_ssid_t ssid)
Schedules sending a Register message to the server identified by given Short Server ID.
For currently connected servers, the Register message will be sent during the next anjay_sched_run call, without reconnecting (and thus without a new DTLS handshake, if applicable). Please additionally call anjay_server_schedule_reconnect before or after this function (without running anjay_sched_run in between - so in multi-threaded applications you may need to do that from within an intermediary scheduler job) if you want to force a reconnect.
For servers that are disabled or in a failure state, this function will invalidate the registration state, so that a new Register message will definitely be sent once the server is re-enabled (even if the DTLS session is successfully resumed), but will not re-enable it itself. Please additionally call anjay_enable_server before or after this funciton if you want the server reactivated immediately.
Note: This function will not change the offline state of the server’s transport.
- Parameters:
anjay – Anjay object to operate on.
ssid – Short Server ID of the server to send Register to or ANJAY_SSID_ANY to send Register to all known servers. NOTE: Since Register is not useful for the Bootstrap Server, this function does not send one for ANJAY_SSID_BOOTSTRAP
ssid.
- Returns:
0 on success, a negative value in case of error.