ost::UnixStream(3)
π ost::UnixStream π
okay bestie, pull up a chair π«Ά you're reading the manual page for ost::UnixStream(3) from the Library Functions Manual, and honestly? it's giving iconic. let's get into it β¨
πΈ NAME πΈ
ost::UnixStream β Unix streams are used to represent Unix domain client connections to a local server for accepting client connections. periodt π
β¨ SYNOPSIS β¨
#include <unix.h>
so it Inherits ost::Socket, streambuf, and iostream. π
and it's Inherited by ost::UnixSession, and ost::unixstream. the family tree is thriving π
π Public Member Functions π
UnixStream (UnixSocket &server, int size=512, bool throwflag=true, timeout_t timeout=0)β Create a Unix domain stream by accepting a connection from a bound Unix domain socket acting as a server.UnixStream (const char *pathname, int size=512, bool throwflag=true, timeout_t to=0)β Create a Unix domain stream by connecting to a Unix domain socket.void setTimeout (timeout_t to)β Set the I/O operation timeout for socket I/O operations.UnixStream (const UnixStream &source)β A copy constructor creates a new stream buffer.virtual ~UnixStream ()β Flush and empty all buffers, and then remove the allocated buffers.int sync (void)β Flushes the stream input and output buffers, writes pending output.bool isPending (Pending pend, timeout_t timeout=TIMEOUT_INF)β Get the status of pending stream data.int getBufferSize (void) constβ Return the size of the current stream buffering used.
π Protected Member Functions π
UnixStream (bool throwflag=true)β The constructor required for'unixstream', a more C++ style version of theTCPStreamclass.void allocate (int size)β Used to allocate the buffer space needed for iostream operations.void endStream (void)β Used to terminate the buffer space and cleanup the socket connection.virtual int underflow (void)β This streambuf method is used to load the input buffer through the established unix domain socket connection.int uflow (void)β This streambuf method is used for doing unbuffered reads through the established unix domain socket connection when in interactive mode.int overflow (int ch)β This streambuf method is used to write the output buffer through the established unix domain connection.void connect (const char *pathname, int size)β Create a Unix domain stream by connecting to a Unix domain socket.std::iostream * unixstr (void)β Used in derived classes to refer to the current object via it's iostream.
π¦ Protected Attributes π¦
timeout_t timeoutint bufsizechar * gbufchar * pbuf
β Additional Inherited Members β
(yes bestie, there's more where that came from β the inherited members are, like, a whole vibe of their own π)
π Detailed Description π
Unix streams are used to represent Unix domain client connections to a local server for accepting client connections. no cap π₯
The Unix stream is a C++ 'stream' class, and can accept streaming of data to and from other C++ objects using the << and >> operators. the way that it just streams? obsessed π
Unix Stream itself can be formed either by connecting to a bound network address of a Unix domain server, or can be created when 'accepting' a network connection from a Unix domain server. choose your own adventure, but make it sockets π§
Author
Alex Pavloff alex@pavloff.net β absolute icon, we stan π
streamable Unix domain socket connection. πΈ
π Constructor & Destructor Documentation π
ost::UnixStream::UnixStream (bool throwflag = true) [protected]
The constructor required for 'unixstream', a more C++ style version of the TCPStream class. π
ost::UnixStream::UnixStream (UnixSocket & server, int size = 512, bool throwflag = true, timeout_t timeout = 0)
Create a Unix domain stream by accepting a connection from a bound Unix domain socket acting as a server. This performs an 'accept' call. slay β¨
Parameters
serversocket listening.sizeof streaming input and output buffers.throwflagflag to throw errors.timeoutfor all operations.
ost::UnixStream::UnixStream (const char * pathname, int size = 512, bool throwflag = true, timeout_t to = 0)
Create a Unix domain stream by connecting to a Unix domain socket. π
Parameters
pathnamepath to socketsizeof streaming input and output buffers.throwflagflag to throw errors.totimeout for all operations.
ost::UnixStream::UnixStream (const UnixStream & source)
A copy constructor creates a new stream buffer. new buffer, who dis π
Parameters
sourceof copy.
virtual ost::UnixStream::~UnixStream () [virtual]
Flush and empty all buffers, and then remove the allocated buffers. it's the end of an era π but like, a tidy one.
π Member Function Documentation π
void ost::UnixStream::allocate (int size) [protected]
Used to allocate the buffer space needed for iostream operations. This function is called by the constructor. π«Ά
Parameters
sizeof stream buffers from constructor.
void ost::UnixStream::connect (const char * pathname, int size) [protected]
Create a Unix domain stream by connecting to a Unix domain socket. π₯
Parameters
pathnamepath to socketsizeof streaming input and output buffers.
Referenced by ost::unixstream::open().
void ost::UnixStream::endStream (void) [protected]
Used to terminate the buffer space and cleanup the socket connection. This fucntion is called by the destructor. (yes, "fucntion" β we're quoting the source, bestie, no edits π)
int ost::UnixStream::getBufferSize (void) const [inline]
Return the size of the current stream buffering used. π
Returns
- size of stream buffers.
References bufsize.
bool ost::UnixStream::isPending (Pending pend, timeout_t timeout = TIMEOUT_INF) [virtual]
Get the status of pending stream data. This can be used to examine if input or output is waiting, or if an error or disconnect has occured on the stream. If a read buffer contains data then input is ready and if write buffer contains data it is first flushed and then checked. the way it checks everything for you? main character energy π
Reimplemented from ost::Socket.
int ost::UnixStream::overflow (int ch) [protected]
This streambuf method is used to write the output buffer through the established unix domain connection. π¦
Parameters
chchar to push through.
Returns
- char pushed through.
void ost::UnixStream::setTimeout (timeout_t to) [inline]
Set the I/O operation timeout for socket I/O operations. β°
Parameters
totimeout to set.
References timeout.
int ost::UnixStream::sync (void)
Flushes the stream input and output buffers, writes pending output. π
Returns
0on success.
int ost::UnixStream::uflow (void) [protected]
This streambuf method is used for doing unbuffered reads through the established unix domain socket connection when in interactive mode. Also this method will handle proper use of buffers if not in interative mode. (again, quoting the source β "interative" is their word, not mine π)
Returns
- char from unix domain socket connection,
EOFif not connected.
virtual int ost::UnixStream::underflow (void) [protected], [virtual]
This streambuf method is used to load the input buffer through the established unix domain socket connection. β¨
Returns
- char from get buffer,
EOFif not connected.
std::iostream* ost::UnixStream::unixstr (void) [inline], [protected]
Used in derived classes to refer to the current object via it's iostream. For example, to send a set of characters in a derived method, one might use *tcp() << 'test'. πΈ
Returns
- stream pointer of this object.
π Member Data Documentation π
int ost::UnixStream::bufsize [protected]
Referenced by getBufferSize().
char* ost::UnixStream::gbuf [protected]
char * ost::UnixStream::pbuf [protected]
timeout_t ost::UnixStream::timeout [protected]
Referenced by setTimeout().
π Author π
Generated automatically by Doxygen for GNU CommonC++ from the source code. π
and that's the whole page, bestie β you ate that π«Ά this beauty came from GNU CommonC++, dated Sun Dec 27 2020, and it's giving ost::UnixStream(3) energy till the very last line. bye babe, go accept some connections π
β¨π
π¦ 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