Debian Codegraph @

doc/docstrings/curl_recv.rst

raw
1 recv(buffersize) -> data
2
3 Receive data from a connection established with ``CONNECT_ONLY``.
4
5 Receive up to *buffersize* bytes and return them as a ``bytes`` object.
6 A returned empty ``bytes`` object indicates that the peer has closed the
7 connection.
8
9 Raises ``ValueError`` if *buffersize* is negative.
10
11 Corresponds to `curl_easy_recv`_ in libcurl.
12
13 Because the underlying socket is used in non-blocking mode internally,
14 this method raises ``BlockingIOError`` with ``errno`` set to ``EAGAIN``
15 when libcurl returns ``CURLE_AGAIN``.
16
17 Raises pycurl.error exception upon failures other than ``CURLE_AGAIN``.
18
19 .. _curl_easy_recv: https://curl.se/libcurl/c/curl_easy_recv.html