Commit graph

6 commits

Author SHA1 Message Date
Davidson Francis
ca403d815d
Update docs/examples/websocket.c
Co-authored-by: Viktor Szakats <vszakats@users.noreply.github.com>
2025-04-18 21:33:52 -03:00
Davidson Francis
a8e2dd54c2
Update docs/examples/websocket.c
Co-authored-by: Viktor Szakats <vszakats@users.noreply.github.com>
2025-02-08 16:34:56 -03:00
Davidson Francis
e8d0cd0e95 examples/websocket.c: check for CURLE_AGAIN on recv_pong()
The example file docs/examples/websocket.c does not work out of the
box, because the recv_pong() function does not consider that the
curl_ws_recv() function might return CURLE_AGAIN if there is no data
to read, causing the program to terminate prematurely.

This commit addresses this by using select(2) to make receiving pong
blocking, and thus being able to continue with the main loop.

This also occurs in the example file sendrecv.c, which also makes use
of select(2) for sending and receiving data, which I based on for
this commit.
2024-06-03 11:36:49 -03:00
Dave Cottlehuber
a86fcb284f
ws: fix spelling mistakes in examples and tests
Closes #11784
2023-09-03 18:01:58 +02:00
Daniel Stenberg
78886afb50
ws: make the curl_ws_meta() return pointer a const
The returned info is read-only for the user.

Closes #11261
2023-06-07 23:37:21 +02:00
Daniel Stenberg
e812473d1e
examples/websocket.c: websocket example using CONNECT_ONLY
Closes #11262
2023-06-07 14:56:02 +02:00