How to close a web socket connection by server?

Hello guys, i have a question. How to close connection by server? I asked this on stackoverflow , but still there are no answers. Link: kotlin - Akka. How to close a websocket connection from server? - Stack Overflow

In general completing/cancelling or failing the handling flow should close the connection to the client. So for example Flow.take, Flow.takeWhile for more declarative close or KillSwitch for imperative close.

How to complete Source.actorRef specifically, see the docs here: Source.actorRef • Akka Documentation

1 Like