AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Comunicación / WebSocket
  • Execution contexts
  • Asynchronous operating mode
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Executes a global procedure in the context of a client connected to the WebSocket server.
Ejemplo
// Retrieve list of clients
arrClients is array of websocketClient = WebSocketListConnectedClient()
// Force the call to the SetInformation procedure in each client
sInformation is string = GetInformation()
FOR EACH Client OF arrClients
	WebSocketExecute(Client, SetInformation)
	// SetInformation is a global procedure that uses the sInformation variable
END
Sintaxis
WebSocketExecute(<Client> , <WLanguage procedure> [, <Parameters>])
<Client>: websocketClient variable
Name of the websocketClient variable corresponding to the client in which the procedure will be executed.
<WLanguage procedure>: Procedure name
Name of the global WLanguage procedure to be executed in the context of the client.
<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.
Observaciones

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.
WebSocketExecute is used to execute the WLanguage procedure passed as parameter in the context of another client. During the execution of the procedure, the global variables will be those of the target client.

Asynchronous operating mode

Asynchronous operation: the function simply requests execution of the Procedure. The procedure can actually be executed later (after WebSocketExecute has been executed). WebSocketExecute never returns an error (for example, if the client has been disconnected in the meantime).
Clasificación Lógica de negocio / UI: Lógica de negocio
Componente: wd300awws.dll
Versión mínima requerida
  • Versión 26
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 28/03/2025

Señalar un error o enviar una sugerencia | Ayuda local