Protocols and utility functions for websocket support.
Protocols and utility functions for websocket support.
(close socket)
(close socket code reason)
Closes the websocket, with an optional custom integer status code and reason string.
Closes the websocket, with an optional custom integer status code and reason string.
(open? socket)
Returns true if the Socket is open, false otherwise.
Returns true if the Socket is open, false otherwise.
(ping socket)
(ping socket data)
Sends a ping message via a websocket, with an optional byte array or ByteBuffer that may contain custom session data. A convenient wrapper for the -ping protocol method.
Sends a ping message via a websocket, with an optional byte array or ByteBuffer that may contain custom session data. A convenient wrapper for the -ping protocol method.
(pong socket)
(pong socket data)
Sends an unsolicited pong message via a websocket, with an optional byte array or ByteBuffer that may contain custom session data. A convenient wrapper for the -pong protocol method.
Sends an unsolicited pong message via a websocket, with an optional byte array or ByteBuffer that may contain custom session data. A convenient wrapper for the -pong protocol method.
(request-protocols request)
Returns a collection of websocket subprotocols from a request map.
Returns a collection of websocket subprotocols from a request map.
(send socket message)
(send socket message succeed fail)
Sends text or binary data via a websocket, either synchronously or asynchronously with callback functions. A convenient wrapper for the -send and -send-async protocol methods.
Sends text or binary data via a websocket, either synchronously or asynchronously with callback functions. A convenient wrapper for the -send and -send-async protocol methods.
(upgrade-request? request)
Returns true if the request map is a websocket upgrade request.
Returns true if the request map is a websocket upgrade request.
(websocket-response? response)
Returns true if the response contains a websocket listener.
Returns true if the response contains a websocket listener.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close