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

brabo-hi

02/20/2022, 4:03 AM
hi all, i am having issue closing a client . i keep receiving messages event though i called
client.close()
Copy code
client.wss() {
    incoming.consumeAsFlow().onCompletion{
          // never stops receiving even after closing connection with `client.close()`
    }
}
a

Aleksei Tirman [JB]

02/20/2022, 9:45 AM
Does it work if you close a WebSocket session instead of a client?
b

brabo-hi

02/20/2022, 4:35 PM
How can i properly close the websocket session?
a

Aleksei Tirman [JB]

02/20/2022, 5:18 PM
In the scope of
client.wss() {
variable
this
references the current WebSocket session. You can call the
close
method to close a session.