VideoTools
|
A class to read a fat pipe in the child process. More...
#include <gfatpipe.h>
Public Member Functions | |
FatPipeReceiver (int shmem_fd, int pipe_fd) | |
Constructor. | |
bool | receive (std::vector< char > &buffer, std::string *type_p=nullptr, G::EpochTime *=nullptr) |
Reads a message from the fat pipe's shared memory into the supplied buffer. More... | |
int | pipefd () const |
Returns the pipe fd. | |
Static Public Member Functions | |
static void | wait (int pipe_fd) |
A convenience function that sets the pipe fd to be non-blocking and does a non-multiplexed wait for a read event. More... | |
A class to read a fat pipe in the child process.
Definition at line 174 of file gfatpipe.h.
bool G::FatPipeReceiver::receive | ( | std::vector< char > & | buffer, |
std::string * | type_p = nullptr , |
||
G::EpochTime * | time_p = nullptr |
||
) |
Reads a message from the fat pipe's shared memory into the supplied buffer.
This is used in the child process, with the file descriptors inherited from the parent. The pipe fd must be non-blocking and it must have a pending read event (see wait()).
If the read event should be ignored then an empty buffer is returned. Throws on error, but returns false if the pipe breaks.
Definition at line 315 of file gfatpipe.cpp.
|
static |
A convenience function that sets the pipe fd to be non-blocking and does a non-multiplexed wait for a read event.
Definition at line 377 of file gfatpipe.cpp.