Function anjay_get_socket_entries
Defined in File core.h
Function Documentation
-
AVS_LIST<const anjay_socket_entry_t> anjay_get_socket_entries(anjay_t *anjay)
Retrieves a list of structures that describe sockets used for communication with LwM2M servers. Returned list must not be freed nor modified.
The returned data is equivalent to the one that can be retrieved using anjay_get_sockets - but includes additional data that describes the socket in addition to the socket itself. See anjay_socket_entry_t for details.
NOTE: The returned list will be invalidated by any subsequent call to anjay_get_sockets or
anjay_get_socket_entries. If you need to call these functions from multiple threads, you need to implement additional synchronization to achieve thread safety.The socket object pointers themselves may additionally be invalidated by a call to anjay_sched_run, anjay_serve, anjay_serve_any or during the execution of anjay_event_loop_run or anjay_event_loop_run_with_error_handling . For this reason, it is recommended to only call this function from callback functions called from within Anjay, in scheduler jobs, or as part of a custom event loop.
- Parameters:
anjay – Anjay object to operate on.
- Returns:
A list of valid server socket entries on success, NULL when the device is not connected to any server.