Jump to navigation Jump to search
19 bytes removed ,  14:55, 18 October 2018
%ws:message('/', '{$message}')
function example:message(
$message as xs:string
) as empty-sequence() {
In the function above the WebSocketModule function <code>emit</code> is used for forwarding the message to all connected clients. Notice that you have to import the [[WebSocket Module]] before using it.
It With the code above it is possible now to write implement client functions which -side functionality to connect to a WebSocket, and send messages to the WebSocket and /receive messages from via the WebSocket. The following Following client example provides -side code shows basic code for handling usage of the WebSocket connection.:
There are no heart-beats heartbeats in this example. This means that the connection is terminated if nothing happens for 5 minutes (standard timeout).
If you send a message which exceeds the textsize of 3kb defined in the <code>web.xml</code> the connection gets closed too.
administrator, Bureaucrats, editor, reviewer, Administrators


Navigation menu