Main Page Namespace List Alphabetical List Compound List File List Compound Members File Members Related Pages
Paradigm
v0.30
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.
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.
- 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.
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.
- 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
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
- Unzip the distribution into the folders it wants.
- Start Builder and open the project group (paradigm_3.bpg) in the paradigm directory.
- Click build
- Open a Windows command console window and switch to the paradigm directory by typing: cd c:\paradigm or to the path you placed it.
- Run the server by typing: paradigm
- Unzip the distribution into the folders it wants.
- Open a Windows command console window and switch to the paradigm directory by typing: cd c:\paradigm or to the path you placed it.
- Then type: make and watch it compile.
- Run the server by typing: paradigm
- Unzip the distribution into the folders it wants.
- Start VIDE and open the project file (paradigm_2.vpj) in the paradigm directory.
- Click on make
- Open a Windows command console window and switch to the paradigm directory by typing: cd c:\paradigm or to the path you placed it.
- Run the server by typing: paradigm
- Unzip the distribution into the folders it wants.
- Start Visual Studio and open the project workspace (paradigm.dsw) in the paradigm directory.
- Click build
- Open a Windows command console window and switch to the paradigm directory by typing: cd c:\paradigm\Debug or to the path you placed it. The default build is set to go to Debug folder.
- Run the server by typing: paradigm
Paradigm was © 2003 by Jon A. Lambert - All Rights Reserved.
Paradigm has been released to the public domain by Jon A. Lambert.
- @shutdown will shut down the server
- anything else echos to all connected
- It might be nice to support a some telnet negotiation.
- Illustrations of other network designs, asynchronous sockets and/or IOCP edge detection.
- A port to BSD or Linux
- Author:
-
Jon A. Lambert
aka Tyche
Email: jlsysinc@alltel.net
- Date:
-
05/02/2003
- Version:
-
0.30
Generated on Mon Mar 29 23:12:52 2004 for Paradigm by
1.2.17