Transport Class Reference

#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

Detailed Description

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.


Constructor & Destructor Documentation

Transport (  ) 

Empty ctor.

Returns:

Definition at line 55 of file lsm_ipc.cpp.

Transport ( int  socket_desc  ) 

Class ctor

Parameters:
socket_desc Connected socket descriptor.

Definition at line 59 of file lsm_ipc.cpp.

~Transport (  ) 

Class dtor

Definition at line 161 of file lsm_ipc.cpp.

Here is the call graph for this function:


Member Function Documentation

int close (  ) 

Closes the transport, called in the destructor if not done in advance.

Returns:
0 on success, else EBADF, EINTR, EIO.

Definition at line 166 of file lsm_ipc.cpp.

Here is the caller graph for this function:

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.

Parameters:
error_code (0 on success, else errno)
Returns:
Message on success else 0 size with error_code set (not if EOF)

Definition at line 119 of file lsm_ipc.cpp.

Here is the caller graph for this function:

int msg_send ( const std::string &  msg,
int &  error_code 
)

Sends a message over the transport.

Parameters:
[in] msg The message to be sent.
[out] error_code Errno (only valid if we return -1)
Returns:
0 on success, else -1

Definition at line 63 of file lsm_ipc.cpp.

Here is the caller graph for this function:

int socket_get ( const std::string &  path,
int &  error_code 
) [static]

Creates a connected socket (AF_UNIX) to the specified path

Parameters:
path of the AF_UNIX file to be used for IPC
error_code Error reason for the failure (errno)
Returns:
-1 on error, else connected socket.

Definition at line 135 of file lsm_ipc.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

const int HDR_LEN = 10 [static]

Size of the header which immediately proceeds the payload.

Definition at line 45 of file lsm_ipc.hpp.


The documentation for this class was generated from the following files:

Generated on 9 Jul 2015 for libStorageMgmt by  doxygen 1.6.1