Provided by: libmongoc-doc_2.2.1-1_all 

SYNOPSIS
ssize_t
mongoc_socket_recv (mongoc_socket_t *sock,
void *buf,
size_t buflen,
int flags,
int64_t expire_at);
PARAMETERS
• sock: A mongoc_socket_t <>.
• buf: A buffer to read into.
• buflen: A size_t with the number of bytes to receive.
• flags: flags for recv().
• expire_at: A int64_t with the time to expire in monotonic time using System Clock <https://www.mongoc
.org/libbson/current/bson_get_monotonic_time.html>, which is in microseconds.
DESCRIPTION
This function performs a recv() on the underlying socket.
RETURNS
The number of bytes received on success, 0 on stream closed, and -1 if there was a failure and errno is
set.
Author
MongoDB, Inc
Copyright
2009-present, MongoDB, Inc.
2.2.1 Dec 11, 2025 MONGOC_SOCKET_RECV(3)