curl_ws_recv.3 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .\"
  25. .TH curl_ws_recv 3 "12 Jun 2022" "libcurl 7.85.0" "libcurl Manual"
  26. .SH NAME
  27. curl_ws_recv - receive WebSocket data
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/easy.h>
  31. CURLcode curl_ws_recv(CURL *curl, void *buffer, size_t buflen,
  32. size_t *recv, struct curl_ws_frame **meta);
  33. .fi
  34. .SH DESCRIPTION
  35. This function call is EXPERIMENTAL.
  36. Retrieves as much as possible of a received WebSocket data fragment into the
  37. \fBbuffer\fP, but not more than \fBbuflen\fP bytes. \fIrecv\fP is set to the
  38. number of bytes actually stored.
  39. If there is more fragment data to deliver than what fits in the provided
  40. \fIbuffer\fP, libcurl returns a full buffer and the application needs to call
  41. this function again to continue draining the buffer.
  42. The \fImeta\fP pointer gets set to point to a \fIstruct curl_ws_frame\fP that
  43. contains information about the received data. See the \fIcurl_ws_meta(3)\fP
  44. for details on that struct.
  45. .SH EXAMPLE
  46. .nf
  47. .fi
  48. .SH AVAILABILITY
  49. Added in 7.86.0.
  50. .SH RETURN VALUE
  51. .SH "SEE ALSO"
  52. .BR curl_easy_setopt "(3), " curl_easy_perform "(3), "
  53. .BR curl_easy_getinfo "(3), "
  54. .BR curl_ws_send "(3) "