Class Reference
IRIS for UNIX 2024.1.2
InterSystems: The power behind what matters   
Documentation  Search
  [USER] >  [EnsLib] >  [TCP] >  [DuplexAdapter]
Private  Storage   

class EnsLib.TCP.DuplexAdapter extends Ens.InboundAdapter, Ens.OutboundAdapter

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
5 14 20


Summary

Properties
%CredentialsObj %WarnedLatest %isTCPEventDevice BusinessHost
CallInterval Credentials EventDevice EventPort
IPAddress IPDevice IPPort IsConnected
IsSpawnedJob JobPerConnection KeepaliveInterval LocalInterface
PrincipalDevice QSize RegistryID SSLConfig
TCPReadTimeout

Methods
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IsA %IsModified %New
%NormalizeObject %ObjectModified %OriginalNamespace %PackageName
%RemoveFromSaveSet %SerializeObject %SetModified %ValidateObject
AssignOneSetting ClearAllAppData ClearEventDevice ClearRuntimeAppData
ClearStaticAppData ClearTCPEventDevice CloseDevice CloseEventDevice
CloseTCPEventDevice CredentialsSet EnumerateSettingsClose EnumerateSettingsExecute
EnumerateSettingsFetch EventDeviceSet GetSettings OnCloseConnection
OnDeviceDisconnected OnDeviceReady OnDeviceTimeout OnInit
OnKeepalive OnOpenConnection OnTask OnTearDown
OpenDevice OpenEventDevice OpenTCPEventDevice OutputData
ResetDevice connectedJob


Parameters

• parameter InputBufferSize = 8192;
• parameter OpenTimeout = 5;
• parameter OutputBufferSize = 8192;
• parameter SERVICEINPUTCLASS = "Ens.StringContainer";
• parameter SETTINGS = "JobPerConnection:Connection,SSLConfig:Connection:sslConfigSelector,QSize:Connection,LocalInterface:Connection:selector?context={Ens.ContextSearch/TCPLocalInterfaces},IPPort:Basic,IPAddress:Basic";
List of properties can be set as settings in the configuration file format is a comma separated list of property names

Properties

• property %isTCPEventDevice as %Boolean [ InitialExpression = 0,Transient ];
• property EventDevice as %String;
The event device name
• property EventPort as %Integer;
The event device port number
• property IPAddress as %String;
IP address to connect to. This property is null if it is in listening mode
• property IPDevice as %String;
The TCP device name
• property IPPort as %Integer;
IP Port
• property IsConnected as %Boolean [ InitialExpression = 0 ];
Boolean to indicate if the TCP device is connected
• property IsSpawnedJob as %Boolean [ InitialExpression = 0 ];
Boolean to indicate if the current job is spawned with TCP device
• property JobPerConnection as %Boolean [ InitialExpression = 1 ];
Spawn a new Job to handle each incoming TCP connection. Allows simultaneous handling of multiple connections.
• property LocalInterface as %String(MAXLEN=250);
In a multi-homed system, specify which network interface the TCP connection should go through. An empty value means to use any interface.
To be able to bind to IPv6 interfaces you may need to enable IPv6 in your Ensemble instance. This is done in the System Management Portal under System Administration > Configuration > Additional Settings > Startup, by editing the IPv6 setting.
• property PrincipalDevice as %String;
Store the principal device of the current process
• property QSize as %Integer(MAXVAL=1000,MINVAL=0) [ InitialExpression = 100 ];
How many incoming connections should the OS hold open until the Business Service processes them.

The default value is 100 and the maximum allowed value is 1000.
However, the maximum incoming connections the OS can hold open until the Business Service processes them depends on the TCP implementation.

Set to 0 if only one connection at a time is expected and subsequent connections ought to be refused immediately by the OS.

Note: If QSize is 0 a client attempting to connect will be refused connection by the operating system (RST,ACK) if the Business Service is processing a previous incoming connection.
This could lead to a scenario where a client is connected to the Business Service but disconnects and attempts to reconnect again in the brief period before the listening socket is re-opened by the Business Service and the client does not retry to connect as a result.

• property SSLConfig as %String(MAXLEN=350);
The name of an existing SSL/TLS system configuration to use (Secure Socket Layer / Transport Layer Security), which can be configured in the System Management Portal under System Administration > Security.

If your SSL Configuration requires you to supply a password for the local private key file, specify it in the Private key password property of the SSL/TLS Configuration.

• property TCPReadTimeout as %Integer;
Indicate number of seconds to wait before calling OnDeviceTimeout

Methods

• method ClearEventDevice() as %Status
• method ClearTCPEventDevice() as %Status
• method CloseDevice() as %Status
• method CloseEventDevice() as %Status
• method CloseTCPEventDevice() as %Status
• method EventDeviceSet(arg) as %Status
This is a Set accessor method for the EventDevice property.
• method OnCloseConnection() as %Status
• method OnDeviceDisconnected() as %Status
• method OnDeviceReady(pShouldExit As %Boolean) as %Status
• method OnDeviceTimeout(pShouldExit As %Boolean) as %Status
• method OnInit() as %Status
This user callback method is called just after %OnNew()
• method OnOpenConnection() as %Status
• method OnTask() as %Status
default InboundAdapter behavior: always call ProcessInput on CallInterval
• method OnTearDown() as %Status
This user callback method is called just before %OnClose()
• method OpenDevice() as %Status
• method OpenEventDevice(pUseTCP As %Boolean = 0) as %Status
• method OpenTCPEventDevice() as %Status
• method OutputData(pData As %String) as %Status
• method ResetDevice() as %Status
• classmethod connectedJob(pBusinessServiceConfigName As %String) as %Status


Copyright (c) 2025 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.