MONGOC_STREAM_SETSOCKOPT(3)
π¦ MONGOC_STREAM_SETSOCKOPT(3) π¦
okay so bestie, you're in the libmongoc section 3 manual and today's main character is mongoc_stream_setsockopt() β literally the little bridge between your stream and the socket options you wanna set. it's giving "middle management but make it cute" π
β¨ SYNOPSIS β¨
int
mongoc_stream_setsockopt (mongoc_stream_t *stream,
int level,
int optname,
void *optval,
mongoc_socklen_t optlen);
π PARAMETERS π
streamβ amongoc_stream_t. this is the stream we're messing with, bestie π«Άlevelβ the level you'd pass tosetsockopt(). yes, exactly that one, no cap.optnameβ the optname you'd pass tosetsockopt(). matching set, love that for us βoptvalβ the optval you'd pass tosetsockopt(). it's avoid *, so behave πoptlenβ the optlen you'd pass tosetsockopt(). it's amongoc_socklen_t, keep the types straight π
so like, the whole vibe here: this function is a wrapper around setsockopt() for streams that wrap sockets. that's the entire lore. if your stream is a socket-in-a-trenchcoat, this is how you poke at its socket options πΈ
π₯ RETURNS π₯
0 on success β slay, we love a clean zero π
otherwise -1 and errno is set. yeah, it's giving error handling, check your errno fr fr π
π AUTHOR π
MongoDB, Inc β iconic, we stan π«Ά
π COPYRIGHT π
2009-present, MongoDB, Inc. β the whole run, no gaps, periodt π
and that's the page bestie!! β¨ signed off from libmongoc version 2.5.6, dated Oct 09, 2026 β go forth and set those sockopts responsibly π§π
π¦ 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