|
ucommon
|
Streamable tcp connection between client and server. More...
#include <stream.h>


Public Types | |
| enum | access_t { RDONLY, WRONLY, RDWR } |
Public Member Functions | |
| void | close (void) |
| Close an active stream connection. | |
| void | open (char *command, access_t access, char **env=((void *) 0), size_t buffering=512) |
| Open a stream connection to a pipe service. | |
| operator bool () | |
| See if stream connection is active. | |
| bool | operator! () |
| See if stream is disconnected. | |
| pipestream () | |
| Create an unopened pipe stream. | |
| pipestream (char *command, access_t access, char **env=((void *) 0), size_t size=512) | |
| Create child process and start pipe. | |
| void | terminate (void) |
| Force terminate child and close. | |
| virtual | ~pipestream () |
| Destroy a pipe stream. | |
Protected Member Functions | |
| int | _getch (void) |
| This streambuf method is used to load the input buffer through the established pipe connection. | |
| int | _putch (int ch) |
| This streambuf method is used to write the output buffer through the established pipe connection. | |
| void | release (void) |
| Release the stream, detach/do not wait for the process. | |
Protected Attributes | |
| pid_t | pid |
| fsys_t | rd |
| fsys_t | wr |
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.
| ucommon::pipestream::pipestream | ( | char * | command, |
| access_t | access, | ||
| char ** | env = ((void *) 0), |
||
| size_t | size = 512 |
||
| ) |
Create child process and start pipe.
| command | to pass. |
| access | mode of pipe stream. |
| env | to create in child. |
| size | of buffer. |
| int ucommon::pipestream::_getch | ( | void | ) | [protected, virtual] |
This streambuf method is used to load the input buffer through the established pipe connection.
Implements ucommon::CharacterProtocol.
| int ucommon::pipestream::_putch | ( | int | ch | ) | [protected, virtual] |
This streambuf method is used to write the output buffer through the established pipe connection.
| ch | char to push through. |
Implements ucommon::CharacterProtocol.
| void ucommon::pipestream::close | ( | void | ) |
Close an active stream connection.
This waits for the child to terminate.
| void ucommon::pipestream::open | ( | char * | command, |
| access_t | access, | ||
| char ** | env = ((void *) 0), |
||
| size_t | buffering = 512 |
||
| ) |
Open a stream connection to a pipe service.
| command | to execute. |
| access | mode of stream. |
| env | to create in child process. |
| buffering | size to use. |
| ucommon::pipestream::operator bool | ( | ) | [inline] |
See if stream connection is active.
Reimplemented from ucommon::StreamProtocol.
| bool ucommon::pipestream::operator! | ( | ) | [inline] |
See if stream is disconnected.
Reimplemented from ucommon::StreamProtocol.
1.7.6.1