TROBCResponseThread

Overview

The TROBCResponseThread is used internally for retrieving responses asynchronously in the TROBroadcastChannel.

Users can override the TROBroadcastChannel.GetResponseThreadClass method and use their implementation:

function TmyROBroadcastChannel.GetResponseThreadClass: TROUDPResponseThreadClass;
begin
  result := TmyROBCResponseThread;
end;

Location

 

constructor Create (Boolean)    (declared in TROInitializedThread)

Creates a new class instance (standard thread class constructor).

constructor Create(CreateSuspended: Boolean)

Parameters:

  • CreateSuspended: When set to true, this parameter allows to create a thread that will not be started right after it is created. This allows to do some thread class configuration before the execution begins.

constructor Create (Boolean, string)    (declared in TROThread)

Initializes the instance with the given arguments.

constructor Create(iCreateSuspended: Boolean; const iName: string)

Parameters:

  • iCreateSuspended: If true, Execute won’t be called until after Resume is called; if false, Execute is called immediately.
  • iName: Become the value of the Name property.

constructor Create (string, TROIndyUDPChannel, string)    (declared in TROUDPResponseThread)

Initializes a new instance with given parameters.

constructor Create(const aName: string; aChannel: TROIndyUDPChannel; aRequestUID: string)

Parameters:

  • aName: Thread name
  • aChannel: Thread initiator
  • aRequestUID: Distinguished request ID

Channel    (declared in TROUDPResponseThread)

The channel that initiated this thread.

property Channel: TROIndyUDPChannel read write

CriticalSection    (declared in TROUDPResponseThread)

Allows to implement thread safe operations.

property CriticalSection: TCriticalSection read write

DoEnd  protected    (declared in TROUDPResponseThread)

Calls TROIndyUDPChannel for Self and clears Channel.FRunningThread.

procedure DoEnd

DoReceiveResp  protected override

procedure DoReceiveResp

DoTerminate  protected override    (declared in TROThread)

procedure DoTerminate

DoTimeOut  protected    (declared in TROUDPResponseThread)

Calls Channel.DoAsyncThreadTimeOut for RequestUID.

procedure DoTimeOut

Execute  protected override    (declared in TROInitializedThread)

This method will be executed on the background thread, and should contain the user code. In this class, the Execute method must not be overridden in descendant classes, override IntExecute instead.

procedure Execute

Free  reintroduce    (declared in TROThread)

procedure Free

Name  protected    (declared in TROThread)

Sets a readable name for the thread.

property Name: string read write

NeedToSynchonize    (declared in TROUDPResponseThread)

Corresponds to the TROIndyUDPChannel property. If true, calling of DoTimeOut or DoEnd is done through the TThread method.

property NeedToSynchonize: Boolean read write

ReceivedResponse    (declared in TROUDPResponseThread)

Indicates if Channel.CheckStatus returns true for RequestUID before the value of the Channel.Retrys was exceeded.

property ReceivedResponse: Boolean read write

RequestUID    (declared in TROUDPResponseThread)

Used by the TROIndyUDPChannel to distinguish requests.

property RequestUID: string read write

TerminateWaitFor  virtual    (declared in TROThread)

Utility method that combines a call to Terminate with a subsequent call to WaitFor.

procedure TerminateWaitFor

WaitFor  reintroduce    (declared in TROThread)

Blocks the current thread until the current event receives a signal.

function WaitFor: Cardinal

 

Channel    (declared in TROUDPResponseThread)

The channel that initiated this thread.

property Channel: TROIndyUDPChannel read write

CriticalSection    (declared in TROUDPResponseThread)

Allows to implement thread safe operations.

property CriticalSection: TCriticalSection read write

Name  protected    (declared in TROThread)

Sets a readable name for the thread.

property Name: string read write

NeedToSynchonize    (declared in TROUDPResponseThread)

Corresponds to the TROIndyUDPChannel property. If true, calling of DoTimeOut or DoEnd is done through the TThread method.

property NeedToSynchonize: Boolean read write

ReceivedResponse    (declared in TROUDPResponseThread)

Indicates if Channel.CheckStatus returns true for RequestUID before the value of the Channel.Retrys was exceeded.

property ReceivedResponse: Boolean read write

RequestUID    (declared in TROUDPResponseThread)

Used by the TROIndyUDPChannel to distinguish requests.

property RequestUID: string read write

 

constructor Create (Boolean)    (declared in TROInitializedThread)

Creates a new class instance (standard thread class constructor).

constructor Create(CreateSuspended: Boolean)

Parameters:

  • CreateSuspended: When set to true, this parameter allows to create a thread that will not be started right after it is created. This allows to do some thread class configuration before the execution begins.

constructor Create (Boolean, string)    (declared in TROThread)

Initializes the instance with the given arguments.

constructor Create(iCreateSuspended: Boolean; const iName: string)

Parameters:

  • iCreateSuspended: If true, Execute won’t be called until after Resume is called; if false, Execute is called immediately.
  • iName: Become the value of the Name property.

constructor Create (string, TROIndyUDPChannel, string)    (declared in TROUDPResponseThread)

Initializes a new instance with given parameters.

constructor Create(const aName: string; aChannel: TROIndyUDPChannel; aRequestUID: string)

Parameters:

  • aName: Thread name
  • aChannel: Thread initiator
  • aRequestUID: Distinguished request ID

DoEnd  protected    (declared in TROUDPResponseThread)

Calls TROIndyUDPChannel for Self and clears Channel.FRunningThread.

procedure DoEnd

DoReceiveResp  protected override

procedure DoReceiveResp

DoTerminate  protected override    (declared in TROThread)

procedure DoTerminate

DoTimeOut  protected    (declared in TROUDPResponseThread)

Calls Channel.DoAsyncThreadTimeOut for RequestUID.

procedure DoTimeOut

Execute  protected override    (declared in TROInitializedThread)

This method will be executed on the background thread, and should contain the user code. In this class, the Execute method must not be overridden in descendant classes, override IntExecute instead.

procedure Execute

Free  reintroduce    (declared in TROThread)

procedure Free

TerminateWaitFor  virtual    (declared in TROThread)

Utility method that combines a call to Terminate with a subsequent call to WaitFor.

procedure TerminateWaitFor

WaitFor  reintroduce    (declared in TROThread)

Blocks the current thread until the current event receives a signal.

function WaitFor: Cardinal

See Also