TROServer

Overview

TROServer is the common base class for all server channel implementations in the Remoting SDK.

You will not use instances of this class directly, but work with the descendant server implementations. See Channels for a complete overview of available channels and servers.

Location


 

constructor Create  override

Standard component constructor

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: Owner

Active

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

Assign  override

Copies the contents of another, similar object.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

CheckProperties  virtual

Validates the server properties.

procedure CheckProperties

DecryptStream (TStream, TStream)  protected overload    (declared in TROBaseConnection)

Decrypt stream

procedure DecryptStream(const Source: TStream; const Dest: TStream)

Parameters:

  • Source: Source
  • Dest: Destination

DecryptStream (TStream)  protected overload    (declared in TROBaseConnection)

Decrypt stream

procedure DecryptStream(const Stream: TStream)

Parameters:

  • Stream: Stream

DefaultResponse  protected

Holds the message that will be sent back to the client if it improperly "welcomes" the server.

property DefaultResponse: string read write

Dispatchers

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

DispatchMessage (IROTransport, TStream, TStream): Boolean  protected overload

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

Parameters:

  • aTransport:
  • aRequeststream:
  • aResponsestream:

DispatchMessage (IROTransport, TStream, TStream, TROResponseOptions): Boolean  protected overload

function DispatchMessage(const aTransport: IROTransport; aRequestStream: TStream; aResponseStream: TStream; out oResponseOptions: TROResponseOptions): Boolean

Parameters:

  • aTransport:
  • aRequestStream:
  • aResponseStream:
  • oResponseOptions:

DoBeforeDecryptEvent  protected virtual    (declared in TROBaseConnection) obsolete

procedure DoBeforeDecryptEvent(aEncryptedStream: TStream)

Parameters:

  • aEncryptedStream: Stream

Encryption    (declared in TROBaseConnection) obsolete

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

EncryptStream (TStream, TStream)  protected overload    (declared in TROBaseConnection)

Encrypt stream

procedure EncryptStream(const Source: TStream; const Dest: TStream)

Parameters:

  • Source: Source
  • Dest: Destination

EncryptStream (TStream)  protected overload    (declared in TROBaseConnection)

Encrypt stream

procedure EncryptStream(const Stream: TStream)

Parameters:

  • Stream: Stream

GetDispatchersClass  protected virtual

Returns TROMessageDispatchers class

function GetDispatchersClass: TROMessageDispatchersClass

GetRODLReader  protected

function GetRODLReader: TROCustomRODLReader

GetSecure  protected virtual

function GetSecure: Boolean

GetServerType  protected virtual

Returns current server type

function GetServerType: TROServerType

GetServiceMetaData  protected

function GetServiceMetaData(aServiceName: string; aOptions: string; out aContentType: string): TStream

Parameters:

  • aServiceName:
  • aOptions:
  • aContentType:

GetTransportObject  protected

Returns itself.

function GetTransportObject: TObject

IsEncryptionUsed  protected    (declared in TROBaseConnection)

Checks if encryption was used

function IsEncryptionUsed: Boolean

IsServiceAllowed  protected

function IsServiceAllowed(Value: string): Boolean

Parameters:

  • Value:

IsStreamEncrypted  protected    (declared in TROBaseConnection)

Checks state of stream

function IsStreamEncrypted(Source: TStream): Boolean

Parameters:

  • Source: Stream

Notification  protected override

Forwards notification messages to all owned components.

procedure Notification(AComponent: TComponent; Operation: TOperation)

Parameters:

  • AComponent: component
  • Operation: operation

OnAfterEncrypt    (declared in TROBaseConnection)

Fired after stream was encrypted

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

OnAfterServerActivate

Fires after the server has been activated.

property OnAfterServerActivate: TNotifyEvent read write

OnAfterServerDeactivate

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    (declared in TROBaseConnection)

Fired before stream will be decrypted

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

OnBeforeServerActivate

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

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

OnGetRODLReader

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

OnReadFromStream

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 Remoting SDK framework.

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

OnWriteToStream

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 OnWriteToStream(aStream: TStream)

Port  protected

The network socket where the server will be listening

property Port: Integer read write

ROFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure ROFreeNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

RORemoveFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure RORemoveFreeNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

SendRemoveNotification  protected    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure SendRemoveNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

ServeRodl

Specifies whether the server will make the contained RODL file available to clients (true, default) or not. Keep this property set to true if clients need to access the RODL (or WSDL), for example so that third parties (including Service Tester) can import services. Set it to false if you do not want to provide this information, for example for security reasons.

property ServeRodl: Boolean read write

ServiceGroup

Allows to get/set Service Groups

property ServiceGroup: string read write

TriggerReadFromStream  protected

Fires the OnReadFromStream event

procedure TriggerReadFromStream(aSource: TStream)

Parameters:

  • aSource: stream

TriggerWriteToStream  protected

Fires the OnReadFromStream event

procedure TriggerWriteToStream(aDest: TStream)

Parameters:

  • aDest: stream

 

Active

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

Holds the message that will be sent back to the client if it improperly "welcomes" the server.

property DefaultResponse: string read write

Dispatchers

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    (declared in TROBaseConnection) obsolete

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

Port  protected

The network socket where the server will be listening

property Port: Integer read write

ServeRodl

Specifies whether the server will make the contained RODL file available to clients (true, default) or not. Keep this property set to true if clients need to access the RODL (or WSDL), for example so that third parties (including Service Tester) can import services. Set it to false if you do not want to provide this information, for example for security reasons.

property ServeRodl: Boolean read write

ServiceGroup

Allows to get/set Service Groups

property ServiceGroup: string read write

 

constructor Create  override

Standard component constructor

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: Owner

Assign  override

Copies the contents of another, similar object.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

CheckProperties  virtual

Validates the server properties.

procedure CheckProperties

DecryptStream (TStream, TStream)  protected overload    (declared in TROBaseConnection)

Decrypt stream

procedure DecryptStream(const Source: TStream; const Dest: TStream)

Parameters:

  • Source: Source
  • Dest: Destination

DecryptStream (TStream)  protected overload    (declared in TROBaseConnection)

Decrypt stream

procedure DecryptStream(const Stream: TStream)

Parameters:

  • Stream: Stream

DispatchMessage (IROTransport, TStream, TStream): Boolean  protected overload

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

Parameters:

  • aTransport:
  • aRequeststream:
  • aResponsestream:

DispatchMessage (IROTransport, TStream, TStream, TROResponseOptions): Boolean  protected overload

function DispatchMessage(const aTransport: IROTransport; aRequestStream: TStream; aResponseStream: TStream; out oResponseOptions: TROResponseOptions): Boolean

Parameters:

  • aTransport:
  • aRequestStream:
  • aResponseStream:
  • oResponseOptions:

DoBeforeDecryptEvent  protected virtual    (declared in TROBaseConnection) obsolete

procedure DoBeforeDecryptEvent(aEncryptedStream: TStream)

Parameters:

  • aEncryptedStream: Stream

EncryptStream (TStream, TStream)  protected overload    (declared in TROBaseConnection)

Encrypt stream

procedure EncryptStream(const Source: TStream; const Dest: TStream)

Parameters:

  • Source: Source
  • Dest: Destination

EncryptStream (TStream)  protected overload    (declared in TROBaseConnection)

Encrypt stream

procedure EncryptStream(const Stream: TStream)

Parameters:

  • Stream: Stream

GetDispatchersClass  protected virtual

Returns TROMessageDispatchers class

function GetDispatchersClass: TROMessageDispatchersClass

GetRODLReader  protected

function GetRODLReader: TROCustomRODLReader

GetSecure  protected virtual

function GetSecure: Boolean

GetServerType  protected virtual

Returns current server type

function GetServerType: TROServerType

GetServiceMetaData  protected

function GetServiceMetaData(aServiceName: string; aOptions: string; out aContentType: string): TStream

Parameters:

  • aServiceName:
  • aOptions:
  • aContentType:

GetTransportObject  protected

Returns itself.

function GetTransportObject: TObject

IsEncryptionUsed  protected    (declared in TROBaseConnection)

Checks if encryption was used

function IsEncryptionUsed: Boolean

IsServiceAllowed  protected

function IsServiceAllowed(Value: string): Boolean

Parameters:

  • Value:

IsStreamEncrypted  protected    (declared in TROBaseConnection)

Checks state of stream

function IsStreamEncrypted(Source: TStream): Boolean

Parameters:

  • Source: Stream

Notification  protected override

Forwards notification messages to all owned components.

procedure Notification(AComponent: TComponent; Operation: TOperation)

Parameters:

  • AComponent: component
  • Operation: operation

ROFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure ROFreeNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

RORemoveFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure RORemoveFreeNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

SendRemoveNotification  protected    (declared in TROComponent)

Forwards notification messages to all owned components.

procedure SendRemoveNotification(aComponent: TComponent)

Parameters:

  • aComponent: component

TriggerReadFromStream  protected

Fires the OnReadFromStream event

procedure TriggerReadFromStream(aSource: TStream)

Parameters:

  • aSource: stream

TriggerWriteToStream  protected

Fires the OnReadFromStream event

procedure TriggerWriteToStream(aDest: TStream)

Parameters:

  • aDest: stream

 

OnAfterEncrypt    (declared in TROBaseConnection)

Fired after stream was encrypted

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

OnAfterServerActivate

Fires after the server has been activated.

property OnAfterServerActivate: TNotifyEvent read write

OnAfterServerDeactivate

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    (declared in TROBaseConnection)

Fired before stream will be decrypted

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

OnBeforeServerActivate

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

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

OnGetRODLReader

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

OnReadFromStream

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 Remoting SDK framework.

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

OnWriteToStream

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 OnWriteToStream(aStream: TStream)