TCPSocket(3)

πŸ“¦ version 2.3.1, in fedora 43, fedora 44

πŸ’– TCPSocket πŸ’–

okay bestie, welcome to the TCPSocket page from the Library Functions Manual β€” yes it's a C++ class, yes it's giving networking main character energy, and yes we're gonna go through every single line together because nothing gets skipped around here, periodt. πŸŽ€


✨ NAME ✨

TCPSocket β€” that's it, that's the name, she's literally just her. πŸ’…


🌸 SYNOPSIS 🌸

Inherited by TCPIOSocket, and TCPServerSocket.

so like… this girl is a base class. she's the blueprint, the blueprint-iest blueprint, and TCPIOSocket and TCPServerSocket are her daughters who inherited everything from her. nepo babies? no bestie, legacy babies. πŸ‘‘

πŸ¦‹ Public Member Functions πŸ¦‹

void create ()
void bind (u_int16_t port_begin, u_int16_t port_fence)
int port ()
u_int32_t addr ()
bool initialized ()
bool bound ()
virtual void close ()

these are the public ones, meaning everyone can call them, no gatekeeping here, we're an open-invite class:

  • void create () β€” makes the socket happen. it's giving ✨manifestation✨ but for file descriptors.
  • void bind (u_int16_t port_begin, u_int16_t port_fence) β€” takes a port_begin and a port_fence, both u_int16_t, and binds. fence = the end of the range, bestie, we're picking a port from between them. 🎯
  • int port () β€” hands you back the port as an int. simple. clean. iconic.
  • u_int32_t addr () β€” returns the address as a u_int32_t. note it's not an int, it's a u_int32_t, respect the type bestie, she's specific. πŸ’œ
  • bool initialized () β€” true/false, is she initialized or is she just a girl standing in front of a socket? 🫢
  • bool bound () β€” true/false, has she been bound yet. vibe check, but for binding status. 🌈
  • virtual void close () β€” the goodbye one. it's virtual, so subclasses get to override how they say bye. no cap. 😭

🧚 Protected Attributes 🧚

int socket_
int port_
bool initialized_
bool bound_

protected means family only, bestie β€” not for the outside world, just for this class and her descendants:

  • int socket_ β€” the actual socket, stored as an int. the whole point of the whole thing. the moment. πŸ’€
  • int port_ β€” the port, also an int. note the little trailing underscore, that's her ~private name~, don't come for her. πŸŽ€
  • bool initialized_ β€” the flag tracking whether initialized() is gonna return true or false. it's the source of truth, fr fr.
  • bool bound_ β€” same deal, but for bound(). the real one behind the curtain. πŸ¦‹

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for MPQC from the source code.

so like, no human wrote this by hand bestie, Doxygen just read the source code and produced the page. respect the automation, honestly she ate. ✨

okay that's the whole page, we did it, we read every single line together and no detail was harmed in the making of this rewrite. πŸ’– stay bound, stay initialized, and remember: close() your sockets, bestie. 🫢

MPQC Β· Version 2.3.1 Β· TCPSocket(3) β€” mwah, that's a wrap, ily, bye!! πŸŽ€πŸ¦‹πŸ’…

πŸ“¦ where this page comes from