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

20 lines
378 B
Kotlin
Raw Normal View History

2020-03-19 18:47:14 +00:00
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() ?: "."
}
}