diff options
Diffstat (limited to 'src')
-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() ) } |