Difference between revisions of "Midware TAppServer"

From Overbyte
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
Line 18: Line 18:
 
| valign="top" | [[Midware_TAppServer.ClientTimeout | ClientTimeout]] |||| ClientTimeout gives the time in seconds before the server disconnect a client without activity.
 
| valign="top" | [[Midware_TAppServer.ClientTimeout | ClientTimeout]] |||| ClientTimeout gives the time in seconds before the server disconnect a client without activity.
 
|-
 
|-
| valign="top" | [[Midware_TAppServer.ClientWSocket | ClientWSocket]] |||| ClientWSocket is a run-time read-only indexed property whose value is the reference to each connected client TClientWSocket component.
+
| valign="top" | [[Midware_TAppServer.ClientWSocket | ClientWSocket]] |||| ClientWSocket is a run-time read-only indexed property whose value is the reference to each connected client [[Midware_TClientWSocket | TClientWSocket]] component.
 
|-
 
|-
 
| valign="top" | [[Midware_TAppServer.ConnectCount | ConnectCount]] |||| ConnectCount gives the total number of connection received since server startup.
 
| valign="top" | [[Midware_TAppServer.ConnectCount | ConnectCount]] |||| ConnectCount gives the total number of connection received since server startup.
Line 34: Line 34:
 
| valign="top" | [[Midware_TAppServer.RequestCount | RequestCount]] |||| RequestCount gives the total number of requests received since server startup.
 
| valign="top" | [[Midware_TAppServer.RequestCount | RequestCount]] |||| RequestCount gives the total number of requests received since server startup.
 
|-
 
|-
| valign="top" | [[Midware_TAppServer.SrvWSocket | SrvWSocket]] |||| SrvWSocket is the underlaying TWSocket component used to listen for for client connections.
+
| valign="top" | [[Midware_TAppServer.SrvWSocket | SrvWSocket]] |||| SrvWSocket is the underlaying [[Midware_TClientWSocket | TClientWSocket]] component used to listen for for client connections.
 
|-
 
|-
 
| valign="top" | [[Midware_TAppServer.Timeoutlnterval | Timeoutlnterval]] |||| The server periodically check for client timeout.
 
| valign="top" | [[Midware_TAppServer.Timeoutlnterval | Timeoutlnterval]] |||| The server periodically check for client timeout.
Line 56: Line 56:
 
| valign="top" | [[Midware_TAppServer.OnAfterSendReply | OnAfterSendReply]] |||| Occurs just after a reply has been sent.
 
| valign="top" | [[Midware_TAppServer.OnAfterSendReply | OnAfterSendReply]] |||| Occurs just after a reply has been sent.
 
|-
 
|-
| valign="top" | [[Midware_TAppServer.OnBeforeProcessRequest | OnBeforeProcessRequest]] |||| The OnBeforeProcessRequest event is triggered just before anything is done with a request received from the client.
+
| valign="top" | [[Midware_TAppServer.OnBeforeProcessRequest | OnBeforeProcessRequest]] |||| Occurs before a client request is processed, just after it has been received.
 
|-
 
|-
| valign="top" | [[Midware_TAppServer.OnBeforeSendReply | OnBeforeSendReply]] |||| The OnBeforeSendReply event is called when a reply is ready to be transmitted to the client.  
+
| valign="top" | [[Midware_TAppServer.OnBeforeSendReply | OnBeforeSendReply]] |||| Occurs just before a reply is sent to the client.
 
|-
 
|-
| valign="top" | [[Midware_TAppServer.OnClientConnected | OnClientConnected]] |||| This event is triggered when a client connect to the server.
+
| valign="top" | [[Midware_TAppServer.OnClientConnected | OnClientConnected]] |||| Occurs when a client connect to the server.
 
|-
 
|-
 
| valign="top" | [[Midware_TAppServer.OnClientClosed | OnClientClosed]] |||| Occurs when a client disconnect from the server.  
 
| valign="top" | [[Midware_TAppServer.OnClientClosed | OnClientClosed]] |||| Occurs when a client disconnect from the server.  
 
|-
 
|-
| valign="top" | [[Midware_TAppServer.OnClientCommand | OnClientCommand]] |||| Clients connects to the server to send commands (also called requests) and wait for server responses.  
+
| valign="top" | [[Midware_TAppServer.OnClientCommand | OnClientCommand]] |||| Occurs when a client's request is received, and before it is processed.
 
|-
 
|-
| valign="top" | [[Midware_TAppServer.OnClientTimeout | OnClientTimeout]] |||| When a client had no more activity during some time specified by the ClientTimeout property, it is automatically disconnected. If this occurs, the OnClientTimeout event is triggred.
+
| valign="top" | [[Midware_TAppServer.OnClientTimeout | OnClientTimeout]] |||| Occurs when a client is disconnected because of lack of activity.
 
|-
 
|-
| valign="top" | [[Midware_TAppServer.OnClientBgException | OnClientBgException]] |||| Client communication is handled by a TWSocket descendent component which works in the background.  
+
| valign="top" | [[Midware_TAppServer.OnClientBgException | OnClientBgException]] |||| Occurs when an exception is triggered in the background by client socket.  
 
|-
 
|-
| valign="top" | [[Midware_TAppServer.OnDisplay | OnDisplay]] |||| Sometimes, the server can display some infos about his internal working.
+
| valign="top" | [[Midware_TAppServer.OnDisplay | OnDisplay]] |||| Occurs when server need to display a message.
 
|-
 
|-
| valign="top" | [[Midware_TAppServer.OnServerBgException | OnServerBgException]] |||| The OnBgException event is triggered when an exception occurs in the background (occuring in an event handler called from the message pump).
+
| valign="top" | [[Midware_TAppServer.OnServerBgException | OnServerBgException]] |||| Occurs  when an exception in server socket occurs in the background.
 
|}
 
|}
  

Latest revision as of 15:11, 24 May 2011

Main page -> Midware component reference -> TAppserver

Overview

unit ApServer.pas

TAppServer is the communication kernel for all MidWare application servers. This component handle all the communication work for the application server, keeping track of user connections and sessions. A complete application server is made of a TAppserver component, a TRequestBroker (Object Request Broker) component and a set of TServerObject descendent components.

Properties

Banner The banner property is the text that is sent to the client when the connection has been established. Default value is 'Welcome to MidWare server'.
ClientCount Gives the actual number of connected clients.
ClientCountLabel If assigned, this property will be used by TAppServer component to display the number of client connected.
ClientTimeout ClientTimeout gives the time in seconds before the server disconnect a client without activity.
ClientWSocket ClientWSocket is a run-time read-only indexed property whose value is the reference to each connected client TClientWSocket component.
ConnectCount ConnectCount gives the total number of connection received since server startup.
DisplayMemo If assigned, this property will be used by TAppServer component to display messages during work.
Handle The Handle property is the windows handle for the hidden window the component uses for internal messages
Options Options are used by TAppServer to modify behaviour.
Port The port property gives the port number or service name used by the server to listen for client connection.
RequestBroker The server component receive client requests, data parameters and send replies to client.
RequestCount RequestCount gives the total number of requests received since server startup.
SrvWSocket SrvWSocket is the underlaying TClientWSocket component used to listen for for client connections.
Timeoutlnterval The server periodically check for client timeout.

Methods

DisconnectAll Disconnect every connected client. Do not confuse with the Stop method.
Start The start procedure will start the server. The server will accept new client connections. See also Stop.
Stop The Stop procedure will stop the server which will no more accept new clients, but will not disconnect already connected clients. See also Start.

Events

OnAfterProcessRequest Occurs when a request has been processed.
OnAfterSendReply Occurs just after a reply has been sent.
OnBeforeProcessRequest Occurs before a client request is processed, just after it has been received.
OnBeforeSendReply Occurs just before a reply is sent to the client.
OnClientConnected Occurs when a client connect to the server.
OnClientClosed Occurs when a client disconnect from the server.
OnClientCommand Occurs when a client's request is received, and before it is processed.
OnClientTimeout Occurs when a client is disconnected because of lack of activity.
OnClientBgException Occurs when an exception is triggered in the background by client socket.
OnDisplay Occurs when server need to display a message.
OnServerBgException Occurs when an exception in server socket occurs in the background.

How to


Midware Components Reference