close socket if null received
This commit is contained in:
parent
412cf15097
commit
d9e9e1af7d
1 changed files with 6 additions and 2 deletions
|
|
@ -64,8 +64,12 @@ class SyslogSocketServer(
|
||||||
channel.readUTF8Line()
|
channel.readUTF8Line()
|
||||||
}.fold(
|
}.fold(
|
||||||
onSuccess = { line ->
|
onSuccess = { line ->
|
||||||
if (line != null) {
|
when (line) {
|
||||||
log("received '$line' from ${socket.description()}")
|
null -> {
|
||||||
|
log("received 'null' from ${socket.description()} - closing connection")
|
||||||
|
socket.close()
|
||||||
|
}
|
||||||
|
else -> log("received '$line' from ${socket.description()}")
|
||||||
}
|
}
|
||||||
line
|
line
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue