MCPcopy Create free account
hub / github.com/blizzard4591/openMittsu / keepAliveTimerOnTimer

Method keepAliveTimerOnTimer

src/network/ProtocolClient.cpp:267–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected