Liking cljdoc? Tell your friends :D

ring.websocket

Protocols and utility functions for websocket support.

Protocols and utility functions for websocket support.
raw docstring

AsyncSocketcljprotocol

A protocol for sending data asynchronously via websocket. Intended for use with the Socket protocol.

A protocol for sending data asynchronously via websocket. Intended for use
with the Socket protocol.

-send-asyncclj

(-send-async socket message succeed fail)

Sends a String or ByteBuffer to the client via the websocket. If it succeeds, the 'succeed' callback function is called with zero arguments. If it fails, the 'fail' callback function is called with the exception that was thrown.

Sends a String or ByteBuffer to the client via the websocket. If it
succeeds, the 'succeed' callback function is called with zero arguments. If
it fails, the 'fail' callback function is called with the exception that was
thrown.
sourceraw docstring

BinaryDatacljprotocol

A protocol for converting binary data into a java.nio.ByteBuffer object.

A protocol for converting binary data into a java.nio.ByteBuffer object.

->byte-bufferclj

(->byte-buffer data)

Convert some binary data into a java.nio.ByteBuffer, ready to be sent as a websocket binary message.

Convert some binary data into a java.nio.ByteBuffer, ready to be sent as
a websocket binary message.
sourceraw docstring

closeclj

(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.
sourceraw docstring

Listenercljprotocol

A protocol for handling websocket events. The second argument is always an object that satisfies the Socket protocol.

A protocol for handling websocket events. The second argument is
always an object that satisfies the Socket protocol.

on-closeclj

(on-close listener socket code reason)

Called when the websocket is closed, along with an integer code and a plaintext string reason for being closed.

Called when the websocket is closed, along with an integer code and a
plaintext string reason for being closed.

on-errorclj

(on-error listener socket throwable)

Called when a Throwable error is thrown.

Called when a Throwable error is thrown.

on-messageclj

(on-message listener socket message)

Called when a message is received. The message may be a String or a ByteBuffer.

Called when a message is received. The message may be a String or a
ByteBuffer.

on-openclj

(on-open listener socket)

Called when the websocket is opened.

Called when the websocket is opened.

on-pongclj

(on-pong listener socket data)

Called when a pong is received in response to an earlier ping. The client may provide additional binary data, represented by the data ByteBuffer.

Called when a pong is received in response to an earlier ping. The client
may provide additional binary data, represented by the data ByteBuffer.
sourceraw docstring

open?clj

(open? socket)
source

pingclj

(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.
sourceraw docstring

pongclj

(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.
sourceraw docstring

sendclj

(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.
sourceraw docstring

Socketcljprotocol

A protocol for sending data via websocket.

A protocol for sending data via websocket.

-closeclj

(-close socket code reason)

Closes the socket with an integer status code, and a String reason.

Closes the socket with an integer status code, and a String reason.

-open?clj

(-open? socket)

Returns true if the socket is open; false otherwise.

Returns true if the socket is open; false otherwise.

-pingclj

(-ping socket data)

Sends a ping message to the client with a ByteBuffer of extra data.

Sends a ping message to the client with a ByteBuffer of extra data.

-pongclj

(-pong socket data)

Sends an unsolicited pong message to the client, with a ByteBuffer of extra data.

Sends an unsolicited pong message to the client, with a ByteBuffer of extra
data.

-sendclj

(-send socket message)

Sends a String or ByteBuffer to the client via the websocket.

Sends a String or ByteBuffer to the client via the websocket.
sourceraw docstring

TextDatacljprotocol

A protocol for converting text data into a String.

A protocol for converting text data into a String.

->stringclj

(->string data)

Convert some data into a String, ready to be sent as a websocket text message.

Convert some data into a String, ready to be sent as a websocket text
message.
sourceraw docstring

websocket-request?clj

(websocket-request? request)

Returns true if the request map expects a websocket response.

Returns true if the request map expects a websocket response.
sourceraw docstring

websocket-response?clj

(websocket-response? response)

Returns true if the response contains a websocket listener.

Returns true if the response contains a websocket listener.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close