22 lines
523 B
Kotlin
22 lines
523 B
Kotlin
package su.sonoma
|
|
|
|
import io.ktor.network.selector.*
|
|
import io.ktor.network.sockets.*
|
|
import io.ktor.utils.io.*
|
|
import io.ktor.utils.io.core.readBytes
|
|
import kotlinx.coroutines.*
|
|
import kotlinx.io.readByteArray
|
|
import java.io.FileInputStream
|
|
|
|
fun main(args: Array<String>) {
|
|
val host = "192.168.88.227"
|
|
val port = 9093
|
|
|
|
when (args.firstOrNull()) {
|
|
"server" -> startServer(port)
|
|
"client" -> startClient(host, port)
|
|
else -> {
|
|
println("Usage: server | client")
|
|
}
|
|
}
|
|
} |