SPI Programming Manual (G06.24+, H06.03+, J06.03+)

SPI Concepts and Protocol
SPI Programming Manual427506-006
2-3
Server Returns the Response Message
processed. The server and requester then follow the response continuation protocol in
Continued Responses on page 2-34.
By default, the subsystem returns a single response record per response message.
However, if requested, many NonStop Kernel subsystems return multiple response
records per response message. The requester sets the value of a token in the
command buffer to indicate the maximum number of response records per response
the requester is willing to accept, or to ask for as many response records as will fit in
the buffer. The subsystem then determines how many response records per response
it will send, up to the maximum number specified by the requester.
As in the case of a single response record per response, the subsystem returns a
context token in the response if not all response records for the command fit into a
single response message. The requester asks for the next group of response records
by resending a copy of the original command that includes this context token.
Server Returns the Response Message
The server returns the response message to the requester. If the server is context-free,
it retains no information about the processing it performed, and from the servers
perspective, this response completes the requester-server interaction. If not all objects
were processed (because of lack of buffer space, for example), the server stores
enough information in the context token to resume processing with the next object
based on the information returned in the context token and a copy of the original
command.
Requester Examines the Response
Upon receiving the response, the requester resets the buffer using the special SSPUT
operation ZSPI-TKN-RESET-BUFFER to avoid problems arising from differing
requester and server buffer sizes.
The requester checks the value of the return code in each response record. If an error
occurs, the response code is nonzero and the response record contains an error list
with an error token containing the same nonzero error number.
If the response contains a context token, the requester can continue processing by
copying the context token to a copy of the original command and returning it to the
server, which then resumes processing.
Tokens
All information in SPI messages is in the form of tokens and their values. Aside from
error checking and message validation, most of the SPI-related processing performed
by requesters and servers involves placing tokens in messages and retrieving token
values from messages. The primary function of the SPI procedures is to manipulate
tokens: the SSPUT procedure adds tokens to a message, SSGET retrieves token
values from a message, SSMOVE copies tokens from one message buffer to another,
and SSNULL initializes token values.