The Network Values service is designed to transfer values for any module around the system, and retain those values between starts for the application and instantiations of the module. The scheme used by the Network Values service is outlined below.
1. DBSystem is created, containing Registered names concatenated with variable names, which are separated by a plus sign (+). The Registered names are also stored in the same DBSystem. Their value is the head of the list of Monitor modules. The values are saved in packed streams in files by the same name as the concatenated name. The retained registered names array also contains the version number for each value. The revision number is always incremented, and is a retained value.
2. RPC Synchronization is done, and Started is set.
3. The host module must wait for NetworkValues\Started.
4. Register(Obj, Name) is a subroutine that launches Monitor. Register performs a ListVars on Obj to get all class ? variables that will be distributed through remote procedure calls. It then launches sufficient Monitor modules to handle the number of variables. It also sets current values of variables from DBSystem before returning.
5. Monitor links itself onto a list wherein the registered name is the name of a variable in the RegisterNamesDB containing the object value of the head of the list. The list is self-repairing, and not ordered.
6. Monitor watches for changes in simple values and 1 dimensional array of values for the variables and then checks if the current value is different from the DBSystem value. If different, an RPC message to the server is sent to set the new value.
7. The server sends the SetValues message to all clients and itself.
8. The persistent values are stored in a directory called NetworkValues. Each value has its own file. Each file is a member of a linked list whose head is NetworkHead, and is sorted by the Revision number. This allows the GetServerChanges to easily get the most recent values.
9. SetValues sets the value in the DBSystem, writes the value to the corresponding file for the name, walks through the list of Monitor modules for the registered name, and sets the variable in each of the registering modules.
10. If a registering module stops, the Monitor automatically stops since it has been called from the registering module.
Note: The RAM used for an actively monitored value ranges from about 550 bytes when 8 or more variables are in the module, to about 1500 when only one variable is in the module.