A class that implements connection adapter for TCP-IP transport type.
More...
#include <connection_adapter_socket_client.hpp>
|
| static const string | PARAMETER_HOST_IP |
| | Configuration parameter for server ip address.
|
| |
| static const string | PARAMETER_HOST_PORT |
| | Configuration parameter for server port.
|
| |
| static const string | STATE_IP |
| | State parameter to read adapter ip address back.
|
| |
| static const string | STATE_PORT |
| | State parameter to read adapter port back.
|
| |
|
| void | clearTxQueue () |
| | Clears the transmit queue.
|
| |
| void | discardFromTxQueue (size_t bytes) |
| | Discards data (after being sent) from tx queue.
|
| |
| virtual bool | hasPendingTxSocketData () |
| | Determine whether the client implementation has pending data to write.
|
| |
| bool | queueTxData (const vector< char > &data, size_t maxQueueDepth, size_t position=0) |
| | Tries to queue given buffer to tx queue.
|
| |
| virtual void | read ()=0 |
| | Do the reading from socket.
|
| |
| virtual void | sendPendingTxSocketData () |
| | Write pending data into the socket.
|
| |
| void | notifyConnected () |
| | Allows derived class to invoke connection notification to all observers.
|
| |
| void | notifyDisconnected () |
| | Allows derived class to invoke disconnect notification to all observers.
|
| |
| void | notifyReceive (const vector< char > &data) |
| | Allows derived class to invoke data received notification to all observers.
|
| |
|
| typedef map< string, string > | Parameters |
| | Container type for parameters.
|
| |
| static string | getConfigurationParameterString (const Parameters ¶meters, const string ¶meter) |
| | Get single single string type configuration parameter. Returns empty string for missing parameter.
|
| |
A class that implements connection adapter for TCP-IP transport type.
◆ ClientSocketConnectionAdapter()
| kanzi::connect::ClientSocketConnectionAdapter::ClientSocketConnectionAdapter |
( |
int | socketType | ) |
|
Constructor.
- Parameters
-
| socketType | Sets the type of the socket to be created (either streaming or datagram). |
◆ ~ClientSocketConnectionAdapter()
| virtual kanzi::connect::ClientSocketConnectionAdapter::~ClientSocketConnectionAdapter |
( |
| ) |
|
|
virtual |
◆ clearTxQueue()
| void kanzi::connect::ClientSocketConnectionAdapter::clearTxQueue |
( |
| ) |
|
|
protected |
Clears the transmit queue.
◆ configure()
◆ connect()
| virtual bool kanzi::connect::ClientSocketConnectionAdapter::connect |
( |
| ) |
|
|
virtual |
◆ discardFromTxQueue()
| void kanzi::connect::ClientSocketConnectionAdapter::discardFromTxQueue |
( |
size_t | bytes | ) |
|
|
protected |
Discards data (after being sent) from tx queue.
- Parameters
-
| bytes | amount of data to discard. |
◆ disconnect()
| virtual void kanzi::connect::ClientSocketConnectionAdapter::disconnect |
( |
| ) |
|
|
virtual |
◆ getState()
| virtual string kanzi::connect::ClientSocketConnectionAdapter::getState |
( |
const string & | parameter | ) |
|
|
virtual |
◆ hasPendingTxSocketData()
| virtual bool kanzi::connect::ClientSocketConnectionAdapter::hasPendingTxSocketData |
( |
| ) |
|
|
inlineprotectedvirtual |
Determine whether the client implementation has pending data to write.
- Returns
- true if there is pending data to write and socket should be listened for write availability also.
◆ interrupt()
| virtual void kanzi::connect::ClientSocketConnectionAdapter::interrupt |
( |
| ) |
|
|
virtual |
◆ queueTxData()
| bool kanzi::connect::ClientSocketConnectionAdapter::queueTxData |
( |
const vector< char > & | data, |
|
|
size_t | maxQueueDepth, |
|
|
size_t | position = 0 ) |
|
protected |
Tries to queue given buffer to tx queue.
- Parameters
-
| data | the data to queue |
| maxQueueDepth | the maximum allowed depth for the queue |
| position | from the data vector, at which position to start inserting data to queue. optional. |
- Returns
- true if queued successfully, false if not fit or other problems faced.
◆ read()
| virtual void kanzi::connect::ClientSocketConnectionAdapter::read |
( |
| ) |
|
|
protectedpure virtual |
Do the reading from socket.
◆ sendPendingTxSocketData()
| virtual void kanzi::connect::ClientSocketConnectionAdapter::sendPendingTxSocketData |
( |
| ) |
|
|
inlineprotectedvirtual |
Write pending data into the socket.
◆ wait()
| virtual int kanzi::connect::ClientSocketConnectionAdapter::wait |
( |
| ) |
|
|
virtual |
◆ work()
| virtual void kanzi::connect::ClientSocketConnectionAdapter::work |
( |
int | status | ) |
|
|
virtual |
◆ m_mutex
| recursive_mutex kanzi::connect::ClientSocketConnectionAdapter::m_mutex |
|
protected |
◆ m_port
| int kanzi::connect::ClientSocketConnectionAdapter::m_port |
|
protected |
◆ m_server
| string kanzi::connect::ClientSocketConnectionAdapter::m_server |
|
protected |
Configured server address.
◆ m_set
| ::fd_set* kanzi::connect::ClientSocketConnectionAdapter::m_set |
|
protected |
Activated sockets during wait.
◆ m_signal
| int kanzi::connect::ClientSocketConnectionAdapter::m_signal[2] |
|
protected |
◆ m_socket
| Socket* kanzi::connect::ClientSocketConnectionAdapter::m_socket |
|
protected |
◆ m_socketType
| int kanzi::connect::ClientSocketConnectionAdapter::m_socketType |
|
protected |
◆ m_txBuffer
| vector<char> kanzi::connect::ClientSocketConnectionAdapter::m_txBuffer |
|
protected |
◆ m_workResult
| int kanzi::connect::ClientSocketConnectionAdapter::m_workResult |
|
protected |
Result of wait is stored here.
◆ m_writeSet
| ::fd_set* kanzi::connect::ClientSocketConnectionAdapter::m_writeSet |
|
protected |
◆ PARAMETER_HOST_IP
| const string kanzi::connect::ClientSocketConnectionAdapter::PARAMETER_HOST_IP |
|
static |
Configuration parameter for server ip address.
◆ PARAMETER_HOST_PORT
| const string kanzi::connect::ClientSocketConnectionAdapter::PARAMETER_HOST_PORT |
|
static |
Configuration parameter for server port.
◆ STATE_IP
| const string kanzi::connect::ClientSocketConnectionAdapter::STATE_IP |
|
static |
State parameter to read adapter ip address back.
◆ STATE_PORT
| const string kanzi::connect::ClientSocketConnectionAdapter::STATE_PORT |
|
static |
State parameter to read adapter port back.
The documentation for this class was generated from the following file:
- connect/connection/connection_adapter_socket_client.hpp