2022-09-09 21:11:14 +08:00
|
|
|
.\" **************************************************************************
|
|
|
|
.\" * _ _ ____ _
|
|
|
|
.\" * Project ___| | | | _ \| |
|
|
|
|
.\" * / __| | | | |_) | |
|
|
|
|
.\" * | (__| |_| | _ <| |___
|
|
|
|
.\" * \___|\___/|_| \_\_____|
|
|
|
|
.\" *
|
|
|
|
.\" * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
|
|
|
|
.\" *
|
|
|
|
.\" * This software is licensed as described in the file COPYING, which
|
|
|
|
.\" * you should have received as part of this distribution. The terms
|
|
|
|
.\" * are also available at https://curl.se/docs/copyright.html.
|
|
|
|
.\" *
|
|
|
|
.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
.\" * copies of the Software, and permit persons to whom the Software is
|
|
|
|
.\" * furnished to do so, under the terms of the COPYING file.
|
|
|
|
.\" *
|
|
|
|
.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
.\" * KIND, either express or implied.
|
|
|
|
.\" *
|
|
|
|
.\" * SPDX-License-Identifier: curl
|
|
|
|
.\" *
|
|
|
|
.\" **************************************************************************
|
|
|
|
.\"
|
|
|
|
.TH curl_ws_recv 3 "12 Jun 2022" "libcurl 7.85.0" "libcurl Manual"
|
|
|
|
.SH NAME
|
2022-09-13 15:17:53 +08:00
|
|
|
curl_ws_recv - receive WebSocket data
|
2022-09-09 21:11:14 +08:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
#include <curl/easy.h>
|
|
|
|
|
|
|
|
CURLcode curl_ws_recv(CURL *curl, void *buffer, size_t buflen,
|
2022-09-11 05:36:49 +08:00
|
|
|
size_t *recv, unsigned int *recvflags);
|
2022-09-09 21:11:14 +08:00
|
|
|
.fi
|
|
|
|
.SH DESCRIPTION
|
|
|
|
This function call is EXPERIMENTAL.
|
|
|
|
|
2022-09-13 15:17:53 +08:00
|
|
|
Retrives as much as possible of a received WebSocket data fragment into the
|
2022-09-09 21:11:14 +08:00
|
|
|
\fBbuffer\fP, but not more than \fBbuflen\fP bytes. The provide
|
|
|
|
\fIrecvflags\fP argument gets bits set to help characterize the fragment.
|
2022-09-09 21:36:06 +08:00
|
|
|
.SH RECVFLAGS
|
2022-09-09 21:11:14 +08:00
|
|
|
.IP CURLWS_TEXT
|
2022-09-13 15:17:53 +08:00
|
|
|
The buffer contains text data. Note that this makes a difference to WebSocket
|
2022-09-09 21:11:14 +08:00
|
|
|
but libcurl itself will not make any verification of the content or
|
|
|
|
precautions that you actually receive valid UTF-8 content.
|
|
|
|
.IP CURLWS_BINARY
|
|
|
|
This is binary data.
|
|
|
|
.IP CURLWS_FINAL
|
|
|
|
This is the final fragment of the message, if this is not set, it implies that
|
|
|
|
there will be another fragment coming as part of the same message.
|
|
|
|
.IP CURLWS_CLOSE
|
|
|
|
This transfer is now closed.
|
|
|
|
.IP CURLWS_PING
|
|
|
|
This as an incoming ping message, that expects a pong response.
|
|
|
|
.SH EXAMPLE
|
|
|
|
.nf
|
|
|
|
|
|
|
|
.fi
|
|
|
|
.SH AVAILABILITY
|
2022-09-09 21:36:06 +08:00
|
|
|
Added in 7.86.0.
|
2022-09-09 21:11:14 +08:00
|
|
|
.SH RETURN VALUE
|
|
|
|
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR curl_easy_setopt "(3), " curl_easy_perform "(3), "
|
|
|
|
.BR curl_easy_getinfo "(3), "
|
|
|
|
.BR curl_ws_send "(3) "
|