ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / WebSocket
  • Execution contexts
  • Asynchronous operating mode
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
WebSocketExecuteGlobalService (Function)
In french: WebSocketExécuteServiceGlobal
Executes a global procedure in the context of the global service of the WebSocket server.
Example
// Le client vient de se connecter.
// Il se déclare dans le tableau des clients disponibles pour jouer.
WebSocketExecuteGlobalService(ConnexionClient, clClient)

//=======================
// Procédure globale
PROCEDURE ConnexionClient(clClient is websocketClient)
	// Utilise le client.
Syntax
WebSocketExecuteGlobalService(<WLanguage procedure> [, <Parameters>])
<WLanguage procedure>: Procedure name
Name of the global WLanguage procedure to be executed in the context of the global service.
<Parameters>: List of values enclosed in brackets, separated by commas
Parameters of the procedure. This list of parameters has the following format:
(<Parameter 1>, ..., <Parameter N>)
where:
  • <Parameter 1> is the first parameter of the procedure.
  • ...
  • <Parameter N> is the nth parameter of the procedure.
Caution:
  • Parameters are passed by value.
  • Only simple types are allowed: Boolean, integer, ... For example, it is not possible to have a parameter corresponding to an instance of class.
Remarks

Execution contexts

The global service of the WebSocket server and the connected clients are executed independently. Each is executed in its own context with:
  • its own copy of global variables.
  • its own database context.
  • etc.
Therefore, it is not possible to handle the global context or the context of another client.
WebSocketExecuteGlobalService is used to execute the global WLanguage procedure passed as parameter in the context of the global service. During the execution of the global procedure, the global variables will be those of the global service.
The global procedure is called between two calls of the "Global service" event (called in loop). There must be enough time between the calls to this event, otherwise the procedure will never be called. This interval can be configured via the <interval=<Duration>> extension attribute. For more details, see Use WebSockets with the WebSocket server.

Asynchronous operating mode

Asynchronous operation: the function simply requests execution of the Procedure. The procedure can actually be executed later (after WebSocketExecuteGlobalService has been executed). WebSocketExecuteGlobalService never returns an error (for example, if the client has been disconnected in the meantime).
Business / UI classification: Business Logic
Component: wd300awws.dll
Minimum version required
  • Version 26
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help