PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
New WINDEV and WEBDEV 26 feature!
This content has been translated automatically. Click here to view the French version.
  • Execution contexts
  • Asynchronous operating mode
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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
// The client has just established the connection.
// The client is declared in the array of clients available to play.
WebSocketExecuteGlobalService( ConnectionClient, clClient)
 
//=======================
// Global procedure
PROCEDURE ClientLogin(clClient is an websocketClient)
// Uses the client.
Syntax
WebSocketExecuteGlobalService(<WLanguage procedure> [, <Parameters>])
<WLanguage procedure>: Procedure name
Name of the global Procedure WLanguage to be executed in the context of the global service.
<Parameters>: List of values enclosed in brackets and separated by commas
Parameters of the procedure. This list of parameters has the following format:
(<Parameter 1>, ..., <Parameter N>)
where:
  • <Parameter 1>: First procedure parameter.
  • ...
  • <Parameter N>: Nth procedure parameter.
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.
This parameter is only available from Update 1.
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.
It is therefore not possible to handle directly the global context or the context of another client.
The function WebSocketExecuteGlobalService is used to execute the global Procedure WLanguage passed in parameter in the context of the global service.. During the execution of the global Procedure, the global variables seen will be those of the global service.
The global Procedure is called between two calls of the event "Global Service" (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

The operating mode is asynchronous: the function simply requests the 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 : wd260awws.dll
Minimum version required
  • Version 26
This page is also available for…
Comments
Click [Add] to post a comment