ost::UnixSession(3)
π 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 threadInitial()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
- ubuntu jammy: libcommoncpp2-doc 1.8.1-10
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms