paradigm_3.zip

Uploaded: 23 Aug, 2006
Previous uploads by this submitter: 0

Author: J. Lambert

Downloads: 115

Introduction
The TCP/IP network progamming examples I've seen generally ignore error
detection and handling. Unfortunately this often results in poor quality
servers being releasing by those who learn by example. This program features
exhaustive error detection and handling. Memory leaks and buffer overruns are
also ubiquitous in TCP/IP servers. This example attempts to mitigate those
issues. At least that's the hope.

Description
Paradigm in its current state is a very primitive chat server written in C++
for Win32 systems supporting Winsock2. It allows multiple connections and just
echoes input to all those connected.

Features

* Proper error detection.
* Dynamic buffers.
* Lots of comments and formatted documentation using Doxygen QT style notation.
* No memory leaks. Tested with MemProof.
* Multithreaded - Network server and Chat driver run in their own threads.

Implementation
A non-blocking select-based server model was selected for this illustration for
no particular reason other than usefulness of the example to other BSD derived
TCP/IP stack implementations.

There are no actual winsock2 dependencies in this version despite the
negotiation present for winsock2. It should work on winsock1 systems by
modifiying the WSAStartup negotiation and including the appropriate headers.

System Dependencies
This version only works on Windows 32-bit operating systems and was tested with
Windows98, Windows NT 4.0 and Windows XP. This version was compiled and tested
with the following compilers:

* Borland 5.3 (Borland Builder 3.0)
* Borland 5.5.1 (Borland's free commandline compiler)
* Microsoft Visual C++ 6.0

Changes

version 0.30

* Separation of Server from main program. The Server now runs in it's own
thread.
* Communication between the threads is handled by create and placing an Event
object on shared EventQueue's.
* EventQueue class wraps queues with thread safe guards.
* The primitive notion of a User class added.

version 0.22

* A simple logging mechanism added via class Log.

version 0.20
* Refactored all of the low level sockets routines in Connection to a wrapper
class Socket.
* Socket errors are implemented as exceptions.
* Implemented a circular autoflushing buffer in the Socket class.
* Communication between the server and client is handled by create and placing
Event objects on queues.
* Additonal comments in Server class.
* Added Microsoft Visual C++ project

version 0.10
* Initial version

License
Paradigm was 2003 by Jon A. Lambert - All Rights Reserved.
Paradigm has been released to the public domain by Jon A. Lambert.