Function esp_idf_svc::sys::httpd_req_to_sockfd

source ยท
pub unsafe extern "C" fn httpd_req_to_sockfd(r: *mut httpd_req) -> i32
Expand description

@brief Get the Socket Descriptor from the HTTP request

This API will return the socket descriptor of the session for which URI handler was executed on reception of HTTP request. This is useful when user wants to call functions that require session socket fd, from within a URI handler, ie. : httpd_sess_get_ctx(), httpd_sess_trigger_close(), httpd_sess_update_lru_counter().

@note This API is supposed to be called only from the context of a URI handler where httpd_req_t* request pointer is valid.

@param[in] r The request whose socket descriptor should be found

@return

  • Socket descriptor : The socket descriptor for this request
  • -1 : Invalid/NULL request pointer