PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • 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 "WIN_RPCClient" window
Event(Received_Event, "WIN_RPCClient", "Received")
// Client side: sending 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)
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment