TROIpHTTPServer Class

From RemObjects Wiki
Jump to: navigation, search

This is a Library topic for RemObjects SDK for Delphi
This page is generated from external data, please do not update

InterfacesClassesAliasesImplements

Contents

Overview

The Synapse based implementation of the server side HTTP Channel. Along with functionality inherited from to it's ancestor TROBaseHTTPServer it exposes some public members specific to Synapse. Please read ancestor's documentation for more information.
Use this channel class to build a HTTP server if Synapse is preferred communication level library.


Location

uROIpHttpServer.pas


Properties

Active     (declared in TROServer)

Toggles whether the server ready to receive requests from clients. Depending on the server type, changing this property might open/close a network socket or otherwise toggle whether the server will process incoming requests.



property Active: boolean read write


DefaultResponse   protected     (declared in TROServer)



property DefaultResponse: string read write


DisableNagle

Controls Nagle's algorithm usage for TCP/IP communication through the server socket. The default value is true, i.e. the Nagle's algorithm is not used.
It makes a little sense to enable Nagle for RO HTTP communications because TCP packages being formed are much longer than the TCP/IP header so there is no significant overhead.



property DisableNagle: boolean read write


Dispatchers     (declared in TROServer)

Specifies how incoming requests will be processed and dispatched. Depending on the server type, one or multiple dispatchers can be configured to receive messages from the client. Each dispatcher consists of a Message and an optional Name. Also, each dispatcher can be individually enabled or disabled. Each server must have at least one dispatcher configured, in order to be able to process messages.

Essential Sub-Properties
  • Message specifies the message format to be used for this dispatcher.
  • Name specifies the name, or possibly the URL for the dispatcher.

In HTTP based servers (such as the TROIndyHTTPServer, the Name will be appended as folder to the server URL allowing the server to make multiple dispatchers available at different URLs.



property Dispatchers: TROMessageDispatchers read write


Encryption obsolete     (declared in TROBaseConnection)

This is DES based enscryption, it is obsolete because works only for Delphi. Use message envelope AES Encryption Envelope instead.



property Encryption: TROEncryption read write


ExtendedDispatchers     (declared in TROBaseHTTPServer)

Extended Dispatchers that is used for OData technology.



property ExtendedDispatchers: TROExtendedHTTPDispatcherList read


KeepAlive

Controls the HTTP Keep-Alive feature i.e. connection reuse. If set to true clients are allowed to request connections reuse, otherwise such requests are ignored. The socket is kept open no longer than Timeout. The default value is false.
If the communication between every single client and the server is not frequent (no more than one request in several seconds) then keeping the socket open can lead to server resources overconsuption so it is recommended to set this property to false.



property KeepAlive: boolean read write


MinSizeForGzipEncoding     (declared in TROBaseHTTPServer)



property MinSizeForGzipEncoding: integer read write


OnGetRODLReader     (declared in TROBaseHTTPServer)

This event allows to set custom TROCustomRODLReader. It is usable for Hydra applications that can process several RODL.



property OnGetRODLReader:


Port

The port on which the server will listen for incoming connections.



property Port:


SendClientAccessPolicyXml     (declared in TROBaseHTTPServer)

Determines how the server channel should handle requests for clientaccesspolicy.xml (security policy file used by Silverlight). Can be set to:

  • captAllowNone (deny all requests).
  • captAllowAll (allow all requests).
  • captCustom (provides a custom security policy file via OnCustomClientAccessPolicy event handler).



property SendClientAccessPolicyXml: TROClientAccessPolicyType read write


SendCrossOriginHeader     (declared in TROBaseHTTPServer)



property SendCrossOriginHeader: Boolean read write


SendExceptionsAs500     (declared in TROBaseHTTPServer)

If set to true, messages about exceptions occurred on the server will be sent with a HTTP Error 500 header set (standard HTTP header for internal server errors).



property SendExceptionsAs500: boolean read write


ServeInfoPage     (declared in TROBaseHTTPServer)

Determines if the server info page should be served or not



property ServeInfoPage: Boolean read write


Server

Provides read-only access to the underlying Synapse HTTP server object.



property Server: TIPAsyncHTTPServer read


ServeRodl     (declared in TROServer)



property ServeRodl: Boolean read write


ThreadPool

Allows to set a custom thread pool object to process incoming requests using a set of threads. When not assigned explicitly the thread pool is created and assigned automatically. Assigning this property by users is a rare need, this is required only when precise and/or custom control over processing threads is necessary.



property ThreadPool: TROThreadPool read write


Timeout

Gets or sets the idle timeout value for the connection. When there is no traffic through the socket during that time the socket is closed. The timeout is expressed in seconds, the default value is 180.
As a rule the socket is closed right after the response is sent if the KeepAlive property is set to false. Avoid setting too short timeouts or the socket can be closed before the service mathod execution completes.



property Timeout: integer read write


Instance Methods

constructor Create   override

The standard component constructor.


constructor Create(aComponent: TComponent)


Parameters:

  • aComponent:


destructor Destroy   override



destructor Destroy


Assign   override



procedure Assign(Source: TPersistent)


Parameters:

  • Source:


CheckProperties   virtual     (declared in TROServer)



procedure CheckProperties


DispatchMessage (IROTransport, TStream, TStream): boolean   protected overload     (declared in TROServer)



function DispatchMessage(const aTransport: IROTransport; aRequeststream: TStream; aResponsestream: TStream): boolean


Parameters:

  • aTransport:
  • aRequeststream:
  • aResponsestream:


DispatchMessage (IROTransport, TStream, TStream, TROResponseOptions): boolean   protected overload     (declared in TROServer)



function DispatchMessage(const aTransport: IROTransport; aRequeststream: TStream; aResponsestream: TStream; out oResponseOptions: TROResponseOptions): boolean


Parameters:

  • aTransport:
  • aRequeststream:
  • aResponsestream:
  • oResponseOptions:


DoAfterEncryptEvent   protected virtual obsolete     (declared in TROBaseConnection)



procedure DoAfterEncryptEvent(aEncryptedStream: TStream)


Parameters:

  • aEncryptedStream:


DoBeforeDecryptEvent   protected virtual obsolete     (declared in TROBaseConnection)



procedure DoBeforeDecryptEvent(aEncryptedStream: TStream)


Parameters:

  • aEncryptedStream:


DoDecodeStream   protected     (declared in TROBaseHTTPServer)



procedure DoDecodeStream(const aSource: TStream; out aDest: TStream)


Parameters:

  • aSource:
  • aDest:


DoDecryption   virtual obsolete     (declared in TROBaseConnection)



procedure DoDecryption(iCipherText: TStream; iPlainText: TStream)


Parameters:

  • iCipherText:
  • iPlainText:


DoDecryption2 obsolete     (declared in TROBaseConnection)



procedure DoDecryption2(const iStream: TStream)


Parameters:

  • iStream:


DoEncodeStream   protected     (declared in TROBaseHTTPServer)



procedure DoEncodeStream(const aSource: TStream)


Parameters:

  • aSource:


DoEncryption   virtual obsolete     (declared in TROBaseConnection)



procedure DoEncryption(iPlainText: TStream; iCipherText: TStream)


Parameters:

  • iPlainText:
  • iCipherText:


DoEncryption2 obsolete     (declared in TROBaseConnection)



procedure DoEncryption2(const iStream: TStream)


Parameters:

  • iStream:


EncodeEventStream   protected     (declared in TROServer)



procedure EncodeEventStream(aStream: TStream)


Parameters:

  • aStream:


GetDispatchersClass   protected override     (declared in TROBaseHTTPServer)

Returns TROHTTPMessageDispatchers


function GetDispatchersClass: TROMessageDispatchersClass


GetKeepAlive   protected

The KeepLive property read accessor.


function GetKeepAlive: boolean


GetPort   protected override

The Port property read accessor.


function GetPort: Integer


GetRODLReader   protected     (declared in TROServer)



function GetRODLReader: TROCustomRODLReader


GetServerType   protected override     (declared in TROBaseHTTPServer)

Returns 'rstHTTP'. This property is used by the ZeroConf infrastructure.


function GetServerType: TROServerType


IntDispatchMessage   protected     (declared in TROServer)



function IntDispatchMessage(Dispatcher: TROMessageDispatcher; const aTransport: IROTransport; aRequeststream: TStream; aResponsestream: TStream; out oResponseOptions: TROResponseOptions): boolean


Parameters:

  • Dispatcher:
  • aTransport:
  • aRequeststream:
  • aResponsestream:
  • oResponseOptions:


IntGetActive   protected override

The internal method overridden to get the activity state of the underlying server object.


function IntGetActive: boolean


IntRequest   protected

This internal method is used to process incoming requests, it is triggered as an underlying server object callback.


procedure IntRequest(Sender: TObject; aContext: IIPAsyncContext)


Parameters:

  • Sender: References the internal server object.
  • aContext: The incoming connection context descriptor object.


IntSetActive   protected override

The internal method overridden to set the activity state of the underlying server object.


procedure IntSetActive(const Value: boolean)


Parameters:

  • Value:


IsEncryptionUsed   protected     (declared in TROServer)



function IsEncryptionUsed: Boolean


Loaded   protected override     (declared in TROServer)



procedure Loaded


Notification   protected override     (declared in TROServer)



procedure Notification(AComponent: TComponent; Operation: TOperation)


Parameters:

  • AComponent:
  • Operation:


ProcessRequest   protected virtual     (declared in TROBaseHTTPServer)

This is basically the core of the entire server channel. This method processes incoming HTTP requests and performs requested actions (service method call, RODL request etc).


procedure ProcessRequest(const aTransport: IROHTTPTransportEx; const aRequestStream: TStream; out aResponseStream: TROBinaryMemoryStream; const aResponse: IROHTTPResponse)


Parameters:

  • aTransport:
  • aRequestStream:
  • aResponseStream:
  • aResponse:


QueryInterface   protected override     (declared in TROServer)



function QueryInterface(const IID: TGUID; out Obj: ): HResult


Parameters:

  • IID:
  • Obj:


Register   protected     (declared in TROBaseHTTPServer)

Registers IROHTTPDispatcher. it is used in OData technology.


procedure Register(aDispatcher: IROHTTPDispatcher)


Parameters:

  • aDispatcher:


ROFreeNotification     (declared in TROComponent)



procedure ROFreeNotification(AComponent: TComponent)


Parameters:

  • AComponent:


RORemoveFreeNotification     (declared in TROComponent)



procedure RORemoveFreeNotification(AComponent: TComponent)


Parameters:

  • AComponent:


SendRemoveNotification   protected     (declared in TROComponent)



procedure SendRemoveNotification(AComponent: TComponent)


Parameters:

  • AComponent:


SetKeepAlive   protected

The KeepLive property write accessor.


procedure SetKeepAlive(const Value: boolean)


Parameters:

  • Value:


SetPort   protected override

The Port property write accessor.


procedure SetPort(const Value: Integer)


Parameters:

  • Value:


TriggerReadFromStream   protected     (declared in TROServer)



procedure TriggerReadFromStream(iStream: TStream)


Parameters:

  • iStream:


TriggerWriteToStream   protected     (declared in TROServer)



procedure TriggerWriteToStream(iStream: TStream)


Parameters:

  • iStream:


Unregister   protected     (declared in TROBaseHTTPServer)

Unregisters IROHTTPDispatcher. it is used in OData technology.


procedure Unregister(aDispatcher: IROHTTPDispatcher)


Parameters:

  • aDispatcher:


Events

onAfterEncrypt obsolete     (declared in TROBaseConnection)



property onAfterEncrypt: TROBaseConnectionOperation read write delegate: procedure Invoke(Sender: TROBaseConnection; aEncryptedStream: TStream)


OnAfterServerActivate     (declared in TROServer)

Fires after the server has been activated.



property OnAfterServerActivate: TNotifyEvent read write


OnAfterServerDeactivate     (declared in TROServer)

Fires after the server has been deactivated. You can use this event handler to perform any cleanup you might need after the server has stopped processing new requests.



property OnAfterServerDeactivate: TNotifyEvent read write


onBeforeDecrypt obsolete     (declared in TROBaseConnection)



property onBeforeDecrypt: TROBaseConnectionOperation read write delegate: procedure Invoke(Sender: TROBaseConnection; aEncryptedStream: TStream)


OnBeforeServerActivate     (declared in TROServer)

Fires just before the server is activated. You can use this event handler to perform any initialization you might need before the server starts processing new requests.



property OnBeforeServerActivate: TNotifyEvent read write


OnBeforeServerDeactivate     (declared in TROServer)

Fires just before the server is deactivated. You can use this event handler to perform any cleanup you might need before the server stops processing new requests.



property OnBeforeServerDeactivate: TNotifyEvent read write


OnCustomResponseEvent     (declared in TROBaseHTTPServer)

Allows to handle unknown requests, i.e. that aren't recognised by ProcessRequest



property OnCustomResponseEvent: TROHTTPGetCustomResponseEvent read write delegate: procedure Invoke(const aTransport: IROHTTPTransport; const aRequestStream: TStream; const aResponseStream: TStream; const aResponse: IROHTTPResponse; var aHandled: Boolean)


OnGetCustomClientAccessPolicy     (declared in TROBaseHTTPServer)

This event is fired when SendClientAccessPolicyXml is set to Custom. Allows more precise management of client access policies.

The handler of this event generates a valid ClientAccessPolicy.xml and puts it to the aPolicyContent parameter.



property OnGetCustomClientAccessPolicy: TROCustomClientAccessPolicyMethod read write delegate: procedure Invoke(aSender: TObject; var aPolicyContent: AnsiString)


OnGetRODLReader     (declared in TROServer)



property OnGetRODLReader: TROGetRODLReader read write delegate: procedure Invoke(Sender: TROServer; var aRODLReader: TROCustomRODLReader)


OnManualBindSocket

Allows users to take control over socket to IP address binding process. By default the server binds to all network addresses available. When a handler exists for this event the user's code becomes fully responsible for the binding. No automatic binding is performed allowing to bind to certain addresses only.



property OnManualBindSocket: TNotifyEvent read write


OnReadFromStream     (declared in TROServer)

Fires after a stream with a request message has been received from the client. The event handler can inspect and possibly modify the stream, before it continues to be processed by the higher levels of the RemObjects SDK framework.



property OnReadFromStream: TStreamOperation read write delegate: procedure Invoke(aStream: TStream)


OnSendCrossOriginHeader     (declared in TROBaseHTTPServer)



property OnSendCrossOriginHeader: TROHTTPSendCrossOriginHeader read write delegate: procedure Invoke(var AllowedOrigin: string)


OnWriteToStream     (declared in TROServer)

Fires just before a stream with a response message is sent back to the client. The event handler can inspect and possibly modify the stream, before it continues to be sent off to the client.



property OnWriteToStream: TStreamOperation read write delegate: procedure Invoke(aStream: TStream)


See Also


Product: RemObjects SDK
Available Editions: RemObjects SDK for .NET, Xcode, Delphi, Java and JavaScript

GlossaryArticlesLibrarySamples

Personal tools
Namespaces

Variants
Actions
Navigation
products
platforms
special
Toolbox