Changes

Jump to navigation Jump to search
1 byte removed ,  12:10, 22 October 2018
First of all, you have to ensure that the <code>WsServlet</code> is enabled in your <code>web.xml</code> file. It will be enabled if you use the standard configuration of BaseX.
For establishing a connection to the WebSocket server, it is necessary that the server provides at least one function annotated with a WebSocket annotation.  Let’s start by using the annotation <code>%ws:connect('/')</code>. In the connect function, a bidirectional communication with the client can be initialized: attributes such as the id and name of a client can be set, or a welcome message can be emitted to other connected users, and so on.
<pre class="brush:xquery">
<pre class="brush:xquery">
import module namespace ws = 'http://basex.org/modules/ws'
 
declare
%ws:message('/', '{$message}')
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu