ISocket.getsockoptVal

Calls getsockopt() to obtain the value of a socket option.

Notes: - The actual value data type T depends on the particular option. If the returned value differs from val.sizeof on success, the wrong type was used and val contains most likely junk. - T = bool is internally substituted by int and therefore suitable for flag options.

class ISocket
ssize_t
getsockoptVal
(
T
)
(
int level
,,
out T val
)

Parameters

level int

socket option level

optname int

socket option name

val T

value output

Return Value

Type: ssize_t

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

Meta