tor-browser

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

pr_sendto.rst (1256B)


      1 PR_SendTo
      2 =========
      3 
      4 Sends bytes a socket to a specified destination.
      5 
      6 
      7 Syntax
      8 ------
      9 
     10 .. code::
     11 
     12   #include <prio.h>
     13 
     14   PRInt32 PR_SendTo(
     15     PRFileDesc *fd,
     16     const void *buf,
     17     PRInt32 amount,
     18     PRIntn flags,
     19     const PRNetAddr *addr,
     20     PRIntervalTime timeout);
     21 
     22 
     23 Parameters
     24 ~~~~~~~~~~
     25 
     26 The function has the following parameters:
     27 
     28 ``fd``
     29   A pointer to a :ref:`PRFileDesc` object representing a socket.
     30 ``buf``
     31   A pointer to a buffer containing the data to be sent.
     32 ``amount``
     33   The size of ``buf`` (in bytes).
     34 ``flags``
     35   This obsolete parameter must always be zero.
     36 ``addr``
     37   A pointer to the address of the destination.
     38 ``timeout``
     39   A value of type :ref:`PRIntervalTime` specifying the time limit for
     40   completion of the receive operation.
     41 
     42 
     43 Returns
     44 ~~~~~~~
     45 
     46 The function returns one of the following values:
     47 
     48 -  A positive number indicates the number of bytes successfully sent.
     49 -  The value -1 indicates a failure. The reason for the failure can be
     50   obtained by calling :ref:`PR_GetError`.
     51 
     52 
     53 Description
     54 -----------
     55 
     56 :ref:`PR_SendTo` sends a specified number of bytes from a socket to the
     57 specified destination address. The calling thread blocks until all bytes
     58 are sent, a timeout has occurred, or there is an error.