summaryrefslogtreecommitdiff
path: root/src/main/kotlin/NinePConnection.kt
diff options
context:
space:
mode:
authorEdoardo La Greca2025-06-18 19:14:50 +0200
committerEdoardo La Greca2025-06-18 19:14:50 +0200
commit5a2c35806d78d12d60d49511af2da6a21a91964b (patch)
tree2f1d2d9cd11976e6b488a022ec1d0c5f322a48dd /src/main/kotlin/NinePConnection.kt
parent13421c537773cae59a4ca1fcc798ed3820634139 (diff)
add all source code
Diffstat (limited to 'src/main/kotlin/NinePConnection.kt')
-rw-r--r--src/main/kotlin/NinePConnection.kt32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/kotlin/NinePConnection.kt b/src/main/kotlin/NinePConnection.kt
new file mode 100644
index 0000000..8514ffd
--- /dev/null
+++ b/src/main/kotlin/NinePConnection.kt
@@ -0,0 +1,32 @@
+import java.io.IOException
+
+/**
+ * This class represents a 9P connection. It provides a practical implementation with networking to the 9P methods
+ * described in [NinePTranslator]. Details about methods related to 9P can be found in [NinePTranslator]. Remember to
+ * disconnect using [disconnect] after use.
+ *
+ * Details about network-related topics can be found in [NetworkPacketTransporter] and the implementation of choice.
+ *
+ * Details about 9P messages and methods can be found in [NinePTranslator].
+ *
+ * @param netPackTrans The networking API backend of choice.
+ *
+ * @throws UnresolvableHostException if the host resolution made by [netPackTrans] failed.
+ */
+class NinePConnection(netPackTrans: NetworkPacketTransporter) : NinePTranslator {
+ /**
+ * Networking API.
+ */
+ val npt: NetworkPacketTransporter = netPackTrans
+
+ /**
+ * Disconnect from the remote host,
+ *
+ * @throws IOException if an I/O error occurred while closing the socket.
+ */
+ fun disconnect() {
+ this.npt.close()
+ }
+
+ // TODO: implement methods from NinePTranslator
+} \ No newline at end of file