- 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 PROCÉDURE Received_Event() Message("Message ""received"" sent by sever")
// On the server Event(MessageReception, "*.*", "MyMessage")
// MessageReception procedure PROCÉDURE MessageReception() Message("Message received") ... NetClientSendMessage(ServerID, "Received", 0, 0)
This page is also available for…
|
|
|
|