next up previous contents index
Next: Communication with TACO Up: The Implementation Previous: Fault-Tolerance   Contents   Index

Client/Server Communication

The server and the client communicates by sending messages of the type pmessage defined as:

typedef struct pmessage_struct {
  int status;              /* status */
  int request;             /* request or reply */
  long t;                  /* time */
  long ret;                /* readlock expiration time */
  long wet;                /* writelock expiration time */
  long ct;                 /* consistency time */
  long cct;                /* consistency check time */
  long mt;                 /* modification time */
  long crt;                /* client receive time */
  char name[PATHNAME_MAX]; /* filename */
} pmessage;

pmessage buf;

The server knows (handles) the following requests in buf.request: READ_ OPEN, WRITE_OPEN, SEND_FILE, RECV_FILE, READ_LOCK, WRITE_LOCK, READ_ UNLOCK, WRITE_UNLOCK, TELL_TIME, REMOVE_FILE, RENAME_FILE, READ_CLOSE, WRITE_CLOSE, and SEND_STAT defined in "pesto.h".

For all the above requests, the server replies with a status in buf.status of NOT_OK if something went wrong or OK otherwise. If the status is OK then the reply is found in buf.request and will be one of the following: CONSISTENT, INCONSISTENT, NOTFOUND, NOTLOCKED, ISLOCKED, ISUNLOCKED, WASLOCKED, WASUNLOCKED, WASREMOVED, WASRENAMED, DOSEND, WILLSEND, or WASFOUND defined in "pesto.h".

Each request is answered with a reply. If the reply is DOSEND or WILLSEND then a file is subsequentially send from the client to the server or vice versa.