SockGetPeerName

The SockGetPeerName() call gets the name of the peer connected to a socket.

Syntax:

>>--SockGetPeerName(socket, address)-------------------------------------><

where:

socket

is the socket descriptor.

address

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:

ENOTSOCK

socket is not a valid socket descriptor.

ENOTCONN

socket is not connected.

ENOBUFS

There is no buffer space available.

Note: SockGetPeerName() interfaces with the C function getpeername().