The WebSocket object provides the API for creating and managing WebSocket connection to a server, as well as for sending and data on the connection.
The WebSocket object provides the API for creating and managing WebSocket connection to a server, as well as for sending and data on the connection.
(binary-type this)
Property.
The WebSocket.binaryType property returns the type of binary being transmitted by the connection.
var binaryType = aWebSocket.binaryType;
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/binaryType
Property. The WebSocket.binaryType property returns the type of binary being transmitted by the connection. `var binaryType = aWebSocket.binaryType;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/binaryType`
(buffered-amount this)
Property.
The WebSocket.bufferedAmount read-only property returns the number bytes of data that have been queued using calls to send() but yet transmitted to the network. This value resets to zero once queued data has been sent. This value does not reset to zero the connection is closed; if you keep calling send(), this will to climb.
var bufferedAmount = aWebSocket.bufferedAmount;
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/bufferedAmount
Property. The WebSocket.bufferedAmount read-only property returns the number bytes of data that have been queued using calls to send() but yet transmitted to the network. This value resets to zero once queued data has been sent. This value does not reset to zero the connection is closed; if you keep calling send(), this will to climb. `var bufferedAmount = aWebSocket.bufferedAmount;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/bufferedAmount`
(close this)
Method.
The WebSocket.close() method closes the web.WebSocket
connection
connection attempt, if any. If the connection is already CLOSED,
method does nothing.
WebSocket.close();
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close
Method. The WebSocket.close() method closes the `web.WebSocket` connection connection attempt, if any. If the connection is already CLOSED, method does nothing. `WebSocket.close();` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close`
Constructor.
The WebSocket() constructor returns a new web.WebSocket
object.
url The URL to which to connect; this should be the URL to which the WebSocket server will respond. protocols Optional Either a single protocol string or an array of protocol strings. These strings are used to indicate sub-protocols, so that a single server can implement multiple WebSocket sub-protocols (for example, you might want one server to be able to handle different types of interactions depending on the specified protocol). If you don't specify a protocol string, an empty string is assumed.
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/WebSocket
Constructor. The WebSocket() constructor returns a new `web.WebSocket` object. url The URL to which to connect; this should be the URL to which the WebSocket server will respond. protocols Optional Either a single protocol string or an array of protocol strings. These strings are used to indicate sub-protocols, so that a single server can implement multiple WebSocket sub-protocols (for example, you might want one server to be able to handle different types of interactions depending on the specified protocol). If you don't specify a protocol string, an empty string is assumed. See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/WebSocket`
(extensions this)
Property.
The WebSocket.extensions read-only property returns the extensions by the server. This is currently only the empty string or a list extensions as negotiated by the connection.
var extensions = aWebSocket.extensions;
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/extensions
Property. The WebSocket.extensions read-only property returns the extensions by the server. This is currently only the empty string or a list extensions as negotiated by the connection. `var extensions = aWebSocket.extensions;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/extensions`
(onclose this)
Property.
The WebSocket.onclose property is an web.EventHandler
that
called when the WebSocket connection's web.readyState
changes
web.CLOSED
. It is called with a web.CloseEvent
.
aWebSocket.onclose = function(event) { console.log(\"WebSocket is closed now.\"); };
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onclose
Property. The WebSocket.onclose property is an `web.EventHandler` that called when the WebSocket connection's `web.readyState` changes `web.CLOSED`. It is called with a `web.CloseEvent`. `aWebSocket.onclose = function(event) { console.log(\"WebSocket is closed now.\"); };` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onclose`
(onerror this)
Property.
The web.WebSocket
interface's onerror event handler property
a function which gets called when an error occurs on the WebSocket.
webSocket.onerror = eventHandler;
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onerror
Property. The `web.WebSocket` interface's onerror event handler property a function which gets called when an error occurs on the WebSocket. `webSocket.onerror = eventHandler;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onerror`
(onmessage this)
Property.
The WebSocket.onmessage property is an web.EventHandler
that
called when a message is received from the server. It is called
a web.MessageEvent
.
aWebSocket.onmessage = function(event) { console.debug(\"WebSocket message received:\", event); };
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onmessage
Property. The WebSocket.onmessage property is an `web.EventHandler` that called when a message is received from the server. It is called a `web.MessageEvent`. `aWebSocket.onmessage = function(event) { console.debug(\"WebSocket message received:\", event); };` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onmessage`
(onopen this)
Property.
The WebSocket.onopen property is an web.EventHandler
that is
when the web.WebSocket
connection's web.readyState
changes
web.OPEN
; this indicates that the connection is ready to send
receive data. It is called with an web.Event
.
aWebSocket.onopen = function(event) { console.log(\"WebSocket is open now.\"); };
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onopen
Property. The WebSocket.onopen property is an `web.EventHandler` that is when the `web.WebSocket` connection's `web.readyState` changes `web.OPEN`; this indicates that the connection is ready to send receive data. It is called with an `web.Event`. `aWebSocket.onopen = function(event) { console.log(\"WebSocket is open now.\"); };` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onopen`
(protocol this)
Property.
The WebSocket.protocol read-only property returns the name of
sub-protocol the server selected; this will be one of the strings
in the protocols parameter when creating the web.WebSocket
or the empty string if no connection is established.
var protocol = aWebSocket.protocol;
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/protocol
Property. The WebSocket.protocol read-only property returns the name of sub-protocol the server selected; this will be one of the strings in the protocols parameter when creating the `web.WebSocket` or the empty string if no connection is established. `var protocol = aWebSocket.protocol;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/protocol`
(ready-state this)
Property.
The WebSocket.readyState read-only property returns the current
of the web.WebSocket
connection.
var readyState = aWebSocket.readyState;
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/readyState
Property. The WebSocket.readyState read-only property returns the current of the `web.WebSocket` connection. `var readyState = aWebSocket.readyState;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/readyState`
(send this & args)
Method.
The WebSocket.send() method enqueues the specified data to be to the server over the WebSocket connection, increasing the value bufferedAmount by the number of bytes needed to contain the data. the data can't be sent (for example, because it needs to be buffered the buffer is full), the socket is closed automatically.
WebSocket.send(\"Hello server!\");
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send
Method. The WebSocket.send() method enqueues the specified data to be to the server over the WebSocket connection, increasing the value bufferedAmount by the number of bytes needed to contain the data. the data can't be sent (for example, because it needs to be buffered the buffer is full), the socket is closed automatically. `WebSocket.send(\"Hello server!\");` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send`
(set-binary-type! this val)
Property.
The WebSocket.binaryType property returns the type of binary being transmitted by the connection.
var binaryType = aWebSocket.binaryType;
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/binaryType
Property. The WebSocket.binaryType property returns the type of binary being transmitted by the connection. `var binaryType = aWebSocket.binaryType;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/binaryType`
(set-buffered-amount! this val)
Property.
The WebSocket.bufferedAmount read-only property returns the number bytes of data that have been queued using calls to send() but yet transmitted to the network. This value resets to zero once queued data has been sent. This value does not reset to zero the connection is closed; if you keep calling send(), this will to climb.
var bufferedAmount = aWebSocket.bufferedAmount;
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/bufferedAmount
Property. The WebSocket.bufferedAmount read-only property returns the number bytes of data that have been queued using calls to send() but yet transmitted to the network. This value resets to zero once queued data has been sent. This value does not reset to zero the connection is closed; if you keep calling send(), this will to climb. `var bufferedAmount = aWebSocket.bufferedAmount;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/bufferedAmount`
(set-extensions! this val)
Property.
The WebSocket.extensions read-only property returns the extensions by the server. This is currently only the empty string or a list extensions as negotiated by the connection.
var extensions = aWebSocket.extensions;
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/extensions
Property. The WebSocket.extensions read-only property returns the extensions by the server. This is currently only the empty string or a list extensions as negotiated by the connection. `var extensions = aWebSocket.extensions;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/extensions`
(set-onclose! this val)
Property.
The WebSocket.onclose property is an web.EventHandler
that
called when the WebSocket connection's web.readyState
changes
web.CLOSED
. It is called with a web.CloseEvent
.
aWebSocket.onclose = function(event) { console.log(\"WebSocket is closed now.\"); };
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onclose
Property. The WebSocket.onclose property is an `web.EventHandler` that called when the WebSocket connection's `web.readyState` changes `web.CLOSED`. It is called with a `web.CloseEvent`. `aWebSocket.onclose = function(event) { console.log(\"WebSocket is closed now.\"); };` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onclose`
(set-onerror! this val)
Property.
The web.WebSocket
interface's onerror event handler property
a function which gets called when an error occurs on the WebSocket.
webSocket.onerror = eventHandler;
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onerror
Property. The `web.WebSocket` interface's onerror event handler property a function which gets called when an error occurs on the WebSocket. `webSocket.onerror = eventHandler;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onerror`
(set-onmessage! this val)
Property.
The WebSocket.onmessage property is an web.EventHandler
that
called when a message is received from the server. It is called
a web.MessageEvent
.
aWebSocket.onmessage = function(event) { console.debug(\"WebSocket message received:\", event); };
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onmessage
Property. The WebSocket.onmessage property is an `web.EventHandler` that called when a message is received from the server. It is called a `web.MessageEvent`. `aWebSocket.onmessage = function(event) { console.debug(\"WebSocket message received:\", event); };` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onmessage`
(set-onopen! this val)
Property.
The WebSocket.onopen property is an web.EventHandler
that is
when the web.WebSocket
connection's web.readyState
changes
web.OPEN
; this indicates that the connection is ready to send
receive data. It is called with an web.Event
.
aWebSocket.onopen = function(event) { console.log(\"WebSocket is open now.\"); };
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onopen
Property. The WebSocket.onopen property is an `web.EventHandler` that is when the `web.WebSocket` connection's `web.readyState` changes `web.OPEN`; this indicates that the connection is ready to send receive data. It is called with an `web.Event`. `aWebSocket.onopen = function(event) { console.log(\"WebSocket is open now.\"); };` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/onopen`
(set-protocol! this val)
Property.
The WebSocket.protocol read-only property returns the name of
sub-protocol the server selected; this will be one of the strings
in the protocols parameter when creating the web.WebSocket
or the empty string if no connection is established.
var protocol = aWebSocket.protocol;
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/protocol
Property. The WebSocket.protocol read-only property returns the name of sub-protocol the server selected; this will be one of the strings in the protocols parameter when creating the `web.WebSocket` or the empty string if no connection is established. `var protocol = aWebSocket.protocol;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/protocol`
(set-ready-state! this val)
Property.
The WebSocket.readyState read-only property returns the current
of the web.WebSocket
connection.
var readyState = aWebSocket.readyState;
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/readyState
Property. The WebSocket.readyState read-only property returns the current of the `web.WebSocket` connection. `var readyState = aWebSocket.readyState;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/readyState`
(set-url! this val)
Property.
The WebSocket.url read-only property returns the absolute URL
the web.WebSocket
as resolved by the constructor.
var url = aWebSocket.url;
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/url
Property. The WebSocket.url read-only property returns the absolute URL the `web.WebSocket` as resolved by the constructor. `var url = aWebSocket.url;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/url`
(url this)
Property.
The WebSocket.url read-only property returns the absolute URL
the web.WebSocket
as resolved by the constructor.
var url = aWebSocket.url;
See also: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/url
Property. The WebSocket.url read-only property returns the absolute URL the `web.WebSocket` as resolved by the constructor. `var url = aWebSocket.url;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/url`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close