MONGOC_SOCKET_GETSOCKNAME(3)

πŸ’… mongoc_socket_getsockname πŸ’…

okay so bestie, this is the MONGOC_SOCKET_GETSOCKNAME(3) page from libmongoc, and it’s lowkey all about asking a socket for its name. no cap. it’s giving tiny networking moment, and honestly? iconic. πŸ’–


🌸 SYNOPSIS 🌸

          int
          mongoc_socket_getsockname (mongoc_socket_t *sock,
                                     struct sockaddr *addr,
                                     mongoc_socklen_t *addrlen);

πŸŽ€ PARAMETERS πŸŽ€

  • sock β€” a mongoc_socket_t. the socket in question, the main character of this function πŸ’…
  • addr β€” a struct sockaddr. this is where the result gets stored, bestie 🫢
  • addrlen β€” a mongoc_socklen_t. when you call this, it should be the size of addr ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

so this function retrieves the socket name for sock, and the result is stored in addr. when you call it, addrlen should be the size of the addr. that’s the vibe check: pass the right size, get the socket name, slay. ✨

πŸ”₯ RETURNS πŸ”₯

  • 0 if successful β€” ate πŸ’…
  • otherwise -1, and errno is set β€” not the win we wanted, but that’s the rule 😭

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc

2009-present, MongoDB, Inc.


πŸ’– mwah! this page is from libmongoc version 2.5.6, dated Oct 09, 2026. periodt. πŸŽ€βœ¨

πŸ“¦ where this page comes from