cleaned up tcpserver.lyng/2

This commit is contained in:
Sergey Chernov 2026-04-09 18:28:59 +03:00
parent 805c54a408
commit 73ec8f9be6

View File

@ -13,8 +13,7 @@ launch {
val client = server.accept() val client = server.accept()
launch { launch {
try { try {
val source = client.readLine() client.readLine()?.let { source ->
if( source != null ) {
client.writeUtf8("pong: $source\n") client.writeUtf8("pong: $source\n")
client.flush() client.flush()
} }
@ -37,7 +36,6 @@ val replies = (0..<clientCount).map { index ->
socket.flush() socket.flush()
val reply = socket.readLine() val reply = socket.readLine()
assertEquals("pong: $payload", reply) assertEquals("pong: $payload", reply)
reply
} finally { } finally {
socket.close() socket.close()
} }