IROAbstractTCPConnection

Overview

The IROAbstractTCPConnection interface provides a rich set of methods and properties to organize asynchronous TCP connections in the Channels. The IROAbstractTCPConnection interface is used in the TROAsyncSuperTCPServerSocketClient and the TROAsyncSuperChannelWorker classes.

In the TROIcsTCPConnection class, the IROAbstractTCPConnection interface is used as base interface which implements the asynchronous TCP connection in the Super TCP Channel.

Location

Implemented in

 

BeginConnect

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

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

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

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

EndConnect

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

function EndConnect: Boolean

EndDisconnect

Ends disconnecting the local socket from the connected remote socket.

procedure EndDisconnect

EndReceive

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

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

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

function GetOnHaveIncompleteData: TROAsyncCallback

OnDisconnected

Event handler that will be signalled after closing the TCP connection for the command handler-enabled client.

property OnDisconnected: TROAsyncCallback read write
delegate: procedure OnDisconnected(const Sender: IROAbstractTCPConnection)

OnHaveIncompleteData

Event handler that will be signaled when the client did not receive the complete data.

property OnHaveIncompleteData: TROAsyncCallback read write
delegate: procedure OnHaveIncompleteData(const Sender: IROAbstractTCPConnection)

SetOnHaveIncompleteData

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.

 

BeginConnect

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

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

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

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

EndConnect

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

function EndConnect: Boolean

EndDisconnect

Ends disconnecting the local socket from the connected remote socket.

procedure EndDisconnect

EndReceive

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

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

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

function GetOnHaveIncompleteData: TROAsyncCallback

SetOnHaveIncompleteData

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.

 

OnDisconnected

Event handler that will be signalled after closing the TCP connection for the command handler-enabled client.

property OnDisconnected: TROAsyncCallback read write
delegate: procedure OnDisconnected(const Sender: IROAbstractTCPConnection)

OnHaveIncompleteData

Event handler that will be signaled when the client did not receive the complete data.

property OnHaveIncompleteData: TROAsyncCallback read write
delegate: procedure OnHaveIncompleteData(const Sender: IROAbstractTCPConnection)

See Also