CS - A Small client/server system for Unix
------------------------------------------

(c) 1998 Martin Pitt (Piware).

0. Copyright

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Library General Public License for more details.

You should have received a copy of the GNU Library General Public
License along with this library (see file COPYING.LIB); if not, write
to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
MA 02139, USA.

1. What is CS?

CS is a small, easy and fast client/server system for C++ on Unix
platforms.

The three classes Client, Server and CSResource are a framework for a
network based application. There is a number of so-called "resources",
these are objects encapsulating whatever you want, which are managed
by a Server. These resources can be accessed by several clients, which
login to the server. To modify a resource, a client has to "lock"
it. Then, the server ensures that this client is the only one who can
modify this resource (the other clients may still read it, though). If
modification is complete, the client should unlock it again
immediately. This causes the resource to be sent back to the server.

2. Installation

Edit the Makefile to suit your needs (if you want special compiler
options, etc). Then, just type make. This will build the cs system and
a small demonstration consisting of the three executables server,
client and simpleclient.

Run "make doc" if you have doc++ and want to build the interface
documentation. If you use kdoc, edit the Makefile and replace doc++ by
kdoc.

3. Usage

The library itself consists of the three include files except.h,
socket_class.h and except.h and the sources socket_class.cc and
cs.cc. socket_class.h provides a class Socket which is a convenient
wrapper class to the Unix socket operations.

A small example program is provided. Compile it by invoking "make" and
start "server" either in the background or in a separate console. Now
you can start as many "client"s and "simpleclient"s as you want. They
will both log into the running server.

simpleclient just creates a text, modifies it and writes it back to
the server.

client is a bit more versatile: it presents you a menu with several
choices. You can create a number of (text) resources, lock, unlock,
modify and delete them.

If the last client (respectively simpleclient) logs out, the server
program terminates.

All methods are documented with doc++ -style comments. Running "make
doc" will build html documentation in the doc/ directory. If you
neither have kdoc, nor doc++, you may also read the comments directly
(which IMHO is not less convenient).

4. Todo

- authorization system
- check server stability (if an exception is thrown, disconnect the
  offending client and go on)

5. Contacting the author

If you have any questions or suggestions or found a bug in cs, you are
welcome to report it to me. Please eMail me at "piware@piware.de".


