TROAsyncSuperTCPServerSocketClient

Overview

The TROAsyncSuperTCPServerSocketClient class represents the client socket that is used internally in the TROCustomIcsAsyncSuperTCPServer to organize client communication.

In most cases, you won't need to use this class directly.

Location

 

constructor Create  override

Creates a new instance.

constructor Create(AOwner: TComponent)

Parameters:

  • AOwner: Owner.

AbstractTCPConnection

Represents the asynchronous TCP connection in the current socket.

property AbstractTCPConnection: IROAbstractTCPConnection read write

ClearROIcsTCPConnection

Clears the corresponding internal TCP connection.

procedure ClearROIcsTCPConnection

ConnectCallback

Callback function which is called after connection with the current socket has started.

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

DetachFromThread

Detaches the current object from the MessagePumpThread.

procedure DetachFromThread

DisconnectCallback

Callback function which is called after disconnection with the current socket has started.

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

HandleBgException  protected

This event handler is called when a client socket experiences a background exception. It is likely to occur when the client aborts the connection before data has been sent.

procedure HandleBgException(Sender: TObject; E: Exception; var CanClose: Boolean)

Parameters:

  • Sender: Specified sender
  • E: Specified exception message
  • CanClose: Output variable. Equals true if the server socket is not in wsInvalidState or wsClosed. Otherwise returns false.

MessagePumpThread

Represents the thread that reads messages for a given number of sockets.

property MessagePumpThread: TROIcsMessagePumpThread read write

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)

ReceiveBuffer

Represents a pointer to the received data.

property ReceiveBuffer: Pointer read write

ReceiveCallback

Callback function which is called after the receiving of data has started.

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

ReceivedBytes

Represents the count of received bytes.

property ReceivedBytes: Integer read write

RequestedReceiveBytes

Represents the count of received bytes which were requested.

property RequestedReceiveBytes: Integer read write

SendCallback

Callback function which is called after the sending of a response to the client has started.

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

SentBytes

Represents the count of bytes in the response.

property SentBytes: Integer read write

StartConnection  override

Starts the connection.

procedure StartConnection

TriggerDataAvailable  protected override

Triggers the request of N bytes and gets an extra byte in front of them. This extra byte will then prevent the correct processing of the other bytes.

function TriggerDataAvailable(Error: Word): Boolean

Parameters:

  • Error: Specified error number

TriggerDataSent  protected override

Triggers the operation of sending data.

procedure TriggerDataSent(Error: Word)

Parameters:

  • Error: Specified error number

TriggerError  protected override

Triggers any error that occured with the current socket.

procedure TriggerError

TriggerSessionClosed  override

Triggers the operation of closing the current connection.

procedure TriggerSessionClosed(Error: Word)

Parameters:

  • Error: Specified error number

TriggerSessionConnected  protected override

Triggers the operation of creating a new connection.

procedure TriggerSessionConnected(Error: Word)

Parameters:

  • Error: Specified error number

TriggerSessionConnectedSpecial  protected override

Triggers the operation of creating a new connection.

procedure TriggerSessionConnectedSpecial(Error: Word)

Parameters:

  • Error: Specified error number

WndProc  protected override

This procedure handles all messages for the current TROAsyncSuperTCPServerSocketClient object. All exceptions must be handled.

procedure WndProc(var MsgRec: TMessage)

Parameters:

  • MsgRec: Specified Windows message

Worker

Represents the corresponding TROIcsAsyncSuperChannelWorker object.

property Worker: TROIcsAsyncSuperChannelWorker read write

 

AbstractTCPConnection

Represents the asynchronous TCP connection in the current socket.

property AbstractTCPConnection: IROAbstractTCPConnection read write

MessagePumpThread

Represents the thread that reads messages for a given number of sockets.

property MessagePumpThread: TROIcsMessagePumpThread read write

ReceiveBuffer

Represents a pointer to the received data.

property ReceiveBuffer: Pointer read write

ReceivedBytes

Represents the count of received bytes.

property ReceivedBytes: Integer read write

RequestedReceiveBytes

Represents the count of received bytes which were requested.

property RequestedReceiveBytes: Integer read write

SentBytes

Represents the count of bytes in the response.

property SentBytes: Integer read write

Worker

Represents the corresponding TROIcsAsyncSuperChannelWorker object.

property Worker: TROIcsAsyncSuperChannelWorker read write

 

constructor Create  override

Creates a new instance.

constructor Create(AOwner: TComponent)

Parameters:

  • AOwner: Owner.

ClearROIcsTCPConnection

Clears the corresponding internal TCP connection.

procedure ClearROIcsTCPConnection

DetachFromThread

Detaches the current object from the MessagePumpThread.

procedure DetachFromThread

HandleBgException  protected

This event handler is called when a client socket experiences a background exception. It is likely to occur when the client aborts the connection before data has been sent.

procedure HandleBgException(Sender: TObject; E: Exception; var CanClose: Boolean)

Parameters:

  • Sender: Specified sender
  • E: Specified exception message
  • CanClose: Output variable. Equals true if the server socket is not in wsInvalidState or wsClosed. Otherwise returns false.

StartConnection  override

Starts the connection.

procedure StartConnection

TriggerDataAvailable  protected override

Triggers the request of N bytes and gets an extra byte in front of them. This extra byte will then prevent the correct processing of the other bytes.

function TriggerDataAvailable(Error: Word): Boolean

Parameters:

  • Error: Specified error number

TriggerDataSent  protected override

Triggers the operation of sending data.

procedure TriggerDataSent(Error: Word)

Parameters:

  • Error: Specified error number

TriggerError  protected override

Triggers any error that occured with the current socket.

procedure TriggerError

TriggerSessionClosed  override

Triggers the operation of closing the current connection.

procedure TriggerSessionClosed(Error: Word)

Parameters:

  • Error: Specified error number

TriggerSessionConnected  protected override

Triggers the operation of creating a new connection.

procedure TriggerSessionConnected(Error: Word)

Parameters:

  • Error: Specified error number

TriggerSessionConnectedSpecial  protected override

Triggers the operation of creating a new connection.

procedure TriggerSessionConnectedSpecial(Error: Word)

Parameters:

  • Error: Specified error number

WndProc  protected override

This procedure handles all messages for the current TROAsyncSuperTCPServerSocketClient object. All exceptions must be handled.

procedure WndProc(var MsgRec: TMessage)

Parameters:

  • MsgRec: Specified Windows message

 

ConnectCallback

Callback function which is called after connection with the current socket has started.

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

DisconnectCallback

Callback function which is called after disconnection with the current socket has started.

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

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)

ReceiveCallback

Callback function which is called after the receiving of data has started.

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

SendCallback

Callback function which is called after the sending of a response to the client has started.

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

See Also