lm-sistemi-software-distrib.../src/main/kotlin/drills/drill01/exercise2/Client.kt

20 lines
378 B
Kotlin

package drills.drill01.exercise2
import util.rmi.Client
fun main() {
Client(clientHandler).start()
}
val clientHandler = {
val ps = Client.lookup("printservice") as PrintService
println("Enter a string. Enter the character '.' to exit.")
var line = readLine() ?: "."
while (line != ".") {
ps.print(line)
line = readLine() ?: "."
}
}