tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

pr_shutdown.rst (1153B)


      1 PR_Shutdown
      2 ===========
      3 
      4 Shuts down part of a full-duplex connection on a specified socket.
      5 
      6 
      7 Syntax
      8 ------
      9 
     10 .. code::
     11 
     12   #include <prio.h>
     13 
     14   PRStatus PR_Shutdown(
     15     PRFileDesc *fd,
     16     PRShutdownHow how);
     17 
     18 
     19 Parameters
     20 ~~~~~~~~~~
     21 
     22 The function has the following parameters:
     23 
     24 ``fd``
     25   A pointer to a :ref:`PRFileDesc` object representing a connected socket.
     26 ``how``
     27   The kind of disallowed operations on the socket. Possible values
     28   include the following:
     29 
     30    - :ref:`PR_SHUTDOWN_RCV`. Further receives will be disallowed.
     31    - :ref:`PR_SHUTDOWN_SEND`. Further sends will be disallowed.
     32    - :ref:`PR_SHUTDOWN_BOTH`. Further sends and receives will be
     33      disallowed.
     34 
     35 
     36 Returns
     37 ~~~~~~~
     38 
     39 The function returns one of the following values:
     40 
     41 -  Upon successful completion of shutdown request, ``PR_SUCCESS``.
     42 -  If unsuccessful, ``PR_FAILURE``. Further information can be obtained
     43   by calling :ref:`PR_GetError`.
     44 
     45 
     46 Description
     47 -----------
     48 
     49 The ``PRShutdownHow`` enumeration is defined as follows:
     50 
     51 .. code::
     52 
     53   typedef enum PRShutdownHow{
     54     PR_SHUTDOWN_RCV = 0,
     55     PR_SHUTDOWN_SEND = 1,
     56     PR_SHUTDOWN_BOTH = 2
     57   } PRShutdownHow;