Turi Create
4.0
|
#include <core/system/platform/shmipc/shmipc.hpp>
Public Member Functions | |
bool | connect (std::string ipcfile, size_t timeout=10) |
size_t | buffer_size () const |
bool | send (const char *c, size_t len) |
bool | receive (char **c, size_t *len, size_t &receivelen, size_t timeout) |
bool | receive_direct (char **c, size_t *len, size_t &receivelen, size_t timeout) |
The corresponding client object to the server.
The communication is mostly unsynchronized between server and client, so users of the server/client implementations have to be careful about who is sending and who is receiving.
More design details in server
Definition at line 120 of file shmipc.hpp.
size_t turi::shmipc::client::buffer_size | ( | ) | const |
Returns the maximum amount of data that can be sent or received.
bool turi::shmipc::client::connect | ( | std::string | ipcfile, |
size_t | timeout = 10 |
||
) |
Connects to a server via the ipc file.
bool turi::shmipc::client::receive | ( | char ** | c, |
size_t * | len, | ||
size_t & | receivelen, | ||
size_t | timeout | ||
) |
Receives a bunch of bytes into (*c) and (*clen). (*c) and (*clen) may be resized as required to fit the data. if c == nullptr and clen == nullptr, the return data is discarded.
bool turi::shmipc::client::receive_direct | ( | char ** | c, |
size_t * | len, | ||
size_t & | receivelen, | ||
size_t | timeout | ||
) |
receives a direct buffer to the data. It is up to the caller to make sure that no other sends/receives happen while the caller accesses the data.
bool turi::shmipc::client::send | ( | const char * | c, |
size_t | len | ||
) |
Sends a bunch of bytes.