Kanzi Connect  3.9.8
Kanzi Connect C++ API
kanzi::connect::ConnectedClient Class Reference

Class that represents one client on server-side. More...

#include <connected_client.hpp>

Inheritance diagram for kanzi::connect::ConnectedClient:
kanzi::connect::ConnectedClientProxy

Public Types

enum  Role { RoleClient, RoleServer }
 
typedef enum kanzi::connect::ConnectedClient::Role Role
 

Public Member Functions

 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< MessageDispatchergetMessageDispatcher ()
 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...
 

Detailed Description

Class that represents one client on server-side.

Acts as a gateway to client and makes it possible to transmit messages between client and server.

Member Typedef Documentation

◆ Role

Member Enumeration Documentation

◆ Role

Enumerator
RoleClient 
RoleServer 

Constructor & Destructor Documentation

◆ ConnectedClient()

kanzi::connect::ConnectedClient::ConnectedClient ( shared_ptr< MessageDispatcher dispatcher,
int  id = -1 
)

Constructor.

Parameters
dispatcherMessage dispatcher, used to send messages in to this client instance.
idId of the client.

◆ ~ConnectedClient()

kanzi::connect::ConnectedClient::~ConnectedClient ( )

Destructor.

Member Function Documentation

◆ getAddress()

const string& kanzi::connect::ConnectedClient::getAddress ( ) const

Retrieves ip address of the client.

Returns
IP address of the client, as string.

◆ getFirstMessageWaitTimerHandle()

int64_t kanzi::connect::ConnectedClient::getFirstMessageWaitTimerHandle ( ) const

get handle used to track first message

Returns
handle

◆ getId()

int kanzi::connect::ConnectedClient::getId ( ) const

Return the internally hold ID, -1 if not configured.

Returns
client identifier number.

◆ getMessageDispatcher()

shared_ptr<MessageDispatcher> kanzi::connect::ConnectedClient::getMessageDispatcher ( )

Retrieves message dispatcher of this client.

Returns
Message dispatcher for this client.

◆ getName()

const string& kanzi::connect::ConnectedClient::getName ( ) const

Retrieves name of the client.

Returns
Name of the client.

◆ getProtocol()

const string& kanzi::connect::ConnectedClient::getProtocol ( ) const

Retrieves the protocol assigned to a client connection.

Returns
the protocol, e.g. "connect.bearer.tcp", "connect.bearer.ssl", "http", "https", ..

◆ getRole()

Role kanzi::connect::ConnectedClient::getRole ( ) const

Retrieves the role of an object.

Returns
the role

◆ setAddress()

void kanzi::connect::ConnectedClient::setAddress ( const string &  address)

Sets IP address for a client.

Parameters
addressNew IP address for client.

◆ setFirstMessageWaitTimerHandle()

void kanzi::connect::ConnectedClient::setFirstMessageWaitTimerHandle ( int64_t  handle)

Store a handle used to track first message.

Parameters
handlethe handle

◆ setName()

void kanzi::connect::ConnectedClient::setName ( const string &  name)

Sets name for a client.

Parameters
nameNew name for client.

◆ setProtocol()

void kanzi::connect::ConnectedClient::setProtocol ( const string &  protocol)

Sets the protocol for the client.

Parameters
protocolthe protocol

◆ setRole()

void kanzi::connect::ConnectedClient::setRole ( Role  role)

Configure the role.

Parameters
rolethe role.

◆ toString()

string kanzi::connect::ConnectedClient::toString ( ) const

Get textual information of the client to for example logging purposes.

Returns
human readable information about the object.

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