---
name: "mongoc_stream_socket_new"
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_socket_new"
---

# mongoc\_stream\_socket\_new(3)

## SYNOPSIS

```
mongoc_stream_t *
mongoc_stream_socket_new (mongoc_socket_t *socket);
```

## PARAMETERS

- •

  **socket**: A *mongoc\_socket\_t*.

Creates a new *mongoc\_stream\_socket\_t* using the *mongoc\_socket\_t* provided.

**WARNING:**

This function transfers ownership of **socket** to the newly allocated stream.

## RETURNS

A newly allocated *mongoc\_stream\_socket\_t* that should be freed with *mongoc\_stream\_destroy()* when no longer in use.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
