ost::UnixStream(3) | Library Functions Manual | ost::UnixStream(3) |
NAME¶
ost::UnixStream - Unix streams are used to represent Unix domain client connections to a local server for accepting client connections.SYNOPSIS¶
#include <unix.h> Inherits ost::Socket, streambuf, and iostream. Inherited by ost::UnixSession, and ost::unixstream.Public Member Functions¶
UnixStream (UnixSocket &server, int size=512, bool throwflag=true, timeout_t timeout=0)
Protected Member Functions¶
UnixStream (bool throwflag=true)
Protected Attributes¶
timeout_t timeout
Additional Inherited Members¶
Detailed Description¶
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:Alex Pavloff alex@pavloff.net streamable Unix domain
socket connection.
Constructor & Destructor Documentation¶
ost::UnixStream::UnixStream (boolthrowflag = true) [protected]¶
The constructor required for 'unixstream', a more C++ style version of the TCPStream class.ost::UnixStream::UnixStream ( UnixSocket &server, intsize = 512, boolthrowflag = true, timeout_ttimeout = 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. Parameters:server socket listening.
size of streaming input and output buffers.
throwflag flag to throw errors.
timeout for all operations.
ost::UnixStream::UnixStream (const char *pathname, intsize = 512, boolthrowflag = true, timeout_tto = 0)¶
Create a Unix domain stream by connecting to a Unix domain socket. Parameters:pathname path to socket
size of streaming input and output buffers.
throwflag flag to throw errors.
to timeout for all operations.
ost::UnixStream::UnixStream (const UnixStream &source)¶
A copy constructor creates a new stream buffer. Parameters:source of copy.
virtual ost::UnixStream::~UnixStream () [virtual]¶
Flush and empty all buffers, and then remove the allocated buffers.Member Function Documentation¶
void ost::UnixStream::allocate (intsize) [protected]¶
Used to allocate the buffer space needed for iostream operations. This function is called by the constructor. Parameters:size of stream buffers from constructor.
void ost::UnixStream::connect (const char *pathname, intsize) [protected]¶
Create a Unix domain stream by connecting to a Unix domain socket. Parameters:pathname path to socket
size of 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.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 ( Pendingpend, timeout_ttimeout = 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. Reimplemented from ost::Socket.int ost::UnixStream::overflow (intch) [protected]¶
This streambuf method is used to write the output buffer through the established unix domain connection. Parameters:ch char to push through.
Returns:
char pushed through.
void ost::UnixStream::setTimeout ( timeout_tto) [inline]¶
Set the I/O operation timeout for socket I/O operations. Parameters:to timeout to set.
References timeout.
int ost::UnixStream::sync (void)¶
Flushes the stream input and output buffers, writes pending output. Returns:0 on 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. Returns:char from unix domain socket connection, EOF if 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, EOF if 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.Sun Dec 29 2013 | GNU CommonC++ |