curl_ws_recv.3 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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, unsigned int *flags);
  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. The provide
  38. \fIflags\fP argument gets bits set to help characterize the fragment.
  39. .SH FLAGS
  40. .IP CURLWS_TEXT
  41. The buffer contains text data. Note that this makes a difference to WebSocket
  42. but libcurl itself will not make any verification of the content or
  43. precautions that you actually receive valid UTF-8 content.
  44. .IP CURLWS_BINARY
  45. This is binary data.
  46. .IP CURLWS_CONT
  47. This is not the final fragment of the message, it implies that there will be
  48. another fragment coming as part of the same message.
  49. .IP CURLWS_CLOSE
  50. This transfer is now closed.
  51. .IP CURLWS_PING
  52. This as an incoming ping message, that expects a pong response.
  53. .SH EXAMPLE
  54. .nf
  55. .fi
  56. .SH AVAILABILITY
  57. Added in 7.86.0.
  58. .SH RETURN VALUE
  59. .SH "SEE ALSO"
  60. .BR curl_easy_setopt "(3), " curl_easy_perform "(3), "
  61. .BR curl_easy_getinfo "(3), "
  62. .BR curl_ws_send "(3) "