MONGOC_CLIENT...OCKETTIMEOUTMS(3)

πŸ’… MONGOC_CLIENT_SET_SOCKETTIMEOUTMS πŸ’…

okay so this is a page from libmongoc (section 3 of the manual, iykyk) and it's literally just one tiny function that changes how long your client waits on a socket before it's like "bestie... hello??" 🫢


✨ SYNOPSIS ✨

void
mongoc_client_set_sockettimeoutms (mongoc_client_t *client, int32_t timeoutms);

not me showing you the whole entire signature like it's a fit check πŸ’… β€” that's it, that's the vibe, no cap.


🌸 DESCRIPTION 🌸

So the whole gig here is: it changes the sockettimeoutms of the mongoc_client_t. That's the assignment, that's the whole plot, main character energy fr fr ✨

But here's the part you actually need to clock, bestie πŸ‘€ β€” if client was obtained from a mongoc_client_pool_t, then the socket timeout gets restored to the previous value when you call mongoc_client_pool_push(). so like, your cute little change doesn't stick around forever if the client came from a pool. it goes back to how it was. the pool said "not on my watch" 😭 that's just how it is, no drama.


πŸŽ€ PARAMETERS πŸŽ€

  • client β€” a mongoc_client_t. the client in question. the one and only. give it a glow-up πŸ’–
  • timeoutms β€” the requested timeout value in milliseconds. yes, milliseconds, so do your math carefully bestie, don't come at me with seconds 🫢

πŸ¦‹ SEE ALSO πŸ¦‹

URI Connection Options β€” go read that one too, it's giving essential lore πŸ“


πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” the icons behind all of this πŸŽ€


2009-present, MongoDB, Inc. β€” that's the whole copyright line, screenshot it, put it on your wall πŸ’œ


so yeah. version 2.5.6, dated Oct 09, 2026, from our friends at MongoDB, Inc β€” slay, periodt, and remember: when the pool takes the client back, the timeout resets. that's the tea 🧚✨πŸ”₯

πŸ“¦ where this page comes from