SuperTcpChannelWorker
Overview
The SuperTcpChannelWorker is the base abstract class for the (SCClientWorker) client and the (SCServerWorker) server Super Tcp channel worker classes that are used internally by the SuperTcpClientChannel and SuperTcpServerChannel classes for sending data between client and server asynchronously.
Location
- Reference: RemObjects.SDK.dll
- Namespace: RemObjects.SDK
- Ancestry: AsyncWorker | SuperTcpChannelWorker
constructor protected
constructor(owner: Object)
SuperTcpChannelWorker(Object owner)
Sub New(owner As Object)
Parameters:
- owner:
AckWaitTimeout
Defines the timeout, in milliseconds, in which an "acknowledgement" message is expected to be received for a sent request (default is 60,000, 1 minute).
property AckWaitTimeout: Int32 read write;
Int32 AckWaitTimeout { get; set; }
Property AckWaitTimeout() As Int32
ClientId
property ClientId: Guid read write;
Guid ClientId { get; set; }
Property ClientId() As Guid
DataConnection (declared in AsyncWorker)
Gets or sets the connection to the owner server listening socket.
property DataConnection: Connection read write;
Connection DataConnection { get; set; }
Property DataConnection() As Connection
Done
Performs finishing operations and closes the connection(s), which are processed by this worker, for the client (or the server).
method Done
void Done()
Sub Done()
IncomingData protected
method IncomingData(package: SuperTcpPackage)
void IncomingData(SuperTcpPackage package)
Sub IncomingData(package As SuperTcpPackage)
Parameters:
- package:
IsServer protected
This property identifies the server worker class in the decsendants. It is TRUE in the SCServerWorker class and FALSE in the SCClientWorkerclass.
property IsServer: Boolean read write;
Boolean IsServer { get; set; }
Property IsServer() As Boolean
LastData protected
Specifies the time of the last sending or receiving of data.
property LastData: DateTime read;
DateTime LastData { get; }
ReadOnly Property LastData() As DateTime
MaxPackageLen
Abstract property.
When overriden in the (SCClientWorker) client and (SCServerWorker) server worker classes, this property takes the MaxPackageSize value of the owning channel (SuperTcpServerChannel.MaxPackageSize or SuperTcpClientChannel.MaxPackageSize, accordingly).
property MaxPackageLen: Int32 read;
Int32 MaxPackageLen { get; }
ReadOnly Property MaxPackageLen() As Int32
Owner (declared in AsyncWorker)
property Owner: Object read;
Object Owner { get; }
ReadOnly Property Owner() As Object
ReceivedAck protected
method ReceivedAck(id: Int32)
void ReceivedAck(Int32 id)
Sub ReceivedAck(id As Int32)
Parameters:
- id:
RemoteMaxPackageLen
Determines the maximum size of data that the other side (client or server) can receive.
property RemoteMaxPackageLen: Int32 read;
Int32 RemoteMaxPackageLen { get; }
ReadOnly Property RemoteMaxPackageLen() As Int32
Running
property Running: Boolean read;
Boolean Running { get; }
ReadOnly Property Running() As Boolean
ScCmdNoAck_MsgTooLarge
const ScCmdNoAck_MsgTooLarge: Byte = 0;
const Byte ScCmdNoAck_MsgTooLarge = 0
Dim ScCmdNoAck_MsgTooLarge As Byte = 0
ScCmdNoAck_QueueFull
const ScCmdNoAck_QueueFull: Byte = 3;
const Byte ScCmdNoAck_QueueFull = 3
Dim ScCmdNoAck_QueueFull As Byte = 3
ScCmdNoAck_ScCmdOptionsSupported
const ScCmdNoAck_ScCmdOptionsSupported: Byte = 255;
const Byte ScCmdNoAck_ScCmdOptionsSupported = 255
Dim ScCmdNoAck_ScCmdOptionsSupported As Byte = 255
ScCmdNoAck_Timeout
const ScCmdNoAck_Timeout: Byte = 1;
const Byte ScCmdNoAck_Timeout = 1
Dim ScCmdNoAck_Timeout As Byte = 1
scCmdNoAck_UnknownCommand
const scCmdNoAck_UnknownCommand: Byte = 2;
const Byte scCmdNoAck_UnknownCommand = 2
Dim scCmdNoAck_UnknownCommand As Byte = 2
SendNoAck
This method will inform the other side (client or server) about an error encountered during perfoming a callback (for example if the response message cannot be sent because its size is greater than the other side can receive (greater than RemoteMaxPackageLength)).
method SendNoAck(id: Int32; errorCode: Byte)
void SendNoAck(Int32 id, Byte errorCode)
Sub SendNoAck(id As Int32, errorCode As Byte)
Parameters:
- id:
- errorCode:
SendPackage
Sends a package to the other side.
method SendPackage(id: Int32; data: array of Byte): Int32
Int32 SendPackage(Int32 id, Byte[] data)
Function SendPackage(id As Int32, data As Byte()) As Int32
Parameters:
- id:
- data:
Setup
method Setup
void Setup()
Sub Setup()
SetupClientConnection protected
method SetupClientConnection
void SetupClientConnection()
Sub SetupClientConnection()
SetupMainLoop protected
method SetupMainLoop
void SetupMainLoop()
Sub SetupMainLoop()
SkipAck
Defines whether "acknowledgement" messages are skipped.
property SkipAck: Boolean read write;
Boolean SkipAck { get; set; }
Property SkipAck() As Boolean
TimerCallback protected
method TimerCallback(state: Object)
void TimerCallback(Object state)
Sub TimerCallback(state As Object)
Parameters:
- state:
UnknownNoAck protected
method UnknownNoAck(id: Int32; errorCode: Byte)
void UnknownNoAck(Int32 id, Byte errorCode)
Sub UnknownNoAck(id As Int32, errorCode As Byte)
Parameters:
- id:
- errorCode:
WaitingForAck protected
method WaitingForAck(id: Int32; value: SuperTcpEventPackage)
void WaitingForAck(Int32 id, SuperTcpEventPackage value)
Sub WaitingForAck(id As Int32, value As SuperTcpEventPackage)
Parameters:
- id:
- value:
ScCmdNoAck_MsgTooLarge
const ScCmdNoAck_MsgTooLarge: Byte = 0;
const Byte ScCmdNoAck_MsgTooLarge = 0
Dim ScCmdNoAck_MsgTooLarge As Byte = 0
ScCmdNoAck_QueueFull
const ScCmdNoAck_QueueFull: Byte = 3;
const Byte ScCmdNoAck_QueueFull = 3
Dim ScCmdNoAck_QueueFull As Byte = 3
ScCmdNoAck_ScCmdOptionsSupported
const ScCmdNoAck_ScCmdOptionsSupported: Byte = 255;
const Byte ScCmdNoAck_ScCmdOptionsSupported = 255
Dim ScCmdNoAck_ScCmdOptionsSupported As Byte = 255
ScCmdNoAck_Timeout
const ScCmdNoAck_Timeout: Byte = 1;
const Byte ScCmdNoAck_Timeout = 1
Dim ScCmdNoAck_Timeout As Byte = 1
scCmdNoAck_UnknownCommand
const scCmdNoAck_UnknownCommand: Byte = 2;
const Byte scCmdNoAck_UnknownCommand = 2
Dim scCmdNoAck_UnknownCommand As Byte = 2
AckWaitTimeout
Defines the timeout, in milliseconds, in which an "acknowledgement" message is expected to be received for a sent request (default is 60,000, 1 minute).
property AckWaitTimeout: Int32 read write;
Int32 AckWaitTimeout { get; set; }
Property AckWaitTimeout() As Int32
ClientId
property ClientId: Guid read write;
Guid ClientId { get; set; }
Property ClientId() As Guid
DataConnection (declared in AsyncWorker)
Gets or sets the connection to the owner server listening socket.
property DataConnection: Connection read write;
Connection DataConnection { get; set; }
Property DataConnection() As Connection
IsServer protected
This property identifies the server worker class in the decsendants. It is TRUE in the SCServerWorker class and FALSE in the SCClientWorkerclass.
property IsServer: Boolean read write;
Boolean IsServer { get; set; }
Property IsServer() As Boolean
LastData protected
Specifies the time of the last sending or receiving of data.
property LastData: DateTime read;
DateTime LastData { get; }
ReadOnly Property LastData() As DateTime
MaxPackageLen
Abstract property.
When overriden in the (SCClientWorker) client and (SCServerWorker) server worker classes, this property takes the MaxPackageSize value of the owning channel (SuperTcpServerChannel.MaxPackageSize or SuperTcpClientChannel.MaxPackageSize, accordingly).
property MaxPackageLen: Int32 read;
Int32 MaxPackageLen { get; }
ReadOnly Property MaxPackageLen() As Int32
Owner (declared in AsyncWorker)
property Owner: Object read;
Object Owner { get; }
ReadOnly Property Owner() As Object
RemoteMaxPackageLen
Determines the maximum size of data that the other side (client or server) can receive.
property RemoteMaxPackageLen: Int32 read;
Int32 RemoteMaxPackageLen { get; }
ReadOnly Property RemoteMaxPackageLen() As Int32
Running
property Running: Boolean read;
Boolean Running { get; }
ReadOnly Property Running() As Boolean
SkipAck
Defines whether "acknowledgement" messages are skipped.
property SkipAck: Boolean read write;
Boolean SkipAck { get; set; }
Property SkipAck() As Boolean
constructor protected
constructor(owner: Object)
SuperTcpChannelWorker(Object owner)
Sub New(owner As Object)
Parameters:
- owner:
Done
Performs finishing operations and closes the connection(s), which are processed by this worker, for the client (or the server).
method Done
void Done()
Sub Done()
IncomingData protected
method IncomingData(package: SuperTcpPackage)
void IncomingData(SuperTcpPackage package)
Sub IncomingData(package As SuperTcpPackage)
Parameters:
- package:
ReceivedAck protected
method ReceivedAck(id: Int32)
void ReceivedAck(Int32 id)
Sub ReceivedAck(id As Int32)
Parameters:
- id:
SendNoAck
This method will inform the other side (client or server) about an error encountered during perfoming a callback (for example if the response message cannot be sent because its size is greater than the other side can receive (greater than RemoteMaxPackageLength)).
method SendNoAck(id: Int32; errorCode: Byte)
void SendNoAck(Int32 id, Byte errorCode)
Sub SendNoAck(id As Int32, errorCode As Byte)
Parameters:
- id:
- errorCode:
SendPackage
Sends a package to the other side.
method SendPackage(id: Int32; data: array of Byte): Int32
Int32 SendPackage(Int32 id, Byte[] data)
Function SendPackage(id As Int32, data As Byte()) As Int32
Parameters:
- id:
- data:
Setup
method Setup
void Setup()
Sub Setup()
SetupClientConnection protected
method SetupClientConnection
void SetupClientConnection()
Sub SetupClientConnection()
SetupMainLoop protected
method SetupMainLoop
void SetupMainLoop()
Sub SetupMainLoop()
TimerCallback protected
method TimerCallback(state: Object)
void TimerCallback(Object state)
Sub TimerCallback(state As Object)
Parameters:
- state:
UnknownNoAck protected
method UnknownNoAck(id: Int32; errorCode: Byte)
void UnknownNoAck(Int32 id, Byte errorCode)
Sub UnknownNoAck(id As Int32, errorCode As Byte)
Parameters:
- id:
- errorCode:
WaitingForAck protected
method WaitingForAck(id: Int32; value: SuperTcpEventPackage)
void WaitingForAck(Int32 id, SuperTcpEventPackage value)
Sub WaitingForAck(id As Int32, value As SuperTcpEventPackage)
Parameters:
- id:
- value: