TROIndyTCPChannel 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

InterfacesClassesEnumsAliasesImplements

Contents

Overview

TROIndyTCPChannel implements a TCP based channel that uses the socket implementation provided by the open source Indy components that ship with Delphi.

Due to a bug in Indy, the Indy HTTP and TCP Channels cannot be used inside the IDE at design time.

If you need to use your channels at design time, for example in combination with Data Abstract to receive schema information or live data preview, we recommend using one of the other channels such as the TROWinInetHTTPChannel.


Location

uROIndyTCPChannel.pas

Implemented interfaces


Properties

Busy     (declared in TROTransportChannel)

Informs whether the channel is currently busy executing a remote request (true) or not (false). Most channels (except most notably the TROSuperTCPChannel) are only capable of performing one request at a time; if a second request is attempted while the channel is Busy, an EROChannelBusy exception will be raised.



property Busy: boolean read


CurrentLocator     (declared in TROTransportChannel)

Returns which of the fail-over/load balancing servers configured in the ServerLocators is currently active. Depending on the DispatchOptions defined, this value might change with each request, or only if the current server fails.



property CurrentLocator: TROServerLocator read write


DisableNagle

Controls whether data packets are sent individually or if small packets are held back to send as part of fewer larger data packets. Normally, you will want this disabled as it can have a significant effect on performance. The only time when its worth keeping the property enabled is when there are many small packets to be sent and you need to keep network bandwidth to a minimum.

See more at wikipedia.org



property DisableNagle:


DispatchOptions     (declared in TROCustomIndyTCPChannel)

See TROTransportChannel properties for description.



property DispatchOptions:


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


FaultToleranceLocatorIdx     (declared in TROTransportChannel)



property FaultToleranceLocatorIdx: integer read write


Host

The host name or IP address of the server to connect to.



property Host:


IndyClient

Provides read-only access to the underlying Indy-based object that wraps the client socket.



property IndyClient:


isProbeMode   protected     (declared in TROTransportChannel)

Returns True if channel is used for probing purposes



property isProbeMode: Boolean read


KeepAlive

Controls whether the TCP connection is retained for further use or disconnected immediately after remote request is completed. The default value is false, the connection is disconnected.



property KeepAlive:


LoadBalancerLocatorIdx     (declared in TROTransportChannel)



property LoadBalancerLocatorIdx: Integer read write


OnAfterProbingServer     (declared in TROCustomIndyTCPChannel)

See TROTransportChannel events for description.



property OnAfterProbingServer:


OnAfterProbingServers     (declared in TROCustomIndyTCPChannel)

See TROTransportChannel events for description.



property OnAfterProbingServers:


OnBeforeProbingServer     (declared in TROCustomIndyTCPChannel)

See TROTransportChannel events for description.



property OnBeforeProbingServer:


OnBeforeProbingServers     (declared in TROCustomIndyTCPChannel)

See TROTransportChannel events for description.



property OnBeforeProbingServers:


OnLoginNeeded     (declared in TROCustomIndyTCPChannel)

See TROTransportChannel events for description.



property OnLoginNeeded:


OnProgress     (declared in TROCustomIndyTCPChannel)

See TROTransportChannel events for description.



property OnProgress:


OnReceiveStream     (declared in TROCustomIndyTCPChannel)

See TROTransportChannel events for description.



property OnReceiveStream:


OnSendStream     (declared in TROCustomIndyTCPChannel)

See TROTransportChannel events for description.



property OnSendStream:


OnServerLocatorAssignment     (declared in TROCustomIndyTCPChannel)

See TROTransportChannel events for description.



property OnServerLocatorAssignment:


Port

Specifies the port number used by the server (default for RemObjects SDK TCP servers is 8090).



property Port:


ProbeFrequency     (declared in TROCustomIndyTCPChannel)

See TROTransportChannel properties for description.



property ProbeFrequency:


ProbeServers     (declared in TROCustomIndyTCPChannel)

See TROTransportChannel properties for description.



property ProbeServers:


ServerLocators     (declared in TROCustomIndyTCPChannel)

See TROTransportChannel properties for description.



property ServerLocators:


SynchronizedProbing     (declared in TROCustomIndyTCPChannel)

See TROTransportChannel properties for description.



property SynchronizedProbing:


TargetUri     (declared in TROTransportChannel)



property TargetUri: TROUri read write


TargetUrl     (declared in TROCustomIndyTCPChannel)



property TargetUrl:


ThreadSafe   protected     (declared in TROTransportChannel)



property ThreadSafe: Boolean read write


Timeout     (declared in TROCustomIndyTCPChannel)

The TCP socket timeout, controls underlying Indy object timeout property.



property Timeout: Integer read write


Class Methods

ChannelMatchingTargetUri     (declared in TROTransportChannel)



function ChannelMatchingTargetUri(const aUri: TROUri): TROTransportChannel


Parameters:

  • aUri:


ChannelMatchingTargetUrl     (declared in TROTransportChannel)



function ChannelMatchingTargetUrl(const aUrl: string): TROTransportChannel


Parameters:

  • aUrl:


Instance Methods

constructor Create   override     (declared in TROCustomIndyTCPChannel)

Creates a new instance.


constructor Create(aOwner: TComponent)


Parameters:

  • aOwner: Owner component.


destructor Destroy   override     (declared in TROCustomIndyTCPChannel)

The standard destructor.


destructor Destroy


Assign   override     (declared in TROCustomIndyTCPChannel)



procedure Assign(aSource: TPersistent)


Parameters:

  • aSource:


AsyncException   protected virtual     (declared in TROTransportChannel)

Notifies about an exception in an asynchronous mode.


procedure AsyncException(aAsyncInterface: IROAsyncInterface; AsyncException: Exception)


Parameters:

  • aAsyncInterface:
  • AsyncException:


BeforeDispatch   protected virtual     (declared in TROTransportChannel)

Allows an implimentation to do necessary preparatory actions (checking the readiness of the channel, restore session data, etc.).


procedure BeforeDispatch(aMessage: IROMessage)


Parameters:

  • aMessage:


ChangeServerLocator   protected virtual     (declared in TROTransportChannel)



procedure ChangeServerLocator(var faultstartlocatoridx: integer; var aRetry: Boolean; const aException: Exception)


Parameters:

  • faultstartlocatoridx:
  • aRetry:
  • aException:


CheckProperties   virtual     (declared in TROTransportChannel)

Validates channel properties


procedure CheckProperties


CreateIndyClient   protected virtual     (declared in TROCustomIndyTCPChannel)

This internal method is responsible for creating underlying Indy object to use by the channel. Returns the object created.


function CreateIndyClient: TIdTCPClientBaseClass


DecodeEventStream   protected     (declared in TROTransportChannel)

Decrypts the stream.


procedure DecodeEventStream(const aStream: TStream)


Parameters:

  • aStream:


Dispatch (IROMessage)   protected reintroduce overload     (declared in TROTransportChannel)

Sends a request message through the Self channel for processing and gets back an aMessage. CodeGen uses this method when generating a proxy from RODL Files.


procedure Dispatch(aMessage: IROMessage)


Parameters:

  • aMessage:


DoAfterEncryptEvent   protected virtual obsolete     (declared in TROBaseConnection)



procedure DoAfterEncryptEvent(aEncryptedStream: TStream)


Parameters:

  • aEncryptedStream:


DoAfterProbingServerEvent   protected virtual     (declared in TROTransportChannel)

Fires OnAfterProbingServer event


procedure DoAfterProbingServerEvent(const aServerLocator: TROServerLocator; const Failed: Boolean)


Parameters:

  • aServerLocator:
  • Failed:


DoAfterProbingServersEvent   protected virtual     (declared in TROTransportChannel)

Fires OnAfterProbingServers event


procedure DoAfterProbingServersEvent(const ProbedCount: integer; const EnabledCount: integer; const DisabledCount: integer)


Parameters:

  • ProbedCount:
  • EnabledCount:
  • DisabledCount:


DoBeforeDecryptEvent   protected virtual obsolete     (declared in TROBaseConnection)



procedure DoBeforeDecryptEvent(aEncryptedStream: TStream)


Parameters:

  • aEncryptedStream:


DoBeforeProbingServerEvent   protected virtual     (declared in TROTransportChannel)

Fires OnBeforeProbingServer event


procedure DoBeforeProbingServerEvent(const aServerLocator: TROServerLocator)


Parameters:

  • aServerLocator:


DoBeforeProbingServersEvent   protected virtual     (declared in TROTransportChannel)

Fires OnBeforeProbingServers event


procedure DoBeforeProbingServersEvent


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:


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:


DoException   protected virtual     (declared in TROTransportChannel)

Fires OnException event


procedure DoException(anException: Exception; var aRetry: Boolean)


Parameters:

  • anException:
  • aRetry:


DoLoginNeeded   protected virtual     (declared in TROTransportChannel)

Fires OnLoginNeeded event


procedure DoLoginNeeded(anException: Exception; var aRetry: Boolean)


Parameters:

  • anException:
  • aRetry:


DoReceiveStreamEvent   protected virtual     (declared in TROTransportChannel)

Fires OnReceiveStream event


procedure DoReceiveStreamEvent(const aStream: TStream)


Parameters:

  • aStream:


DoSendStreamEvent   protected virtual     (declared in TROTransportChannel)

Fires OnSendStream event


procedure DoSendStreamEvent(const aStream: TStream)


Parameters:

  • aStream:


DoServerLocatorAssignmentEvent   protected virtual     (declared in TROTransportChannel)

Fires OnServerLocatorAssignment event


procedure DoServerLocatorAssignmentEvent(const aLocator: TROServerLocator; const aException: Exception)


Parameters:

  • aLocator:
  • aException:


GetClientAddress   protected     (declared in TROCustomIndyTCPChannel)

Returns the client IP address as it is provided bu the underlying Indy object.


function GetClientAddress: string


GetTargetUri   protected override     (declared in TROCustomIndyTCPChannel)



function GetTargetUri: TROUri


GetTransportObject   protected override     (declared in TROCustomIndyTCPChannel)

Returns self as a transport object.


function GetTransportObject: TObject


InitServerLocator   protected virtual     (declared in TROTransportChannel)

Sets CurrentLocator


function InitServerLocator: Integer


IntDispatch   protected override     (declared in TROCustomIndyTCPChannel)

The main method responsible for dispatching raw request and getting the raw response back.


procedure IntDispatch(aRequest: TStream; aResponse: TStream)


Parameters:

  • aRequest: The stream containing the raw remote service request.
  • aResponse: The stream containing the raw response from the remote service.


IsEncryptionUsed   protected     (declared in TROTransportChannel)

Specifies current Encryption status


function IsEncryptionUsed: Boolean


Notification   protected override     (declared in TROComponent)

Forwards notification messages to all owned components.


procedure Notification(AComponent: TComponent; Operation: TOperation)


Parameters:

  • AComponent:
  • Operation:


Probe   protected     (declared in TROTransportChannel)

Checks the accessibility of servers from the ServerLocators. This method is intended to provide fail-over and load balancing support in the RemObjects SDK Architecture.


function Probe(aServerLocator: TROServerLocator): boolean


Parameters:

  • aServerLocator:


ProbeAll   protected     (declared in TROTransportChannel)

Checks the availability of all known servers.


procedure ProbeAll


ResetProbingClone   protected virtual     (declared in TROTransportChannel)

Resets channel that is used for probing


procedure ResetProbingClone(aProbe: TROTransportChannel)


Parameters:

  • aProbe:


RetrieveMetadata   protected virtual     (declared in TROTransportChannel)

Retrieves metadata from server


procedure RetrieveMetadata(out Metadata: TStream)


Parameters:

  • Metadata:


RetrieveRODL   protected     (declared in TROTransportChannel)

This method is used for to obtaining the RODL library from the server without havin to rely on a channel-specific mechanism (such as a HTTP request to http://servername:port/rodl).


procedure RetrieveRODL(out RODLLibrary: TRODLLibrary)


Parameters:

  • RODLLibrary:


ROFreeNotification     (declared in TROComponent)

Forwards notification messages to all owned RO components.


procedure ROFreeNotification(AComponent: TComponent)


Parameters:

  • AComponent:


RORemoveFreeNotification     (declared in TROComponent)

Disables destruction notification for specified RO component.


procedure RORemoveFreeNotification(AComponent: TComponent)


Parameters:

  • AComponent:


SendRemoveNotification   protected     (declared in TROComponent)

Sends remove notification to specified component


procedure SendRemoveNotification(AComponent: TComponent)


Parameters:

  • AComponent:


SetServerLocator   protected     (declared in TROTransportChannel)

Retrieves the location details of a server from aServerLocator.


procedure SetServerLocator(aServerLocator: TROServerLocator; anException: Exception)


Parameters:

  • aServerLocator:
  • anException:


SetTargetUri   protected override     (declared in TROCustomIndyTCPChannel)



procedure SetTargetUri(const aUri: TROUri)


Parameters:

  • aUri:


TriggerProgress   protected virtual     (declared in TROTransportChannel)

Fires OnProgress event


procedure TriggerProgress(iType: TProgressType; iDirection: TProgressDirection; iTransfered: integer; iTotal: integer)


Parameters:

  • iType:
  • iDirection:
  • iTransfered:
  • iTotal:


Events

onAfterEncrypt obsolete     (declared in TROBaseConnection)



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


OnAfterProbingServer     (declared in TROTransportChannel)

Fires after the channel is done probing a specific server for availability. You can use this event to check the result of the probing, possibly to update internal data structures or to display server status in the user interface.



property OnAfterProbingServer: TROEndProbeServerEvent read write delegate: procedure Invoke(Sender: TROTransportChannel; aServerLocator: TROServerLocator; Failed: boolean)


OnAfterProbingServers     (declared in TROTransportChannel)

Fires after the channel is done probing all servers for availability. You can use this event to check the result of the probing, possibly to update internal data structures or to display server status in the user interface.



property OnAfterProbingServers: TROEndProbeServersEvent read write delegate: procedure Invoke(Sender: TROTransportChannel; ProbedCount: integer; EnabledCount: integer; DisabledCount: integer)


OnAsyncException     (declared in TROTransportChannel)

Fires when exception is raised in asynchronous mode



property OnAsyncException: TROAsyncExceptionEvent read write delegate: procedure Invoke(Sender: TROTransportChannel; Async: IROAsyncInterface; anException: Exception)


onBeforeDecrypt obsolete     (declared in TROBaseConnection)



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


OnBeforeProbingServer     (declared in TROTransportChannel)

Fires before the channel starts probing a specific server for availability. You can use this event to:

  • check or adjust the server configuration
  • to include/exclude the server from being probed by changing the TROServerLocator.Enabled property.



property OnBeforeProbingServer: TROBeginProbeServerEvent read write delegate: procedure Invoke(Sender: TROTransportChannel; aServerLocator: TROServerLocator)


OnBeforeProbingServers     (declared in TROTransportChannel)

Fires before the channel starts probing all servers for availability. You can use this event:

  • to check or adjust the server configurations
  • to include/exclude individual server from being probed by changing their TROServerLocator.Enabled properties.



property OnBeforeProbingServers: TROBeginProbeServersEvent read write delegate: procedure Invoke(Sender: TROTransportChannel)


OnException     (declared in TROTransportChannel)

Fires if an exception is raised during the execution of a remote request. This could be an exception returned from the server, a communication problem or an error within the client. Depending on the type of error, your event handler can try to rectify the problem, and set aRetry to true to have the channel try and perform the request again. For example, an application could show a dialog asking the user to confirm if his internet connection is available, with Cancel and Retry buttons. If aRetry is set to true and the call succeeds at the second attempt, the call will return to the original code that initiated the request, as if the exception never happened.



property OnException: TROExceptionEvent read write delegate: procedure Invoke(Sender: TROTransportChannel; anException: Exception; var aRetry: Boolean)


OnLoginNeeded     (declared in TROTransportChannel)

Fires if an EROSessionNotFound (or the descendant SessionNotFoundException) exception is raised during the execution of a remote request. This usually indicates that the server cannot authenticate the client or that the session has expired. The most common use for this event is to perform a call to a special Login service provided by the server (possibly after prompting the user to enter username and password), and to set the aRetry parameter to true if login was successful.



property OnLoginNeeded: TROExceptionEvent read write delegate: procedure Invoke(Sender: TROTransportChannel; anException: Exception; var aRetry: Boolean)


OnProgress     (declared in TROTransportChannel)

This event fires as the channel is transferring data for a request or response to or from the server, informing of the current progress. It can be used to keep the user interface updated during lengthy transfers,e.g. by showing a progress bar or the remaining transfer volume. Note: the accuracy and frequency of calls to OnProgress depends on the channel type; since channels transport data packets in different sized chunks (or even all-at-once), OnProgress might show a very fine progress for some channels, while jumping from 0 to 100% in one step with others.



property OnProgress: TProgressEvent read write delegate: procedure Invoke(iSender: TObject; iType: TProgressType; iDirection: TProgressDirection; iTransferred: integer; iTotal: integer)


OnReceiveStream     (declared in TROTransportChannel)

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



property OnReceiveStream: TStreamDispatch read write delegate: procedure Invoke(aStream: TStream)


OnSendStream     (declared in TROTransportChannel)

Fires just as a stream with a request message will be sent to the server. The event handler can inspect and possibly modify the stream, before it continues to be sent off to the server.



property OnSendStream: TStreamDispatch read write delegate: procedure Invoke(aStream: TStream)


OnServerLocatorAssignment     (declared in TROTransportChannel)

Fires before changing of a server locator



property OnServerLocatorAssignment: TServerLocatorAssignment read write delegate: procedure Invoke(Sender: TROTransportChannel; aLocator: TROServerLocator; aException: Exception)


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