#include <lsm_ipc.hpp>
Public Member Functions | |
Transport () | |
Transport (int socket_desc) | |
~Transport () | |
int | msg_send (const std::string &msg, int &error_code) |
std::string | msg_recv (int &error_code) |
int | close () |
Static Public Member Functions | |
static int | socket_get (const std::string &path, int &error_code) |
Static Public Attributes | |
static const int | HDR_LEN = 10 |
Sends and receives payloads, unaware of the contents. Notes: Not thread safe. i.e. you cannot share the same object with two or more threads.
Definition at line 39 of file lsm_ipc.hpp.
Transport | ( | ) |
Transport | ( | int | socket_desc | ) |
Class ctor
socket_desc | Connected socket descriptor. |
Definition at line 59 of file lsm_ipc.cpp.
~Transport | ( | ) |
int close | ( | ) |
Closes the transport, called in the destructor if not done in advance.
Definition at line 166 of file lsm_ipc.cpp.
std::string msg_recv | ( | int & | error_code | ) |
Received a message over the transport. Note: A zero read indicates that the transport was closed by other side, no error code will be set in that case.
error_code | (0 on success, else errno) |
Definition at line 119 of file lsm_ipc.cpp.
int msg_send | ( | const std::string & | msg, | |
int & | error_code | |||
) |
Sends a message over the transport.
[in] | msg | The message to be sent. |
[out] | error_code | Errno (only valid if we return -1) |
Definition at line 63 of file lsm_ipc.cpp.
int socket_get | ( | const std::string & | path, | |
int & | error_code | |||
) | [static] |
Creates a connected socket (AF_UNIX) to the specified path
path | of the AF_UNIX file to be used for IPC | |
error_code | Error reason for the failure (errno) |
Definition at line 135 of file lsm_ipc.cpp.
const int HDR_LEN = 10 [static] |
Size of the header which immediately proceeds the payload.
Definition at line 45 of file lsm_ipc.hpp.