Function esp_idf_sys::httpd_ws_recv_frame
source ยท pub unsafe extern "C" fn httpd_ws_recv_frame(
req: *mut httpd_req_t,
pkt: *mut httpd_ws_frame_t,
max_len: usize,
) -> esp_err_t
Expand description
@brief Receive and parse a WebSocket frame
@note Calling httpd_ws_recv_frame() with max_len as 0 will give actual frame size in pkt->len. The user can dynamically allocate space for pkt->payload as per this length and call httpd_ws_recv_frame() again to get the actual data. Please refer to the corresponding example for usage.
@param[in] req Current request @param[out] pkt WebSocket packet @param[in] max_len Maximum length for receive @return
- ESP_OK : On successful
- ESP_FAIL : Socket errors occurs
- ESP_ERR_INVALID_STATE : Handshake was already done beforehand
- ESP_ERR_INVALID_ARG : Argument is invalid (null or non-WebSocket)