ost::UnixSession(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸ’… ost::UnixSession β€” from the Library Functions Manual girlies πŸŽ€

okay bestie, sit down, grab a strawberry drink πŸ“, because we're doing ost::UnixSession and it's genuinely such a vibe. this is a section 3 page (library functions, iykyk) and it's giving "threaded socket realness" ✨


✨ NAME ✨

ost::UnixSession β€” the Unix domain session is used to primarily to represent a client connection that can be managed on a separate thread.

like. it's a socket. it's a thread. it's both. main character energy fr fr πŸ’…


🌸 SYNOPSIS 🌸

#include <unix.h>

Inherits ost::Thread, and ost::UnixStream. yes queen, it's got two whole parents, it's a nepo baby and we love that for it 🫢

πŸ’– Public Member Functions πŸ’–

  • UnixSession (const char *pathname, int size=512, int pri=0, int stack=0) β€” Create a Unix domain socket that will be connected to a local server server and that will execute under it's own thread.
  • UnixSession (UnixSocket &server, int size=512, int pri=0, int stack=0) β€” Create a Unix domain socket from a bound Unix domain server by accepting a pending connection from that server and execute a thread for the accepted connection.
  • virtual ~UnixSession () β€” Virtual destructor. she leaves gracefully, no drama πŸ’€

πŸ¦‹ Protected Member Functions πŸ¦‹

  • int waitConnection (timeout_t timeout=TIMEOUT_INF) β€” Normally called during the thread Initial() method by default, this will wait for the socket connection to complete when connecting to a remote socket.
  • void initial (void) β€” The initial method is used to esablish a connection when delayed completion is used.

🌈 Additional Inherited Members 🌈

there's a whole section literally called Additional Inherited Members and bestie… the docs left it empty. it's the void. it's giving mystery. we simply do not know πŸ‘‘ (this page says nothing else about it, so neither will I, no cap)


πŸ’œ DETAILED DESCRIPTION πŸ’œ

The Unix domain session is used to primarily to represent a client connection that can be managed on a separate thread.

The Unix domain session also supports a non-blocking connection scheme which prevents blocking during the constructor and moving the process of completing a connection into the thread that executes for the session.

so basically: the constructor doesn't sit there waiting for a connection like 😭 it hands that job off to the session's own thread. constructor stays cute, connection finishes in the background. iconic.

🌟 Author 🌟

Alex Pavloff alex@pavloff.net

🧚 Brief description, the tl;dr of tl;drs 🧚

Threaded streamable unix domain socket with non-blocking constructor.


πŸŽ€ Constructor & Destructor Documentation πŸŽ€

⭐ ost::UnixSession::UnixSession (const char * pathname, int size = 512, int pri = 0, int stack = 0)

Create a Unix domain socket that will be connected to a local server server and that will execute under it's own thread.

Parameters

  • pathname β€” path to socket
  • size β€” of streaming buffer.
  • pri β€” execution priority relative to parent.
  • stack β€” allocation needed on some platforms.

⭐ ost::UnixSession::UnixSession (UnixSocket & server, int size = 512, int pri = 0, int stack = 0)

Create a Unix domain socket from a bound Unix domain server by accepting a pending connection from that server and execute a thread for the accepted connection.

Parameters

  • server β€” unix domain socket to accept a connection from.
  • size β€” of streaming buffer.
  • pri β€” execution priority relative to parent.
  • stack β€” allocation needed on some platforms.

⭐ virtual ost::UnixSession::~UnixSession () [virtual]

Virtual destructor. that's it. that's the whole description. short queen, we respect the minimalism πŸ’…


🫢 Member Function Documentation 🫢

🌸 void ost::UnixSession::initial (void) [protected], [virtual]

The initial method is used to esablish a connection when delayed completion is used. This assures the constructor terminates without having to wait for a connection request to complete.

Reimplemented from ost::Thread.


🌸 int ost::UnixSession::waitConnection (timeout_t timeout = TIMEOUT_INF) [protected]

Normally called during the thread Initial() method by default, this will wait for the socket connection to complete when connecting to a remote socket. One might wish to use setCompletion() to change the socket back to blocking I/O calls after the connection completes. To implement the session one must create a derived class which implements Run().

Returns

0 if successful, -1 if timed out.

Parameters

  • timeout β€” to wait for completion in milliseconds.
ngl bestie, if you want your own session behaviour you GOTTA subclass and write Run(). that's the assignment. no skipping πŸ™ˆ

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for GNU CommonC++ from the source code.


and that's the whole page, bestie βœ¨πŸ’– it was generated automatically by Doxygen for GNU CommonC++ from the source code, and it's stamped Sun Dec 27 2020 β€” yes, a whole vintage moment, she's a little retro and that's exactly why she ate πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from