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()
|
||||
}.fold(
|
||||
onSuccess = { line ->
|
||||
if (line != null) {
|
||||
log("received '$line' from ${socket.description()}")
|
||||
when (line) {
|
||||
null -> {
|
||||
log("received 'null' from ${socket.description()} - closing connection")
|
||||
socket.close()
|
||||
}
|
||||
else -> log("received '$line' from ${socket.description()}")
|
||||
}
|
||||
line
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue