Sign in Join
FPDoc Onlineexperiment

fpgetsockopt function

In unit Sockets

Get current socket options.

Declaration

pascal
function fpgetsockopt(s: cint; level: cint; optname: cint; 
 optval: pointer; optlen: psocklen): cint

Description

fpGetSockOpt gets the connection option optname, for socket S. The socket may be obtained from different levels, indicated by Level, which can be one of the following:

SOL_SOCKET
From the socket itself.
XXX
set Level to XXX, the protocol number of the protocol which should interpret the option.

The options are stored in the memory location pointed to by optval. optlen should point to the initial length of optval, and on return will contain the actual length of the stored data.

On success, 0 is returned. On Error, -1 is returned.

Errors

Errors are reported in SocketError, and include the following:

ESockEBADF
The socket descriptor is invalid.
ESockENOTSOCK
The descriptor is not a socket.
ESockEFAULT
OptVal points outside your address space.

See also

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