TROIndySuperConnection

Overview

TROIndySuperConnection is a Indy based implementation of TROBaseSuperConnection.

Usage: This class is designed for internal usage only.

Location

 

constructor Create

Creates a new instance.

constructor Create(aConnection: TIdTCPConnection; AFreeOnDestroy: Boolean)

Parameters:

  • aConnection:
  • AFreeOnDestroy:

Client_Connect  override

Called on the client side only to establish initial connection to the server.

procedure Client_Connect(const aHost: string; const aPort: integer)

Parameters:

  • aHost: The host name or IP address of the server.
  • aPort: The port to connect to.

Connection  protected

Active connection

property Connection: TIdTCPConnection read write

Disconnect  override

Called to disconnect the current connection.

procedure Disconnect

isConnected  override

Returns the connected state of the connection.

function isConnected: Boolean

isTimeoutError  override

Returns true in case the last connection error was caused by timeout, false for all other errors. As a rule, errors other than timeouts require the connection to be reestablished from the scratch.

function isTimeoutError: Boolean

PingFrequency  protected    (declared in TROBaseSuperConnection)

Provides read-only access to TROBaseSuperChannelWorker.PingFrequency property.

property PingFrequency: integer read write

PingTimeOut  protected    (declared in TROBaseSuperConnection)

Provides read-only access to TROBaseSuperChannelWorker.PingTimeOut property.

property PingTimeOut: integer read write

ReadBuffer  override

Reads a portion of data from the connection into the buffer.

function ReadBuffer(var Data: ; Len: Integer): integer

Parameters:

  • Data: The buffer to read the data into.
  • Len: Expected length of the data.

ReadByte  override

Reads a byte from the connection and returns it as a result.

function ReadByte: Byte

ReadInteger  override

Reads a 32 bits integer from the connection and returns it as a result.

function ReadInteger: integer

ReadString  override

Reads a string of the specified length from the connection and returns it as a result.

function ReadString(const aLen: integer): string

Parameters:

  • aLen: The length of the string in bytes.

SetNagle  override

Enables or disables Nagle's algorithm usage according to property value introduced by the concrete channel implementation.

procedure SetNagle

TryReadByte  override

Tries to read a byte from the connection. Returns true if the byte was read successfully.

function TryReadByte(var aValue: Byte): boolean

Parameters:

  • aValue: The value of the byte is returned via this parameter if read successfully.

WriteBuffer  override

Writes a portion of data from the buffer to the connection.

procedure WriteBuffer(const Data: ; Len: Integer)

Parameters:

  • Data: The buffer containing data to write.
  • Len: The length of the data.

WriteByte  override

Writes a byte to the connection.

procedure WriteByte(const aValue: Byte)

Parameters:

  • aValue: The byte to write.

WriteInteger  override

Writes a 32 bits integer to the connection.

procedure WriteInteger(const aValue: integer)

Parameters:

  • aValue: The value to write.

WriteString  override

Writes a string to the connection.

procedure WriteString(const AStr: string)

Parameters:

  • AStr: The string to write.

 

Connection  protected

Active connection

property Connection: TIdTCPConnection read write

PingFrequency  protected    (declared in TROBaseSuperConnection)

Provides read-only access to TROBaseSuperChannelWorker.PingFrequency property.

property PingFrequency: integer read write

PingTimeOut  protected    (declared in TROBaseSuperConnection)

Provides read-only access to TROBaseSuperChannelWorker.PingTimeOut property.

property PingTimeOut: integer read write

 

constructor Create

Creates a new instance.

constructor Create(aConnection: TIdTCPConnection; AFreeOnDestroy: Boolean)

Parameters:

  • aConnection:
  • AFreeOnDestroy:

Client_Connect  override

Called on the client side only to establish initial connection to the server.

procedure Client_Connect(const aHost: string; const aPort: integer)

Parameters:

  • aHost: The host name or IP address of the server.
  • aPort: The port to connect to.

Disconnect  override

Called to disconnect the current connection.

procedure Disconnect

isConnected  override

Returns the connected state of the connection.

function isConnected: Boolean

isTimeoutError  override

Returns true in case the last connection error was caused by timeout, false for all other errors. As a rule, errors other than timeouts require the connection to be reestablished from the scratch.

function isTimeoutError: Boolean

ReadBuffer  override

Reads a portion of data from the connection into the buffer.

function ReadBuffer(var Data: ; Len: Integer): integer

Parameters:

  • Data: The buffer to read the data into.
  • Len: Expected length of the data.

ReadByte  override

Reads a byte from the connection and returns it as a result.

function ReadByte: Byte

ReadInteger  override

Reads a 32 bits integer from the connection and returns it as a result.

function ReadInteger: integer

ReadString  override

Reads a string of the specified length from the connection and returns it as a result.

function ReadString(const aLen: integer): string

Parameters:

  • aLen: The length of the string in bytes.

SetNagle  override

Enables or disables Nagle's algorithm usage according to property value introduced by the concrete channel implementation.

procedure SetNagle

TryReadByte  override

Tries to read a byte from the connection. Returns true if the byte was read successfully.

function TryReadByte(var aValue: Byte): boolean

Parameters:

  • aValue: The value of the byte is returned via this parameter if read successfully.

WriteBuffer  override

Writes a portion of data from the buffer to the connection.

procedure WriteBuffer(const Data: ; Len: Integer)

Parameters:

  • Data: The buffer containing data to write.
  • Len: The length of the data.

WriteByte  override

Writes a byte to the connection.

procedure WriteByte(const aValue: Byte)

Parameters:

  • aValue: The byte to write.

WriteInteger  override

Writes a 32 bits integer to the connection.

procedure WriteInteger(const aValue: integer)

Parameters:

  • aValue: The value to write.

WriteString  override

Writes a string to the connection.

procedure WriteString(const AStr: string)

Parameters:

  • AStr: The string to write.

See Also

  • TROIndyClientSuperConnection