Daraja HTTP Framework 3.0-MS1
HTTP server framework for Object Pascal
Loading...
Searching...
No Matches
TdjServer Class Reference

Basic server class for the Web Component framework. More...

+ Inheritance diagram for TdjServer:

Public Member Functions

 TdjServer ()
 Create a TdjServer using the default host and port.
 
 TdjServer (const Integer APort)
 Create a TdjServer, using the specified port and the default host.
 
 TdjServer (const string AHost, const Integer APort=DEFAULT_BINDING_PORT)
 Create a TdjServer, using the specfied host and port.
 
 ~TdjServer ()
 Destructor.
 
 AddConnector (const IConnector Connector)
 Add a preconfigured connector.
 
 AddConnector (const string Host, Integer Port=DEFAULT_BINDING_PORT)
 Create and add a connector for a host and port.
 
 Add (TdjWebComponentContextHandler Context)
 Add a new context.
 
Integer ConnectorCount ()
 The number of connectors.
 
 DoStart ()
 Start the handler.
 
 DoStop ()
 Stop the handler.
 
- Public Member Functions inherited from TdjServerBase
 TdjServerBase ()
 Create a ServerBase instance.
 
 ~TdjServerBase ()
 Destructor.
 
 Handle (const string Target, TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 Handle a HTTP request.
 
 DoStart ()
 Start the server.
 
 DoStop ()
 Stop the server.
 
- Public Member Functions inherited from TdjHandlerWrapper
 AddHandler (const IHandler Handler)
 Add a handler to the container.
 
 RemoveHandler (const IHandler Handler)
 Remove a handler from the container.
 
 DoStart ()
 Start the handler.
 
 DoStop ()
 Stop the handler.
 
 Handle (const string Target, TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 Handle a HTTP request.
 
- Public Member Functions inherited from TdjAbstractHandler
 TdjAbstractHandler ()
 Constructor.
 
 DoStart ()
 Start the handler.
 
 DoStop ()
 Start the handler.
 
 Handle (const string Target, TdjServerContext Context, TdjRequest Request, TdjResponse Response)
 Handle a HTTP request.
 
- Public Member Functions inherited from TdjLifeCycle
 Start ()
 Start the handler.
 
 Stop ()
 Stop the handler.
 
Boolean IsStarted ()
 
Boolean IsStopped ()
 

Additional Inherited Members

- Public Attributes inherited from TdjHandlerWrapper
IHandler Handler
 
- Public Attributes inherited from TdjLifeCycle
Boolean Started
 True if the state is "started".
 
Boolean Stopped
 True if the state is "stopped".
 
- Protected Member Functions inherited from TdjHandlerWrapper
TIdHTTPSession GetSession (TdjServerContext Context, TdjRequest Request, TdjResponse Response, const Boolean Create)
 Get a HTTP session.
 
- Protected Member Functions inherited from TdjAbstractHandlerContainer
 AddHandler (const IHandler Handler)
 Add a handler.
 
 RemoveHandler (const IHandler Handler)
 Remove a handler.
 
- Protected Member Functions inherited from TdjLifeCycle
 DoStart ()
 Execute the custom start code.
 
 DoStop ()
 Execute the custom stop code.
 
 CheckStarted ()
 Raises an exception if the lifecycle is in "started" state.
 
 CheckStopped ()
 Raises an exception if the lifecycle is in "stopped" state.
 

Detailed Description

Basic server class for the Web Component framework.

Constructor & Destructor Documentation

◆ TdjServer() [1/2]

TdjServer::TdjServer ( const Integer APort)

Create a TdjServer, using the specified port and the default host.

Parameters
APortthe port to be used.

◆ TdjServer() [2/2]

TdjServer::TdjServer ( const string AHost,
const Integer APort = DEFAULT_BINDING_PORT )

Create a TdjServer, using the specfied host and port.

Parameters
AHostthe host to be used.
APortthe port to be used.

Member Function Documentation

◆ Add()

TdjServer::Add ( TdjWebComponentContextHandler Context)

Add a new context.

Parameters
Contextthe context handler.

References TdjContextHandler::ContextPath.

◆ AddConnector() [1/2]

TdjServer::AddConnector ( const IConnector Connector)

Add a preconfigured connector.

Parameters
Connectorthe connector

References IConnector::Host, TdjLifeCycle::IsStarted(), and IConnector::Port.

Referenced by AddConnector(), and DoStart().

◆ AddConnector() [2/2]

TdjServer::AddConnector ( const string Host,
Integer Port = DEFAULT_BINDING_PORT )

Create and add a connector for a host and port.

Parameters
Hostthe connector host name
Portthe connector port number

References AddConnector(), and TdjAbstractConnector::Host.

◆ ConnectorCount()

Integer TdjServer::ConnectorCount ( )

The number of connectors.

Returns
number of connectors