Retrieves a socket option.

Synopsis

Declared in <folly/net/NetOps.h>

int
getsockopt(
    NetworkSocket s,
    int level,
    int optname,
    void* optval,
    socklen_t* optlen);

Return Value

0 on success, or ‐1 on error.

Parameters

Name

Description

s

The socket to query.

level

The protocol level of the option.

optname

The option name.

optval

Buffer that receives the option value.

optlen

In/out length of the value buffer.

Created with MrDocs