Liking cljdoc? Tell your friends :D

strojure.undertow.websocket.channel

WebSocket channel API for sending and receiving messages.

WebSocket channel API for sending and receiving messages.
raw docstring

going-awayclj

(going-away)
(going-away reason)

The code 1001 indicates that an endpoint is "going away", such as a server going down or a browser having navigated away from a page.

The code `1001` indicates that an endpoint is "going away", such as a
server going down or a browser having navigated away from a page.
sourceraw docstring

missing-extensionsclj

(missing-extensions reason)

The code 1010 indicates that an endpoint (client) is terminating the connection because it has expected the server to negotiate one or more extension, but the server didn't return them in the response message of the WebSocket handshake. The list of extensions that are needed SHOULD appear in the /reason/ part of the Close frame. Note that this status code is not used by the server, because it can fail the WebSocket handshake instead.

The code `1010` indicates that an endpoint (client) is terminating the
connection because it has expected the server to negotiate one or more
extension, but the server didn't return them in the response message of the
WebSocket handshake.  The list of extensions that are needed SHOULD appear in
the /reason/ part of the Close frame. Note that this status code is not used
by the server, because it can fail the WebSocket handshake instead.
sourceraw docstring

msg-contains-invalid-dataclj

(msg-contains-invalid-data)
(msg-contains-invalid-data reason)

The code 1007 indicates that an endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 data within a text message).

The code `1007` indicates that an endpoint is terminating the connection
because it has received data within a message that was not consistent with the
type of the message (e.g., non-UTF-8 data within a text message).
sourceraw docstring

msg-too-bigclj

(msg-too-big)
(msg-too-big reason)

The code 1009 indicates that an endpoint is terminating the connection because it has received a message that is too big for it to process.

The code `1009` indicates that an endpoint is terminating the connection
because it has received a message that is too big for it to process.
sourceraw docstring

msg-violates-policyclj

(msg-violates-policy)
(msg-violates-policy reason)

The code 1008 indicates that an endpoint is terminating the connection because it has received a message that violates its policy. This is a generic status code that can be returned when there is no other more suitable status code (e.g., 1003 or 1009) or if there is a need to hide specific details about the policy.

The code `1008` indicates that an endpoint is terminating the connection
because it has received a message that violates its policy.  This is a generic
status code that can be returned when there is no other more suitable status
code (e.g., 1003 or 1009) or if there is a need to hide specific details about
the policy.
sourceraw docstring

normal-closureclj

(normal-closure)

The code 1000 indicates a normal closure, meaning that the purpose for which the connection was established has been fulfilled.

The code `1000` indicates a normal closure, meaning that the purpose for
which the connection was established has been fulfilled.
sourceraw docstring

protocol-errorclj

(protocol-error)
(protocol-error reason)

The code 1002 indicates that an endpoint is terminating the connection due to a protocol error.

The code `1002` indicates that an endpoint is terminating the connection due
to a protocol error.
sourceraw docstring

unexpected-errorclj

(unexpected-error)
(unexpected-error reason)

The code 1011 indicates that a server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.

The code `1011` indicates that a server is terminating the connection because
it encountered an unexpected condition that prevented it from fulfilling the
request.
sourceraw docstring

unsupported-dataclj

(unsupported-data)
(unsupported-data reason)

The code 1003 indicates that an endpoint is terminating the connection because it has received a type of data it cannot accept (e.g., an endpoint that understands only text data MAY send this if it receives a binary message).

The code `1003` indicates that an endpoint is terminating the connection
because it has received a type of data it cannot accept (e.g., an endpoint
that understands only text data MAY send this if it receives a binary
message).
sourceraw docstring

WebSocketSendBinarycljprotocol

send-binaryclj

(send-binary data chan opts)

Sends a complete binary message, invoking the callback when complete.

  1. data The binary data to send.
  2. chan The web socket channel of type WebSocketChannel.
  3. opts The map with options:
    • :callback The WebSocketCallback to invoke on completion.
      • The callback can be declared as map with keys:
        • :on-complete The function (fn [{:keys [callback, channel]}] ...).
        • :on-error The function (fn [{:keys [callback, channel, error]}] ...)
      • The callback can be also just a function which receives a map with keys described above.
    • :timeout The timeout in milliseconds, long. No timeout by default.
Sends a complete binary message, invoking the callback when complete.

1) `data` The binary data to send.
2) `chan` The web socket channel of type `WebSocketChannel`.
3) `opts` The map with options:
    - `:callback` The `WebSocketCallback` to invoke on completion.
        + The callback can be declared as map with keys:
            - `:on-complete` The function `(fn [{:keys [callback, channel]}] ...)`.
            - `:on-error`    The function `(fn [{:keys [callback, channel, error]}] ...)`
        + The callback can be also just a function which receives a map with
          keys described above.
    - `:timeout` The timeout in milliseconds, long. No timeout by default.

send-binary!!clj

(send-binary!! data chan)

Sends a complete binary message using blocking IO.

  1. data The binary data to send.
  2. chan The web socket channel of type WebSocketChannel.
Sends a complete binary message using blocking IO.

1) `data` The binary data to send.
2) `chan` The web socket channel of type `WebSocketChannel`.
source

WebSocketSendClosecljprotocol

send-closeclj

(send-close message chan opts)

Sends a complete close message, invoking the callback when complete.

  1. message The close message as instance of CloseMessage.

    • See helper functions to create messages above.
    • If nil then normal-closure is sent.
  2. chan The web socket channel of type WebSocketChannel.

  3. opts The map with options:

    • :callback The WebSocketCallback to invoke on completion.
      • The callback can be declared as map with keys:
        • :on-complete The function (fn [{:keys [callback, channel]}] ...).
        • :on-error The function (fn [{:keys [callback, channel, error]}] ...)
      • The callback can be also just a function which receives a map with keys described above.
Sends a complete close message, invoking the callback when complete.

1) `message` The close message as instance of `CloseMessage`.
    + See helper functions to create messages above.
    + If `nil` then [[normal-closure]] is sent.

2) `chan` The web socket channel of type `WebSocketChannel`.

3) `opts` The map with options:
    - `:callback` The `WebSocketCallback` to invoke on completion.
        + The callback can be declared as map with keys:
            - `:on-complete` The function `(fn [{:keys [callback, channel]}] ...)`.
            - `:on-error`    The function `(fn [{:keys [callback, channel, error]}] ...)`
        + The callback can be also just a function which receives a map with
          keys described above.

send-close!!clj

(send-close!! message chan)

Sends a complete close message using blocking IO.

  1. message The close message as instance of CloseMessage.

    • See helper functions to create messages above.
    • If nil then normal-closure is sent.
  2. chan The web socket channel of type WebSocketChannel.

Sends a complete close message using blocking IO.

1) `message` The close message as instance of `CloseMessage`.
    + See helper functions to create messages above.
    + If `nil` then [[normal-closure]] is sent.

2) `chan` The web socket channel of type `WebSocketChannel`.
source

WebSocketSendTextcljprotocol

send-textclj

(send-text text chan opts)

Sends a complete text message, invoking the callback when complete.

  1. text The text string to send.
  2. chan The web socket channel of type WebSocketChannel.
  3. opts The map with options:
    • :callback The WebSocketCallback to invoke on completion.
      • The callback can be declared as map with keys:
        • :on-complete The function (fn [{:keys [callback, channel]}] ...).
        • :on-error The function (fn [{:keys [callback, channel, error]}] ...)
      • The callback can be also just a function which receives a map with keys described above.
    • :timeout The timeout in milliseconds, long. No timeout by default.
Sends a complete text message, invoking the callback when complete.

1) `text` The text string to send.
2) `chan` The web socket channel of type `WebSocketChannel`.
3) `opts` The map with options:
    - `:callback` The `WebSocketCallback` to invoke on completion.
        + The callback can be declared as map with keys:
            - `:on-complete` The function `(fn [{:keys [callback, channel]}] ...)`.
            - `:on-error`    The function `(fn [{:keys [callback, channel, error]}] ...)`
        + The callback can be also just a function which receives a map with
          keys described above.
    - `:timeout` The timeout in milliseconds, long. No timeout by default.

send-text!!clj

(send-text!! text chan)

Sends a complete text message using blocking IO.

  1. text The text string to send.
  2. chan The web socket channel of type WebSocketChannel.
Sends a complete text message using blocking IO.

1) `text` The text string to send.
2) `chan` The web socket channel of type `WebSocketChannel`.
source

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

× close