|
|||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||
See:
Description
| Class Summary | |
| ConnectionHandler | Responsible for keeping track of connection info objects, checking for new input on connections, and passing new output to connections. |
| ConnectionInfo | Connection information object. |
| InputQueue | Input queue and manager. |
| InputQueueTester | Test critical InputQueue functionality. |
| Listener | Listens for new connections. |
| Message | Message object. |
| MessageHandler | Responsible for retrieving messages from the input queue, passing them off to the proper processor thread, and sending responses back to the output queue. |
| ProcessorThread | Defines a message processor thread. |
| Queue | Implements a basic FIFO queue. |
| ThreadPool | Implements a simple thread pool. |
| Exception Summary | |
| MessageTooLargeException | Indicates that a message was too large. |
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:
InputQueue and output Queue
instancesConnectionHandler instanceListener
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
|
|||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||