Add ClientPool

Clients are created and kept in the pool at first.
ClientList gets a free client from the pool.

Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2021-05-25 11:50:58 +09:00
parent 740faeb09f
commit 982e6d4884
4 changed files with 125 additions and 26 deletions

View File

@@ -32,14 +32,15 @@ char* currentDateTime(void);
Class Client
=====================================*/
static const char* theClientStatus[] =
{ "Disconnected", "TryConnecting", "Connecting", "Active", "Asleep", "Awake",
{ "InPool", "Disconnected", "TryConnecting", "Connecting", "Active", "Asleep",
"Awake",
"Lost" };
Client::Client(bool secure)
{
_packetId = 0;
_snMsgId = 0;
_status = Cstat_Disconnected;
_status = Cstat_Free;
_keepAliveMsec = 0;
_topics = new Topics();
_clientId = nullptr;