|Page 457 of 800||Search internet|
The get and got messages allow a client to query the state of the server.
The state of the server associates values to addresses where values as well as addresses are bit vectors. For each address, the state may store values of several classes (at present, the classes are 'update', 'type', 'left', 'right', 'sibling', 'url', and 'leap', c.f. the definition of 'class identifiers' above).
Furthermore, for each address and class, the state may associate more than one value, in which case each value is identified by an 'index' which is a cardinal. The indexing is chronological such that the value with index 1 is the oldest, the one with index 2 is the second oldest and so on. When requesting a value with index zero or an index larger than the number of values on store, the Logiweb server provides the newest available value.
A get message contains an address, a class, and an index, and asks the server to provide the associated value. If a Logiweb server is too pressed to respond to a get message, it should send a 'sorry' event response. Otherwise, it should respond with a got message.
A got message contains many fields. First, it contains the address, class, and index of the get message.
If the state of the server did contain values for the given address and class, then the got message contains the following: The 'length' field is a copy of the 'length' field of the given 'address'. The 'attribute-count' field contains the total number of attributes with the given address and class. The 'value' field contains the returned value. The 'timestamp' field indicates the time at which that value entered the state of the server. If the requested index is between one and attribute-count, inclusive, then the returned value is the n'th-oldest value on the given address of the given class where n is the value of the given 'index'. Otherwise, the returned value is the newest value on store.
If the state of the server did not contain values for the given address and class, but the server did contain a node for the given address, then the got message contains the following: The 'length' field is a copy of the 'length' field of the given 'address'. The 'attribute-count' field is zero. The 'value' field contain the empty bit-vector. The 'timestamp' field is the current server time.
If the state did not contain a node for the given address, then the server finds the longest prefix of the address for which the server does have a node. Call that node the 'closest node'. In that case, the got message contains the following: The 'length' field is the length of the prefix. The 'attribute-count' field is the number of sibling attributes of the closest node. If the closest node has no sibling attributes, then the 'value' field is the empty bit-vector and the 'timestamp' field contains the current server time. Otherwise, the 'value' field contains a random among the sibling attributes and the 'timestamp' field contains the timestamp of that attribute.
In the last possibility above, the got message is used to redirect the client to another Logiweb server. When being redirected from server to server, the 'length' field should be strictly increasing for each redirection.
|Page 457 of 800||Search logiweb.eu|