| 1336 | |
| 1337 | |
| 1338 | std::optional<UInt64> Connection::checkPacket(size_t timeout_microseconds) |
| 1339 | { |
| 1340 | if (last_input_packet_type.has_value()) |
| 1341 | return last_input_packet_type; |
| 1342 | |
| 1343 | if (hasReadPendingData() || poll(timeout_microseconds)) |
| 1344 | { |
| 1345 | UInt64 packet_type = 0; |
| 1346 | readVarUInt(packet_type, *in); |
| 1347 | |
| 1348 | last_input_packet_type.emplace(packet_type); |
| 1349 | return last_input_packet_type; |
| 1350 | } |
| 1351 | |
| 1352 | return {}; |
| 1353 | } |
| 1354 | |
| 1355 | |
| 1356 | UInt64 Connection::receivePacketType() |
no test coverage detected