4D v14.3REGISTER CLIENT |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
REGISTER CLIENT
REGISTER CLIENT
The REGISTER CLIENT command “registers” a 4D client station with the name specified in clientName on 4D Server, so as to allow other clients or eventually 4D Server (by using stored methods) to execute methods on it by using the EXECUTE ON CLIENT command. Once it is registered, a 4D client can then execute one or more methods for other clients. Notes:
When this command is executed, a process, named clientName, is created on the client station. This process can only be aborted by the UNREGISTER CLIENT command. Compatibility Note: Since version 11.3 of 4D, the server/client communication mechanisms have been optimized. Now the server sends execution requests directly to the registered clients when necessary (technology "push"). The previous principle where clients queried the server periodically is no longer used. The period parameter is ignored if it is passed. Once the command is executed, it is not possible to modify a 4D client’s name on the fly. To do so, you must call the UNREGISTER CLIENT command, then the REGISTER CLIENT command. In the following example, we are going to create a small messaging system that allows the client workstations to communicate between themselves. 1) This method, Registration, allows you to register a 4D client and to keep it ready to receive a message from another 4D client: `You must unregister before registering under another name 2) The following instruction allows you to get a list of the registered clients. It can be placed in the On Startup Database Method: PrClientList:=New process("4D Client List";32000;"List of registered clients") 3) The method 4D Client List allows you to recuperate all the registered 4D clients and those that can receive messages: If(Application type=4D Remote Mode) 4) The following method allows you to send a message to another registered 4D client. It calls the Display_Message method (see below). $Addressee:=Request("Addressee of the message:";"") 5) Here is the Display_Message method: 6) Finally, this method allows a client station to no longer be visible by the other 4D clients and to no longer receive messages: If the 4D client is correctly registered, the OK system variable is equal to 1. If the 4D client was already registered, the command doesn’t do anything and OK is equal to 0. |
PROPERTIES
Product: 4D
HISTORY
Modified: 4D v11 SQL Release 3 SEE ALSO
EXECUTE ON CLIENT ARTICLE USAGE
4D Language Reference ( 4D v12.4) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||