MONGOC_SOCKET_SEND(3)
π MONGOC_SOCKET_SEND(3) β like, the libmongoc girlies' guide to yeeting bytes into the void
okay so bestie, welcome to mongoc_socket_send from libmongoc β this is the one where you shove some bytes at a socket and hope the universe cooperates. it's giving "send it and pray" but make it systems programming π«Ά
β¨ SYNOPSIS β¨
ssize_t
mongoc_socket_send (mongoc_socket_t *sock,
const void *buf,
size_t buflen,
int64_t expire_at);
πΈ PARAMETERS πΈ
sockβ amongoc_socket_t. the socket. the main character. the thing you're sending to. πbufβ a buffer to send. literally just the stuff you want to yeet out into the world πbuflenβ asize_tholding the number of bytes inbuf. yes, you have to tell it how big your vibe is, it's not psychic πexpire_atβ anint64_twith an absolute timeout for the operation, or0. the timeout is in monotonic time using microseconds. you can grab the current monotonic time with System Clock. ngl, absolute timeouts are a whole mood β it's a deadline, not a countdown β°
π¦ DESCRIPTION π¦
Sends buflen bytes in buf to the destination.
If a timeout expired, the number of bytes sent will be returned β or -1 if no bytes were sent. so like, you might get a partial send, you might get nothing. no cap, that's just how it is π
β RETURNS β
-1 on failure, and errno is set. otherwise, the number of bytes sent. periodt π
ok but fr fr β always check that return value.-1plus anerrnois the socket's way of telling you something went wrong, and it will tell you π
π§ AUTHOR π§
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
and that's the whole page, bestie, you ate π this was libmongoc version 2.5.6, dated Oct 09, 2026 β like the footer says, but cuter. mwah πβ¨
π¦ 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