AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Comunicación / Funciones Net
  • Example: Sending a message from the server to the client computers
NetClientSendMessage (Example)
Example: Sending a message from the server to the client computers
In the following example, the client computer sends a message to the server (NetSendMessage). This message is processed by the server (MessageReceived procedure). Then, the server notifies the client computer that the message was received (NetClientSendMessage).
The messages are managed by Event.
// On the client computer
ConnectRPC is int
ConnectRPC = NetConnect("148.61.125.245", RPCServer, "GUEST", "")
...
// Initialization code of the "WIN_RPCClient" window
Event(Received_Event, "WIN_RPCClient", "Received")
// Client side: send a message to the server
NetSendMessage(ConnectRPC, "MyMessage")
// Received_Event procedure
PROCEDURE Received_Event()
Message("Message ""received"" sent by sever")
// On the server
Event(MessageReception, "*.*", "MyMessage")
// MessageReception procedure
PROCEDURE MessageReception()
Message("Message received")
...
NetClientSendMessage(ServerID, "Received", 0, 0)
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/05/2022

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