next up previous contents index
Next: GetSocketName Up: Functions and Procedures Previous: Connect

GetPeerName

   

Declaration:

Function GetPeerName (Sock:Longint;Var Addr;Var Addrlen:Longint) : Longint;

Description:

GetPeerName returns the name of the entity connected to the specified socket Sock. The Socket must be connected for this call to work. Addr should point to enough space to store the name, the amount of space pointed to should be set in Addrlen. When the function returns succesfully, Addr will be filled with the name, and Addrlen will be set to the length of Addr.

Errors:

Errors are reported in SocketError, and include the following:

SYS_EBADF
The socket descriptor is invalid.
SYS_ENOBUFS
The system doesn't have enough buffers to perform the operation.
SYS_ENOTSOCK
The descriptor is not a socket.
SYS_EFAULT
Addr points outside your address space.
SYS_ENOTCONN
The socket isn't connected.

See also:

Connect, Socket, connect (2)



Michael Van Canneyt
Thu Sep 10 13:59:33 CEST 1998