diff options
author | Edoardo La Greca | 2025-07-24 21:32:15 +0200 |
---|---|---|
committer | Edoardo La Greca | 2025-07-24 21:32:15 +0200 |
commit | c4362fd9b2b93fe9067ad9cb03f07dc6ebfb907b (patch) | |
tree | 8e6a4722c6495b1d392a4c4239680ba61f419bae /src/main | |
parent | f777bac87f09bb4b24201ef34103caca1c2872c2 (diff) |
turn readMessageSizeType into readSizeTypeTag
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/kotlin/NinePConnection.kt | 13 |
1 files changed, 7 insertions, 6 deletions
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<UInt, NinePMessageType> { - return Pair( + private fun readSizeTypeTag(): Triple<UInt, NinePMessageType, UInt> { + return Triple( readInteger(4).toInt().toUInt(), - NinePMessageType.fromByte(readInteger(1).toByte()) + NinePMessageType.fromByte(readInteger(1).toByte()), + readInteger(2).toInt().toUInt() ) } |