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

bbaldino

05/02/2022, 9:56 PM
In the websocket example (on this page) it states that:
In this sample, the infinite loop is only exited with an exception is risen: either a ClosedReceiveChannelException or another exception.
but when I do a test with postman and hit “disconnect” on the postman side, no exception is thrown in ktor: instead the
for (frame in incoming)
loop just exits. Is this also a possible “close” behavior?
d

David

05/03/2022, 6:41 AM
You will need to send a closing message from the client. Then the server, when it receives that message, should actively close the session.
b

bbaldino

05/03/2022, 3:48 PM
Ok, maybe postman isn’t doing that on its disconnect.
33 Views