ost::UnixStream(3) | Library Functions Manual | ost::UnixStream(3) |
ost::UnixStream - Unix streams are used to represent Unix domain client connections to a local server for accepting client connections.
#include <unix.h>
Inherits ost::Socket, streambuf, and iostream.
Inherited by ost::UnixSession, and 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. 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.
UnixStream (bool throwflag=true)
The constructor required for 'unixstream', a more C++ style version of the
TCPStream class. 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.
timeout_t timeout
int bufsize
char * gbuf
char * pbuf
Unix streams are used to represent Unix domain client connections to a local server for accepting client connections.
The Unix stream is a C++ 'stream' class, and can accept streaming of data to and from other C++ objects using the << and >> operators.
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.
Author:
The constructor required for 'unixstream', a more C++ style version of the TCPStream class.
Create a Unix domain stream by accepting a connection from a bound Unix domain socket acting as a server. This performs an 'accept' call.
Parameters:
Create a Unix domain stream by connecting to a Unix domain socket.
Parameters:
A copy constructor creates a new stream buffer.
Parameters:
Flush and empty all buffers, and then remove the allocated buffers.
Used to allocate the buffer space needed for iostream operations. This function is called by the constructor.
Parameters:
Create a Unix domain stream by connecting to a Unix domain socket.
Parameters:
Referenced by ost::unixstream::open().
Used to terminate the buffer space and cleanup the socket connection. This fucntion is called by the destructor.
Return the size of the current stream buffering used.
Returns:
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.
Reimplemented from ost::Socket.
This streambuf method is used to write the output buffer through the established unix domain connection.
Parameters:
Returns:
Set the I/O operation timeout for socket I/O operations.
Parameters:
References ost::Socket::isPending(), TIMEOUT_INF, and ost::UnixSocket::UnixStream.
Flushes the stream input and output buffers, writes pending output.
Returns:
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.
Returns:
This streambuf method is used to load the input buffer through the established unix domain socket connection.
Returns:
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:
References ost::UnixSocket::UnixStream.
Generated automatically by Doxygen for GNU CommonC++ from the source code.
Wed Oct 31 2018 | GNU CommonC++ |