Go to the first, previous, next, last section, table of contents.

# Networking

The Xconq networking strategy is based on having each connected program maintain a complete and accurate game state, and propagating user commands from one of the programs to all others. Thus all programs are equal; but in order to serialize multiple simultaneous user commands, one of the programs is a "first among equals" called the master. If a player interacting with a non-master clicks to move, then the command actually just goes to the master and doesn't actually happen until the master propagates the command to all programs.

The high-level protocol for all this is part of the Xconq kernel, and includes buffering, checksum, and other features. The OS interface code need only provide definitions for these functions:

- `void open_remote_connection(char *methodname)` establishes a connection to another program, using information supplied in `methodname`.
- `void low_send(int id, char *buf)` sends the contents of buf to the program whose remote id is id.
- `int low_receive(int *idp, char *buf, int maxchars, int timeout)` waits for data from the given remote program, possibly timing out. Returns TRUE if data was received.
- `void close_remote_connection(void)` takes down and cleans up (which?) connection.

Go to the first, previous, next, last section, table of contents.