---
name: "mongoc_stream_setsockopt"
section: "3"
platform: "linux"
package: "libmongoc-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mongoc_stream_setsockopt"
---

# mongoc\_stream\_setsockopt(3)

## SYNOPSIS

```
int
mongoc_stream_setsockopt (mongoc_stream_t *stream,
                          int level,
                          int optname,
                          void *optval,
                          mongoc_socklen_t optlen);
```

## PARAMETERS

- •

  **stream**: A *mongoc\_stream\_t*.

- •

  **level**: The level to pass to **setsockopt()**.

- •

  **optname**: The optname to pass to **setsockopt()**.

- •

  **optval**: The optval to pass to **setsockopt()**.

- •

  **optlen**: The optlen to pass to **setsockopt()**.

This function is a wrapper around **setsockopt()** for streams that wrap sockets.

## RETURNS

**0** on success, otherwise **-1** and **errno** is set.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
