Faspstream Manager C/C++ API
3.6.1
A C and C++ language interface to basic streaming over the fasp protocol
|
#include <FaspOutputStream.h>
Public Member Functions | |
FASPSTREAM_CPP_API | FaspOutputStream (const Poco::Pipe &inPipe, Poco::SharedPtr< Poco::ProcessHandle > ph) |
FASPSTREAM_CPP_API void | write (const char *buffer, int length) |
FASPSTREAM_CPP_API void | close () |
FASPSTREAM_CPP_API void | abort () |
FASPSTREAM_CPP_API void | cleanup () |
Use the FaspOutputStream class to write faspstream data. Note this class does not inherit from any of the C++ std::ios stream classes, and requires the user to implement a write() loop to send the data.
FASPSTREAM_CPP_API FaspOutputStream::FaspOutputStream | ( | const Poco::Pipe & | inPipe, |
Poco::SharedPtr< Poco::ProcessHandle > | ph | ||
) |
Initializes fasp output stream to use inPipe connected to faspstream process. The faspstream process should read from inPipe, and FaspOutputStream will write to it.
FASPSTREAM_CPP_API void FaspOutputStream::abort | ( | ) |
FASPSTREAM_CPP_API void FaspOutputStream::cleanup | ( | ) |
FASPSTREAM_CPP_API void FaspOutputStream::close | ( | ) |
Closes the pipe to the faspstream process.
FASPSTREAM_CPP_API void FaspOutputStream::write | ( | const char * | buffer, |
int | length | ||
) |
Writes data to faspstream.
Returns the number of bytes written, negative for error.
This is a blocking function.
Throws a FaspStreamException if there is an error writing to the faspstream.
NOTE: You may also encounter a SIGPIPE if the faspstream process exited prematurely (perhaps due to an error).
buffer | data to write to faspstream |
length | number of bytes to write in buffer |