Coral Client Programmer Guide Wei Xiao August 9, 1994. This document provides information on how to write a client program that behaves well in the client/server coral environment. It is vital but not complete in itself. The programmer is suggested to study the sample client program "CoralClient.C", and "CoralServer.C". 1. Overview. =========== When the first client program connected with coral, it is assumed to be the default user, in the default work space, with a default number of answers per query assigned. He then use the login() command to identify himself to coral, and get a user id, and a key. Each query the client given to coral is suspended(paused) after the number of answers per query has given. An id is given for each suspended query. Then the client can use resume() command to restart the query. When there are many clients connected to coral, each client should login first, get their user id and key; then each creates its own workspace, assign its own value of number of answers per query via answer() command; then BEFORE each command the client sends to coral, a user() command is used to tell coral to switch to the work space and change number of answers per query for this client. Currently the command is sent to coral line by line. Thus a client may send "user(id,k).other_command()." in one line to avoid interruption by another client. If there are more than one line of commands to send as a unit, the client may use "excl." and "end." command to assure solo control of the server. 2. Command Reference. ===================== answer(n) change the current user's default number of answers per querys. if no one logged in, change the default answer numbers for default user whose id is -1. answer(0). will choose the system default number of answers. kill(id) kills a suspended query by id. A user can not kill other's query list_sus() list the suspended query for the current user. list_sus(all) lists every user's. list_sus(id) lists suspended query for other user's. login("user name", "passwd") echos back a valid user id and a key, which are used later in user(id,key) builtin to identify this user. *** currently coral does not check passwd. logout(id, key) clean up and free up space for other user; there is a maximum number of users allowed. Also, in server mode, the quit() builtin is disabled, this command is followed by the disconnection by the client. resume(id). resume a suspended query. A user can only resume his own query. user(id,key) switch to certain work space, answers per query. If key is invalid, gives warning messages, and switch to default_ws. a valid is >= 0, key is a number given after login command. who() list all currently logged in users. sync or sync(num) This is a request from the client for synchronization at this point, an integer may optionally be specified for validation of the sync response.