The SockGetPeerName() call gets the name of the peer connected to a socket.
Syntax:
>>--SockGetPeerName(socket, address)-------------------------------------><
where:
is the socket descriptor.
is a stem variable that will contain the address of the peer connected to socket.
Return values:
The value 0 indicates successful execution of the call. The value -1 indicates an error. You can get the specific error code by calling SockSock_Errno() or SockPSock_Errno(). Possible values are:
socket is not a valid socket descriptor.
socket is not connected.
There is no buffer space available.
Note: SockGetPeerName() interfaces with the C function getpeername().