nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches

◆ nrf_cloud_rest_disconnect()

int nrf_cloud_rest_disconnect ( struct nrf_cloud_rest_context *const rest_ctx)

#include <include/net/nrf_cloud_rest.h>

Closes the connection to the server. The socket pointed to by rest_ctx.connect_socket will be closed, and rest_ctx.connect_socket will be set to -1.

Parameters
[in,out]rest_ctxContext for communicating with nRF Cloud's REST API.
Return values
0If successful. Otherwise, a (negative) error code is returned:
  • -EINVAL, if valid context is not given.
  • -ENOTCONN, if socket was already closed, or never opened.
  • -EIO, for any kind of socket-level closure failure.