Implements a simple polling server. This is designed to be useful with systems that don't handle threads particularly well, so that a minimum number of threads (and context switches) are required in order to make the application perform well. This isn't a framework or API as much as it is a set of classes that can be modified to be useful for a variety of high-performance network applications.

Typical utilization would be to:

  1. Create the InputQueue and output Queue instances
  2. Pass those to a new ConnectionHandler instance
  3. Pass the connection handler and the network port on which to listen to a new Listener
  4. Set up a loop to periodically check the input queue for new messages, and pass processed messages to the output queue for use by the client

The InputQueue assumes the use of a message header and footer (defined as constants in the Message class). Messages without well defined headers and footers should not use the InputQueue class, and the ConnectionHandler should be modified accordingly. As it is, with slight modifications to the Message header and footer fields, XML messages would be ideal content (though any framed message would work as well).

Problems still exist in checking for idle or dead network connections. Socket options have not been set on the client sockets, nor is the idle client "are you there?" check in place yet. Also, the ConnectionInfo object would do well to have application-specific tuning applied to the input/output buffers. Performance benchmarking also needs to be tested. A sample message handler needs to be written as well.

This code is licensed under the GNU General Public License.

   Copyright (C) 2001 by Christopher R. Jones. All rights reserved.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
 
   This program 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 General Public License for more details.
 
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

$Id$