| 265 | } |
| 266 | |
| 267 | void ProtocolClient::keepAliveTimerOnTimer() { |
| 268 | if (!m_isConnected || !m_isAllowedToSend) { |
| 269 | keepAliveTimer->stop(); |
| 270 | } else { |
| 271 | ++keepAliveCounter; |
| 272 | // Send Packet. |
| 273 | LOGGER_DEBUG("Sending Keep-Alive packet with value {}.", keepAliveCounter); |
| 274 | uint32_t const keepAliveValue = openmittsu::utility::Endian::uint32FromHostEndianToLittleEndian(keepAliveCounter); |
| 275 | |
| 276 | // Signature Byte: 0x00 |
| 277 | QByteArray packet(PROTO_DATA_HEADER_TYPE_LENGTH_BYTES, 0x00); |
| 278 | packet[0] = (PROTO_PACKET_SIGNATURE_KEEPALIVE_REQUEST); |
| 279 | |
| 280 | packet.append(openmittsu::utility::ByteArrayConversions::convertQuint32toQByteArray(keepAliveValue)); |
| 281 | encryptAndSendDataPacketToServer(packet); |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | void ProtocolClient::messageSendFailed(openmittsu::protocol::GroupId const& groupId, openmittsu::protocol::MessageId const& messageId) { |
| 286 | m_messageCenterWrapper->processMessageSendFailed(groupId, messageId); |
nothing calls this directly
no outgoing calls
no test coverage detected