TROIcsTCPConnection

Overview

The TROIcsTCPConnection class implements the IROAbstractTCPConnection interface. It is used internally by the TROIcsAsyncSuperChannelWorker to setup TROAsyncSuperTCPServerSocketClient event callbacks.

Location

Implements

Instance Methods


constructor Create

Creates a new instance.

constructor Create(ClientSocket: TROAsyncSuperTCPServerSocketClient)

Parameters:

  • ClientSocket:

BeginConnect  protected

Begins to connect the local socket to the remote socket with the specified address.

procedure BeginConnect(const aAdress: string; aPort: Integer; aCallback: TROAsyncCallback)

Parameters:

  • aAdress: Specified server address
  • aPort: Port the server will be listening to
  • aCallback: Callback method that will receive and correctly process the result of connect.

BeginDisconnect  protected

Begins to disconnect the local socket from the connected remote socket.

procedure BeginDisconnect(aForce: Boolean; aCallback: TROAsyncCallback)

Parameters:

  • aForce: True if the current local socket can be reused after the connection is closed, otherwise false.
  • aCallback: Callback method that will receive and correctly process the result of disconnect.

BeginReceive  protected

Begins to asynchronously receive data from the remote socket.

procedure BeginReceive(aData: Pointer; aSize: Integer; aCallback: TROAsyncCallback)

Parameters:

  • aData: Pointer to the received data
  • aSize: Size of the received data
  • aCallback: Callback method that will receive the data and correctly process it.

BeginSend  protected

Sends data asynchronously to a connected remote socket.

procedure BeginSend(aData: Pointer; aSize: Integer; aCallback: TROAsyncCallback)

Parameters:

  • aData: Pointer to the sent data
  • aSize: Size of sent data
  • aCallback: Callback method that will send the data

ClearClientSocket

procedure ClearClientSocket

EndConnect  protected

Ends the connection to the remote socket with the specified address.

function EndConnect: Boolean

EndDisconnect  protected

Ends disconnecting the local socket from the connected remote socket.

procedure EndDisconnect

EndReceive  protected

Ends receiving data from the remote socket and returns the number of received bytes.
This method completes the asynchronous read operation started in the BeginReceive method.

function EndReceive: Integer

EndSend  protected

Ends sending data to the remote socket. If successful, the number of bytes sent to the remote socket are returned, otherwise an "invalid socket" error is raised.
The function completes the asynchronous send operation started in BeginSend.

function EndSend: Integer

GetOnHaveIncompleteData  protected

Returns the callback method that is associated with the OnHaveIncompleteData event.

function GetOnHaveIncompleteData: TROAsyncCallback

GetSelf  protected

Returns the object that realizes the current interface.

function GetSelf: TROIcsTCPConnection

SetOnHaveIncompleteData  protected

Sets the callback method that will be associated with the OnHaveIncompleteData event.

procedure SetOnHaveIncompleteData(aCallback: TROAsyncCallback)

Parameters:

  • aCallback: Specified callback method that will receive and process the result of the OnHaveIncompleteData event.