#include <connected_client.hpp>
Public Member Functions | |
| optional< int > | acquireSession (const string &interfaceId) |
| Acquire new client session to be used with this client. More... | |
| ConnectedClientProxy (ServiceManagerSharedPtr serviceManager, MessageDispatcherSharedPtr dispatcher, int clientId) | |
| Constructor. More... | |
| ServiceHostSharedPtr | getServiceHost (int sessionId) |
| Get service host for session identifier. More... | |
| AbstractSessionSharedPtr | getSession (int sessionId) |
| Get session for identifier. More... | |
| void | releaseSession (int sessionId) |
| Sends a stop message through the message handler and release the allocated session. More... | |
| bool | send (MessagePackage &message, int sessionId) |
| Send a message through client. More... | |
| void | setConnectionManager (ConnectionManagerSharedPtr connectionManager) |
| If the given client identifier was allocated from client id manager, set the connection manager so that client can release the handle upon destruction. More... | |
| ~ConnectedClientProxy () | |
| Destructor. More... | |
Public Member Functions inherited from kanzi::connect::ConnectedClient | |
| ConnectedClient (shared_ptr< MessageDispatcher > dispatcher, int id=-1) | |
| Constructor. More... | |
| const string & | getAddress () const |
| Retrieves ip address of the client. More... | |
| int64_t | getFirstMessageWaitTimerHandle () const |
| get handle used to track first message More... | |
| int | getId () const |
| Return the internally hold ID, -1 if not configured. More... | |
| shared_ptr< MessageDispatcher > | getMessageDispatcher () |
| Retrieves message dispatcher of this client. More... | |
| const string & | getName () const |
| Retrieves name of the client. More... | |
| const string & | getProtocol () const |
| Retrieves the protocol assigned to a client connection. More... | |
| Role | getRole () const |
| Retrieves the role of an object. More... | |
| void | setAddress (const string &address) |
| Sets IP address for a client. More... | |
| void | setFirstMessageWaitTimerHandle (int64_t handle) |
| Store a handle used to track first message. More... | |
| void | setName (const string &name) |
| Sets name for a client. More... | |
| void | setProtocol (const string &protocol) |
| Sets the protocol for the client. More... | |
| void | setRole (Role role) |
| Configure the role. More... | |
| string | toString () const |
| Get textual information of the client to for example logging purposes. More... | |
| ~ConnectedClient () | |
| Destructor. More... | |
Static Public Member Functions | |
| static ConnectedClientProxySharedPtr | create (const string &name, ConnectDomain *connectDomain, MessageDispatcherSharedPtr dispatcher, const string &clientIdMgrType) |
Additional Inherited Members | |
Public Types inherited from kanzi::connect::ConnectedClient | |
| enum | Role { RoleClient, RoleServer } |
| typedef enum kanzi::connect::ConnectedClient::Role | Role |
| kanzi::connect::ConnectedClientProxy::ConnectedClientProxy | ( | ServiceManagerSharedPtr | serviceManager, |
| MessageDispatcherSharedPtr | dispatcher, | ||
| int | clientId | ||
| ) |
Constructor.
| serviceManager | The interface to be used when finding service hosts and sending messages. |
| dispatcher | The message dispatcher to be used with responses. |
| clientId | The client identifier used when communicating with services, needs to be unique. |
| kanzi::connect::ConnectedClientProxy::~ConnectedClientProxy | ( | ) |
Destructor.
| optional<int> kanzi::connect::ConnectedClientProxy::acquireSession | ( | const string & | interfaceId | ) |
Acquire new client session to be used with this client.
| interfaceId | Identifier of the service. |
|
static |
| ServiceHostSharedPtr kanzi::connect::ConnectedClientProxy::getServiceHost | ( | int | sessionId | ) |
Get service host for session identifier.
| sessionId | The identifier for a session. |
| AbstractSessionSharedPtr kanzi::connect::ConnectedClientProxy::getSession | ( | int | sessionId | ) |
Get session for identifier.
| sessionId | The identifier for a session. |
| void kanzi::connect::ConnectedClientProxy::releaseSession | ( | int | sessionId | ) |
Sends a stop message through the message handler and release the allocated session.
| sessionId | The identifier of a session to be released. If session id is not found, the method does nothing. |
| bool kanzi::connect::ConnectedClientProxy::send | ( | MessagePackage & | message, |
| int | sessionId | ||
| ) |
Send a message through client.
Modify message package with session information.
| message | The message package to be modified and sent. |
| sessionId | The identifier for the session to be used when sending. |
| void kanzi::connect::ConnectedClientProxy::setConnectionManager | ( | ConnectionManagerSharedPtr | connectionManager | ) |
If the given client identifier was allocated from client id manager, set the connection manager so that client can release the handle upon destruction.
| connectionManager | The connection manager instance that was used when allocating the client identifier. |