refdbtest readme
================

This archive contains a stripped down version of a client/server app
that shows a problem with socket read()/write() on Cygwin versions
1.1.5 and 1.1.6, but not on Cygwin versions B20 through 1.1.4 and on
Linux.

How to make it
==============

Run make. This requires the readline lib. It will create the forking
server refdbs.exe and the client refdb-admin.exe.


How to run it
=============

Start the server: ./refdbs &

Start the client: ./refdb-admin

The latter is a command interpreter, i.e. it waits for you to enter a
command. Type: confserv ping

This will return the process ids of the server parent and child.


How to demonstrate the read()/write() problem
=============================================

Edit refdbsa.c. In the function child_confserv() starting at line 62
there are two blocks of code that can be used alternatively. The
shipped version uses block 2 which will succeed. The buffer content
including the terminating \0 is sent to the client with one write
call. The client will print the line and wait for the next command.

Outcomment this code and uncomment the two lines in block 1. Here the
first write() call writes the buffer content without the terminating
\0. The second write() call writes a \0. The client will print garbage
as it does not receive the terminating \0.


Any clues are welcome
Markus Hoenicka
markus.hoenicka@uth.tmc.edu
