ISocket.getsockopt

Obtains the value of a socket option, writing the value data to dst.

Note: The actual value data type and length depends on the particular option. If the returned value is above dst.length, dst contains the first bytes of the truncated value. If the returned value is below dst.length on success, it indicates the number of bytes in dst written to.

class ISocket
ssize_t
getsockopt
(
int level
,,
void[] dst
)

Parameters

level int

socket option level

optname int

socket option name

dst void[]

value destination buffer

Return Value

Type: ssize_t

the actual value length on success or -1 on failure. On failure errno is set appropriately.

Errors: EBADF The argument sockfd is not a valid descriptor.

EFAULT dst is not in a valid part of the process address space.

ENOPROTOOPT The option is unknown at the level indicated.

ENOTSOCK The argument sockfd is a file, not a socket.

Meta