summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/kotlin/Connection.kt8
-rw-r--r--src/main/kotlin/ProtocolTranslator.kt5
2 files changed, 5 insertions, 8 deletions
diff --git a/src/main/kotlin/Connection.kt b/src/main/kotlin/Connection.kt
index cde7863..5fabf83 100644
--- a/src/main/kotlin/Connection.kt
+++ b/src/main/kotlin/Connection.kt
@@ -107,7 +107,7 @@ class Connection(transLay: TransportLayer) : ProtocolTranslator {
TODO("Not yet implemented")
}
- override fun flush(oldtag: UShort): String? {
+ override fun flush(oldtag: UShort) {
val omsg = OutMessage(NinePMessageType.TFLUSH, this.tagGen.generate(), listOf("oldtag"),
mapOf(
"oldtag" to BigInteger(oldtag.toString())
@@ -117,11 +117,7 @@ class Connection(transLay: TransportLayer) : ProtocolTranslator {
this.maxSize
)
omsg.write(this.tl)
- val checkErr = checkedInMessage(omsg.tag)
- if (checkErr.first != null) {
- return checkErr.first
- }
- return null
+ val imsg = checkedInMessage(omsg.tag)
}
override fun attach(fid: UInt, afid: UInt, uname: String, aname: String): String? {
diff --git a/src/main/kotlin/ProtocolTranslator.kt b/src/main/kotlin/ProtocolTranslator.kt
index 68dde3e..eb13fc2 100644
--- a/src/main/kotlin/ProtocolTranslator.kt
+++ b/src/main/kotlin/ProtocolTranslator.kt
@@ -43,9 +43,10 @@ interface ProtocolTranslator {
* Abort a message.
*
* @param oldtag The tag of the message that needs to be purged.
- * @return a possible error.
+ * @throws except.InvalidMessageException if the received message is invalid.
+ * @throws except.RErrorException if the received message is an R-error message.
*/
- fun flush(oldtag: UShort): String?
+ fun flush(oldtag: UShort)
/**
* Establish a connection.