Unit ApServer

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Author: François PIETTE Description: Application Server Component. This is the communication kernel for the application server in F. Piette's Middleware (MidWare). This component handle all the communication work for the application server, keeping track of user connections. A complete application server is made of this somponent, a request broker component and a set of server components. See project SrvTst for a sample application server program. EMail: francois.piette@pophost.eunet.be francois.piette@ping.be francois.piette@rtfm.be http://www.rtfm.be/fpiette Creation: March 02, 1998 Version: 1.07 Support: Use the mailing list midware@rtfm.be See website for details. Legal issues: Copyright (C) 1997, 1998 by François PIETTE Rue de Grady 24, 4053 Embourg, Belgium. Fax: +32-4-365.74.56 This software is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software and or any derived or altered versions for any purpose, excluding commercial applications. You can use this software for personal or internal use only. You may distribute it freely untouched. The following restrictions applies: 1. The origin of this software must not be misrepresented, you must not claim that you wrote the original software. 2. If you use this software in a product, an acknowledgment in the product documentation and displayed on screen is required. The text must be: "This product is based on MidWare. Freeware source code is available at http://www.rtfm.be/fpiette." 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. This notice may not be removed or altered from any source distribution and must be added to the product documentation. Updates: Mar 27, 1998 V1.01 Added ClientWSocket[] indexed property to retrive the client TWSocket reference (helpful for example to display all connected client IP addresses). Apr 10, 1998 V1.02 Accepted the client connection before triggering the OnClientConnected event handler. Apr 14, 1998 V1.03 Changed LongInt to Integer parameter ProcessClientCommand to match function description in TClientWSocket - ApSrvCli.PAS (from Bruce Christensen ) Added a Banner property. May 18, 1998 V1.04 Implemented client timeout functions. May 23, 1998 V1.05 Added comments to describes properties, events and methods. Jun 01, 1998 V1.06 Removed beta status. Changed "legal stuff" to prohibe commercial applications whithout an agreement. Jun 07, 1998 V1.07 Added functionnalities to support encryption and compression * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Classes

TAppServer - :TAppServer component is responsible for client connection, communication and management.

Functions

Register - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Types

TClientCommandEvent
TClientEvent
TClientTimeoutEvent
TProcessRequestEvent

Constants

ApServerVersion
WM_DESTROY_CLIENT_SOCKET

Variables


Functions


procedure Register;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Types


TClientCommandEvent  = procedure (Sender       : TObject;
                                      CliWSocket   : TClientWSocket;
                                      CmdBuf       : PChar;
                                      CmdLen       : LongInt) of object

TClientEvent         = procedure (Sender       : TObject;
                                      CliWSocket   : TClientWSocket) of object

TClientTimeoutEvent  = procedure (Sender       : TObject;
                                      CliWSocket   : TClientWSocket;
                                      var CanClose : Boolean) of object

TProcessRequestEvent = procedure (Sender       : TObject;
                                      CliWSocket   : TClientWSocket;
                                      var CmdBuf   : PChar;
                                      var CmdLen   : integer) of object

Constants

ApServerVersion = 107

Enable partial boolean evaluation } {$T-} { Untyped pointers } {$J+} { Allow typed constant to be modified

WM_DESTROY_CLIENT_SOCKET = WM_USER + 1


Variables