lib45d
45Drives C++ Library API Documentation
Public Member Functions | List of all members
ffd::UnixSocketClient Class Reference

Unix Socket Client class. Used for IPC through a named socket inode. More...

#include <45d/socket/UnixSocketClient.hpp>

Inheritance diagram for ffd::UnixSocketClient:
Inheritance graph
[legend]
Collaboration diagram for ffd::UnixSocketClient:
Collaboration graph
[legend]

Public Member Functions

 UnixSocketClient (const std::string &path)
 Construct a new Unix Socket Client object. More...
 
int connect ()
 Make connection to socket. More...
 
- Public Member Functions inherited from ffd::SocketBase
 SocketBase (int domain, int type, int protocol=0)
 Construct a new Socket Base object. Opens a socket fd. More...
 
 ~SocketBase ()
 Destroy the Socket Base object. Calls close() on the socket fd. More...
 
void close_connection (int fd=0)
 Close a connection. More...
 
void send_data_async (const std::string &str, int flags=0, int fd=0)
 Send a string. More...
 
void send_data_sync (const std::string &str, int flags=0, int fd=0)
 Send a string and wait for ACK. More...
 
void send_data (const std::string &str, int flags=0, int fd=0)
 Send a string and wait for ACK (alias for ffd::SocketBase::send_data_sync(const std::string&, int, int)) More...
 
void send_data_async (const std::vector< std::string > &vec, int flags=0, int fd=0)
 Send a vector as a record separator (0x1E) delimited string. More...
 
void send_data_sync (const std::vector< std::string > &vec, int flags=0, int fd=0)
 Send a vector as a record separator (0x1E) delimited string and wait for ACK. More...
 
void send_data (const std::vector< std::string > &vec, int flags=0, int fd=0)
 Send a vector as a record separator (0x1E) delimited string and wait for ACK (alias for ffd::SocketBase::send_data_sync(const std::vector<std::string>&, int, int)) More...
 
void receive_data_async (std::string &payload, int flags=0, int fd=0)
 Receive a string. More...
 
void receive_data_sync (std::string &payload, int flags=0, int fd=0)
 Receive a string and reply with ACK. More...
 
void receive_data (std::string &payload, int flags=0, int fd=0)
 Receive a string and reply with ACK (alias for ffd::SocketBase::receive_data_sync(std::string&, int, int)) More...
 
void receive_data_async (std::vector< std::string > &vec, int flags=0, int fd=0)
 Receive a vector as a record separator (0x1E) delimited string. More...
 
void receive_data_sync (std::vector< std::string > &vec, int flags=0, int fd=0)
 Receive a vector as a record separator (0x1E) delimited string and reply with ACK. More...
 
void receive_data (std::vector< std::string > &vec, int flags=0, int fd=0)
 Receive a vector as a record separator (0x1E) delimited string and reply with ACK (alias for ffd::SocketBase::receive_data_sync(std::vector<std::string>&, int, int)) More...
 
void shutdown (int how=SHUT_RDWR)
 Call shutdown() on the socket fd, waking any blocked threads. More...
 

Additional Inherited Members

- Protected Attributes inherited from ffd::SocketBase
int fd_
 File descriptor of socket.
 
int io_fd_
 Connection fd.
 
char ACK
 char to send for acknowledging reception
 

Detailed Description

Unix Socket Client class. Used for IPC through a named socket inode.

Constructor & Destructor Documentation

◆ UnixSocketClient()

ffd::UnixSocketClient::UnixSocketClient ( const std::string &  path)
inline

Construct a new Unix Socket Client object.

Parameters
pathPath to socket inode

Member Function Documentation

◆ connect()

int ffd::UnixSocketClient::connect ( )
inline

Make connection to socket.

Returns
int fd for socket

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