TROIcsMessagePumpThread

Overview

The TROIcsMessagePumpThread reads messages for a given number of sockets. This kind of thread is created internally by the TROIcsMessagePumpThreadList, depending on its options.

The TROIcsAsyncSuperTCPServer class uses these threads internally to handle socket messages in the background. By default, there are numerous sockets per thread, but this can be changed by setting the TROIcsAsyncSuperTCPServer.MaxClientsPerPump property.

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 (TROIcsMessagePumpThreadList)

Creates a new instance.

constructor Create(AOwner: TROIcsMessagePumpThreadList)

Parameters:

  • AOwner:

AddSocket

function AddSocket(ASocket: TCustomWSocket; out ErrorMessage: string): Boolean

Parameters:

  • ASocket:
  • ErrorMessage:

DoTerminate  protected override

procedure DoTerminate

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

RemoveSocket

function RemoveSocket(ASocket: TCustomWSocket; out ErrorMessage: string): Boolean

Parameters:

  • ASocket:
  • ErrorMessage:

SocketCount

property SocketCount: Integer read write

 

SocketCount

property SocketCount: Integer 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 (TROIcsMessagePumpThreadList)

Creates a new instance.

constructor Create(AOwner: TROIcsMessagePumpThreadList)

Parameters:

  • AOwner:

AddSocket

function AddSocket(ASocket: TCustomWSocket; out ErrorMessage: string): Boolean

Parameters:

  • ASocket:
  • ErrorMessage:

DoTerminate  protected override

procedure DoTerminate

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

RemoveSocket

function RemoveSocket(ASocket: TCustomWSocket; out ErrorMessage: string): Boolean

Parameters:

  • ASocket:
  • ErrorMessage: