ConnectedClient¶
-
class
kanzi::connect
::
ConnectedClient
: public enable_shared_from_this<ConnectedClient>¶ 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.
Subclassed by ConnectedClientProxy
Public Types
-
typedef enum kanzi::connect::ConnectedClient::Role
Role
Public Functions
Constructor.
- Parameters
dispatcher
: Message dispatcher, used to send messages in to this client instance.id
: Id of the client.
-
~ConnectedClient
()¶ Destructor.
-
const string &
getAddress
() const¶ Retrieves ip address of the client.
- Return
IP address of the client, as string.
-
int64_t
getFirstMessageWaitTimerHandle
() const¶ get handle used to track first message
- Return
handle
-
int
getId
() const¶ Return the internally hold ID, -1 if not configured.
- Return
client identifier number.
-
shared_ptr<MessageDispatcher>
getMessageDispatcher
()¶ Retrieves message dispatcher of this client.
- Return
Message dispatcher for this client.
-
const string &
getName
() const¶ Retrieves name of the client.
- Return
Name of the client.
-
const string &
getProtocol
() const¶ Retrieves the protocol assigned to a client connection.
- Return
the protocol, e.g. “connect.bearer.tcp”, “connect.bearer.ssl”, “http”, “https”, ..
-
void
setAddress
(const string &address)¶ Sets IP address for a client.
- Parameters
address
: New IP address for client.
-
void
setFirstMessageWaitTimerHandle
(int64_t handle)¶ Store a handle used to track first message.
- Parameters
handle
: the handle
-
void
setName
(const string &name)¶ Sets name for a client.
- Parameters
name
: New name for client.
-
void
setProtocol
(const string &protocol)¶ Sets the protocol for the client.
- Parameters
protocol
: the protocol
-
string
toString
() const¶ Get textual information of the client to for example logging purposes.
- Return
human readable information about the object.
-
typedef enum kanzi::connect::ConnectedClient::Role