---
name: "mongoc_socket_accept"
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_socket_accept"
---

# mongoc\_socket\_accept(3)

## SYNOPSIS

```
mongoc_socket_t *
mongoc_socket_accept (mongoc_socket_t *sock,
                      int64_t expire_at);
```

## PARAMETERS

- •

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

- •

  **expire\_at**: An int64\_t containing a timeout in milliseconds.

## DESCRIPTION

This function is a wrapper around the BSD socket **accept()** interface. It allows for more portability between UNIX-like and Microsoft Windows platforms.

## RETURNS

NULL upon failure to accept or timeout. A newly allocated **mongoc\_socket\_t** that should be released with *mongoc\_socket\_destroy()* on success.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
