Changes

Jump to navigation Jump to search
1,437 bytes added ,  12:15, 27 September 2018
no edit summary
</pre>
=General Functions=
==ws:id==
|-
| '''Summary'''
|Returns the ID of the current WebSocket client.
|}
|-
| '''Summary'''
|Returns the ids of all currently registered WebSocket clients.
|}
|-
| '''Summary'''
|Returns the path of the WebSocket client with the specified {{Code|$id}}.
|}
 
==ws:close==
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|ws:close|$id as xs:string|empty-sequence()}}
|-
| '''Summary'''
|Closes the connection of the WebSocket with the specified {{Code|$id}}.
|}
 
=Sending Data=
==ws:send==
|}
=WebSocket Attributes= ==ws:get== {| width='100%'|-| width='120' | '''Signatures'''|{{Func|ws:get|$id as xs:string, $name as xs:string|item()*}}<br/>{{Func|ws:get|$id as xs:string, $name as xs:string, $default as item()*|item()*}}|-| '''Summary'''|Returns the value of an attribute with the specified {{Code|$name}} from the WebSocket with the specified {{Code|$id}}. If the attribute is unknown, an empty sequence or the optionally specified {{Code|$default}} value will be returned instead.|} ==ws:set== {| width='100%'|-| width='120' | '''Signatures'''|{{Func|ws:set|$id as xs:string, $name as xs:string, $value as item()*|empty-sequence()}}|-| '''Summary'''|Returns the specified {{Code|value}} of the attribute with the specified {{Code|$name}} from the WebSocket with the specified {{Mono|$id}}.|-| '''Errors'''|{{Error|set|#Errors}} The supplied value cannot be materialized.|} ==ws:closedelete==
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|ws:closedelete|$id as xs:string, $name as xs:string|empty-sequence()}}
|-
| '''Summary'''
|Closes Deletes an attribute with the connection of specified {{Code|$name}} from the WebSocket client with the specified {{CodeMono|$id}}.
|}
* A JSON response is generated, which contains the message string.
* This response will be sent to all connected clients (including the calling client).
 
=Errors=
 
{| class="wikitable" width="100%"
! width="110"|Code
|Description
|-
|{{Code|set}}
|The supplied value cannot be materialized.
|-
|{{Code|not-found}}
|The specified WebSocket was not found.
|}
 
=Changelog=
 
This module was introduced with Version 9.1.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu