Commit 456b15f0 authored by Mygod's avatar Mygod

Ignore if connection was prematurely closed

parent 9c1426c9
......@@ -38,6 +38,7 @@ class TrafficMonitor(statFile: File) {
private val stat = ByteBuffer.wrap(buffer).order(ByteOrder.LITTLE_ENDIAN)
override fun acceptInternal(socket: LocalSocket) {
when (val read = socket.inputStream.read(buffer)) {
-1 -> return
16 -> { }
else -> throw IOException("Unexpected traffic stat length $read")
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment