https://kotlinlang.org logo
#ktor
Title
# ktor
h

hinst

09/16/2017, 10:16 AM
call.respond(LocalFileContent(file))
I wonder if its possible to check whether client received whole file or cancelled ?
o

orangy

09/18/2017, 7:38 AM
@cy
c

cy

09/18/2017, 8:57 AM
@hinst there is no robust way to do that however in most cases it should be ChannelWriteException thrown that could be caught and handled. You also can try to use respond with timeout (to ensure that the connection hadn't get stuck,
withTimeout(...) { respond(file) }
however it is not so cheap as it requires timeout scheduling