Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2019-10-03 15:13:29 +09:00
parent 271b635d3f
commit 7aa44d94d1
2 changed files with 15 additions and 21 deletions

View File

@@ -170,19 +170,17 @@ void MQTTSNAggregateConnectionHandler::handlePingreq(Client* client, MQTTSNPacke
sendStoredPublish(client);
client->holdPingRequest();
}
else
{
/* create and send PINGRESP to the PacketHandler */
client->resetPingRequest();
MQTTGWPacket* pingresp = new MQTTGWPacket();
/* create and send PINGRESP to the PacketHandler */
client->resetPingRequest();
pingresp->setHeader(PINGRESP);
MQTTGWPacket* pingresp = new MQTTGWPacket();
Event* evt = new Event();
evt->setBrokerRecvEvent(client, pingresp);
_gateway->getPacketEventQue()->post(evt);
}
pingresp->setHeader(PINGRESP);
Event* evt = new Event();
evt->setBrokerRecvEvent(client, pingresp);
_gateway->getPacketEventQue()->post(evt);
}
void MQTTSNAggregateConnectionHandler::sendStoredPublish(Client* client)

View File

@@ -275,18 +275,14 @@ void MQTTSNConnectionHandler::handlePingreq(Client* client, MQTTSNPacket* packet
if ( ( client->isSleep() || client->isAwake() ) && client->getClientSleepPacket() )
{
sendStoredPublish(client);
client->holdPingRequest();
}
else
{
/* send PINGREQ to the broker */
client->resetPingRequest();
MQTTGWPacket* pingreq = new MQTTGWPacket();
pingreq->setHeader(PINGREQ);
Event* evt = new Event();
evt->setBrokerSendEvent(client, pingreq);
_gateway->getBrokerSendQue()->post(evt);
}
/* send PINGREQ to the broker */
MQTTGWPacket* pingreq = new MQTTGWPacket();
pingreq->setHeader(PINGREQ);
Event* evt = new Event();
evt->setBrokerSendEvent(client, pingreq);
_gateway->getBrokerSendQue()->post(evt);
}
void MQTTSNConnectionHandler::sendStoredPublish(Client* client)