From c4362fd9b2b93fe9067ad9cb03f07dc6ebfb907b Mon Sep 17 00:00:00 2001 From: Edoardo La Greca Date: Thu, 24 Jul 2025 21:32:15 +0200 Subject: turn readMessageSizeType into readSizeTypeTag --- src/main/kotlin/NinePConnection.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/main') diff --git a/src/main/kotlin/NinePConnection.kt b/src/main/kotlin/NinePConnection.kt index ee9d5ba..392aa8e 100644 --- a/src/main/kotlin/NinePConnection.kt +++ b/src/main/kotlin/NinePConnection.kt @@ -64,15 +64,16 @@ class NinePConnection(netPackTrans: NetworkPacketTransporter) : NinePTranslator } /** - * Read the message size and type. + * Read a message size, type, and tag. * - * @return A pair in which the first element is the message size in bytes and the second is the message type as a - * [NinePMessageType] constant. + * @return A triple in which the first element is the message size in bytes, the second is the message type as a + * [NinePMessageType] constant, and the third element is the message tag. */ - private fun readMessageSizeType(): Pair { - return Pair( + private fun readSizeTypeTag(): Triple { + return Triple( readInteger(4).toInt().toUInt(), - NinePMessageType.fromByte(readInteger(1).toByte()) + NinePMessageType.fromByte(readInteger(1).toByte()), + readInteger(2).toInt().toUInt() ) } -- cgit v1.2.3