Sign in Join
FPDoc Onlineexperiment

fpgetpeername function

In unit Sockets

Return the name (address) of the connected peer.

Declaration

pascal
function fpgetpeername(s: cint; name: psockaddr; namelen: psocklen)
: cint

Description

fpGetPeerName returns the name of the entity connected to the specified socket S. The Socket must be connected for this call to work.

Name should point to enough space to store the name, the amount of space pointed to should be set in Namelen. When the function returns successfully, Name will be filled with the name, and Name will be set to the length of Name.

Errors

Errors are reported in SocketError, and include the following:

ESockEBADF
The socket descriptor is invalid.
ESockENOBUFS
The system doesn't have enough buffers to perform the operation.
ESockENOTSOCK
The descriptor is not a socket.
ESockEFAULT
Addr points outside your address space.
ESockENOTCONN
The socket isn't connected.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.