Streamable tcp connection between client and server. More...
#include <stream.h>
Inherits std::streambuf, and std::iostream.
Public Types | |
enum | access_t { RDONLY, WRONLY, RDWR } |
Public Member Functions | |
void | close (void) |
Close an active stream connection. | |
void | create (const char *filename, fsys::access_t access, unsigned mode, size_t buffering=512) |
Create a stream connection to a tcp service. | |
int | error (void) const |
Get error flag from last i/o operation. | |
filestream (const filestream ©) | |
Create duplicate stream. | |
filestream (const char *path, fsys::access_t access, size_t bufsize) | |
Open file stream. | |
filestream () | |
Create an unopened pipe stream. | |
filestream (const char *path, fsys::access_t access, unsigned mode, size_t bufsize) | |
Create file stream. | |
void | open (const char *filename, fsys::access_t access, size_t buffering=512) |
Open a stream connection to a tcp service. | |
operator bool () const | |
See if stream connection is active. | |
bool | operator! () const |
See if stream is disconnected. | |
void | seek (fsys::offset_t offset) |
Seek position. | |
int | sync (void) |
Flush the stream input and output buffers, writes pending output. | |
virtual | ~filestream () |
Destroy a file stream. | |
Protected Member Functions | |
int | overflow (int ch) |
This streambuf method is used to write the output buffer through the established pipe connection. | |
int | uflow () |
This streambuf method is used for doing unbuffered reads through the establish tcp socket connection when in interactive mode. | |
int | underflow () |
This streambuf method is used to load the input buffer through the established pipe connection. | |
Protected Attributes | |
fsys::access_t | ac |
size_t | bufsize |
fsys_t | fd |
char * | gbuf |
char * | pbuf |
Streamable tcp connection between client and server.
The tcp stream class can represent a client connection to a server or an instance of a service generated by a tcp listener. As a stream class, data can be manipulated using the << and >> operators.
Definition at line 294 of file stream.h.
int ucc::filestream::error | ( | void | ) | const [inline] |
ucc::filestream::operator bool | ( | ) | const [inline] |
bool ucc::filestream::operator! | ( | ) | const [inline] |
int ucc::filestream::overflow | ( | int | ch | ) | [protected] |
This streambuf method is used to write the output buffer through the established pipe connection.
ch | char to push through. |
int ucc::filestream::sync | ( | void | ) |
Flush the stream input and output buffers, writes pending output.
int ucc::filestream::uflow | ( | ) | [protected] |
This streambuf method is used for doing unbuffered reads through the establish tcp socket connection when in interactive mode.
Also this method will handle proper use of buffers if not in interative mode.
int ucc::filestream::underflow | ( | ) | [protected] |
This streambuf method is used to load the input buffer through the established pipe connection.