pr_getpeername.rst (581B)
1 PR_GetPeerName 2 ============== 3 4 Gets the network address of the connected peer. 5 6 7 Syntax 8 ------ 9 10 .. code:: 11 12 #include <prio.h> 13 14 PRStatus PR_GetPeerName( 15 PRFileDesc *fd, 16 PRNetAddr *addr); 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 socket. 26 ``addr`` 27 On return, the address of the peer connected to the socket. 28 29 30 Returns 31 ~~~~~~~ 32 33 - If successful, ``PR_SUCCESS``. 34 - If unsuccessful, ``PR_FAILURE``. The reason for the failure can be 35 obtained by calling :ref:`PR_GetError`.