Initial commit

This commit is contained in:
2026-08-06 01:03:27 +01:00
commit aa74300efb
20 changed files with 685 additions and 0 deletions
@@ -0,0 +1,22 @@
package com.shr4pnel.ferretirc.net
import io.ktor.network.sockets.Socket
import io.ktor.network.sockets.openWriteChannel
import io.ktor.utils.io.ByteWriteChannel
import io.ktor.utils.io.writeFully
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
class MessageWriter(socket: Socket, scope: CoroutineScope): MessageIO(socket, scope) {
private lateinit var send: ByteWriteChannel
override suspend fun start() {
send = socket.openWriteChannel()
scope.launch {
for (msg in outgoingMessages) {
send.writeFully(msg.toWire())
send.flush()
}
}
}
}