The client is simpler than the server. It is single threaded and calls server RPCs to do most work. It uses the the configuration options and error handling facilities of the SSM similar to the server use of them.
This section focuses on RPC issues.
The code for connection management is all in file client.C. The function connect_to_server connects to a server at a specific host and port. The original Sun RPC package has no direct support for this since it assumes you will use the port mapper facility. However, the Shore version of the package has a clnt_create_port function that could replace most of the code in connect_to_server.
The function disconnect_from_server demonstrates how to end a session with the server.
The client-side stubs for the RPCs are generated by rpcgen and placed in msg_clnt.c. Recall that we wrap the RPCs in C++ methods from the command_base_t abstract base class. From that class we derive command_client_t and implement the methods by calling the RPC stubs.
In client.C the function process_user_commands creates an command_client_t object, reads lines from standard input, and calls command_client_t::parse_command for each line. Method parse_command in turn calls the command_client_t wrapper methods.