8WebSocket Scripting - Mouse DemonstrationE
FfL
WebSocket Scripting  —  Mouse Demonstration
Clients:[closed]

y
Description [+]
*
H

This example illustrates the fine granularity of the asynchronous,?bi-directional network channel provided by a WebSocket.

E

To begin, move the mouse over the [closed] indicator. A WebSocketOconnection will be established with the server-side application (script). ThisMapplication handles multiple, concurrent clients. Your connection hasKthe IP address underlined. The mouse position of all connected clients isJdisplayed to each client. With each mouse movement on the page the cursorKposition is sent to the application where it updates that client's status. KWith each client update all connected clients have the revised mouseMposition display updated. To help manage potential bandwidth consumption the@update rate is explicitly limited at both client and server.

N

If left unused the WebSocket is disconnected by the server-side applicationKand can be restarted by moving the mouse over the [disconnected] indicator.A

This demonstration is JavaScript-driven at the browser end

K

WASD_ROOT:[SRC.WEBSOCKET]WS_MOUSE.HTML

P

and uses a WebSocket protocol application (script) at the WASD server end

K

WASD_ROOT:[SRC.WEBSOCKET]WS_MOUSE.C

K

All of these interactions can be observed using the WASD WATCH facility;-[x]CGI, [x]DCL and [x]Network Data items.


y
Configuration [+]
)
N

The script is a native WebSocket protocol application and so the executable5should only need placing in the script directory.

O

To effectively display multiple clients the script must rely on there beingIonly a single instance of it executing (a particular issue when employingOmultiple WASD instances). Generally the server will only need to instantiate aEsingle WS_MOUSE script to handle multiple clients, however there is aMsmall window when the client request is being accepted by the script where itis unavailable.