tor-browser

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

pr_connectcontinue.rst (1425B)


      1 PR_ConnectContinue
      2 ==================
      3 
      4 
      5 Syntax
      6 ------
      7 
      8 .. code::
      9 
     10   #include <prio.h>
     11 
     12   PRStatus PR_ConnectContinue(
     13     PRFileDesc *fd,
     14     PRInt16 out_flags);
     15 
     16 
     17 Parameters
     18 ~~~~~~~~~~
     19 
     20 The function has the following parameters:
     21 
     22 ``fd``
     23   A pointer to a :ref:`PRFileDesc` object representing a socket.
     24 
     25 ``out_flags``
     26   The out_flags field of the poll descriptor returned by
     27   `PR_Poll() <PR_Poll>`__.
     28 
     29 
     30 Returns
     31 ~~~~~~~
     32 
     33 -  If the nonblocking connect has successfully completed,
     34   PR_ConnectContinue returns PR_SUCCESS.
     35 -  If PR_ConnectContinue() returns PR_FAILURE, call PR_GetError():
     36 - PR_IN_PROGRESS_ERROR: the nonblocking connect is still in
     37   progress and has not completed yet. The caller should poll the file
     38   descriptor for the in_flags PR_POLL_WRITE|PR_POLL_EXCEPT and retry
     39   PR_ConnectContinue later when PR_Poll() returns.
     40 - Other errors: the nonblocking connect has failed with this
     41   error code.
     42 
     43 
     44 Description
     45 -----------
     46 
     47 Continue a nonblocking connect. After a nonblocking connect is initiated
     48 with PR_Connect() (which fails with PR_IN_PROGRESS_ERROR), one should
     49 call PR_Poll() on the socket, with the in_flags PR_POLL_WRITE \|
     50 PR_POLL_EXCEPT. When PR_Poll() returns, one calls PR_ConnectContinue()
     51 on the socket to determine whether the nonblocking connect has completed
     52 or is still in progress. Repeat the PR_Poll(), PR_ConnectContinue()
     53 sequence until the nonblocking connect has completed.