---
name: "mongoc_client_set_stream_initiator"
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_client_set_stream_initiator"
---

# mongoc\_client\_set\_stream\_initiator(3)

## SYNOPSIS

```
void
mongoc_client_set_stream_initiator (mongoc_client_t *client,
                                    mongoc_stream_initiator_t initiator,
                                    void *user_data);
```

The *mongoc\_client\_set\_stream\_initiator()* function shall associate a given *mongoc\_client\_t* with a new stream initiator. This will completely replace the default transport (buffered TCP, possibly with TLS). The **initiator** should fulfill the *mongoc\_stream\_t* contract. **user\_data** is passed through to the **initiator** callback and may be used for whatever run time customization is necessary.

If **user\_data** is passed, it is the application's responsibility to ensure **user\_data** remains valid for the lifetime of the client.

## PARAMETERS

- •

  **client**: A *mongoc\_client\_t*.

- •

  **initiator**: A *mongoc\_stream\_initiator\_t*.

- •

  **user\_data**: User supplied pointer for callback function.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
