MONGOC_SOCKET_RECV(3)
π MONGOC_SOCKET_RECV(3) π
okay so bestie, this is a page from libmongoc (yes, that libmongoc π) and we're about to learn how mongoc_socket_recv scoops bytes out of a socket. it's giving "low-level but make it cute". stay with me π«Ά
β¨ SYNOPSIS β¨
ssize_t
mongoc_socket_recv (mongoc_socket_t *sock,
void *buf,
size_t buflen,
int flags,
int64_t expire_at);
look at that signature. five whole arguments. she's committed π
π PARAMETERS π
sockβ amongoc_socket_t. like, the actual socket we're reading from. main character energy fr.bufβ a buffer to read into. this is where the bytes go to live πbuflenβ asize_twith the number of bytes to receive. i.e. how much room you're giving her.flagsβ flags forrecv(). the usual suspects, passed straight through, no notes.expire_atβ aint64_twith the time to expire, in monotonic time using the System Clock, which is in microseconds. yes microseconds. not milliseconds. not seconds. microseconds. iykyk β°
π¦ DESCRIPTION π¦
okay so what does she actually do? literally this: mongoc_socket_recv performs a recv() on the underlying socket. that's it. that's the whole vibe. no extra lore, no secret sauce β it's a recv() wrapped in mongoc's little jacket πΈ
π RETURNS π
- the number of bytes received on success π
0when the stream is closed (she's gone, respect the closure π)-1if there was a failure β and heads up, when that happenserrnois set, so go check it π
π AUTHOR π
MongoDB, Inc. slay.
β COPYRIGHT β
2009-present, MongoDB, Inc.
friendly reminder bestie:-1means failure, anderrnois set. don't ignore her. she's telling you something π
okay that's the page!! written by the legends at MongoDB, Inc, version 2.5.6, dated Oct 09, 2026 β mwah, no cap, periodt ππ§ββοΈ
π¦ where this page comes from
- epel 10: mongo-c-driver-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms