clojurewebsocketclojurescriptchord

Clojurescript chord - how to close WebSocket connection?


Using Chord I can successfully open a Clojurescript socket connection in the browser.

The documentation and accompanying example however don't seem to list any options for closing that connection. Does anyone know how this should be done?


Solution

  • The Chord docs do actually show a way to close the connection, albeit on the server.

    The solution is to pass the open channel to the aysnc close! function. This is a generic channel operation and is not specific to Chord.

    (close! channel)