[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'Sockets' (#rtl)

fpgetsockopt

Get current socket options

Declaration

Source position: socketsh.inc line 173

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:

SYS_EBADF
The socket descriptor is invalid.
SYS_ENOTSOCK
The descriptor is not a socket.
SYS_EFAULT
OptVal points outside your address space.

See also

fpSetSockOpt

  

Set socket options.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.