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

abstract class EnsLib.TCP.InboundAdapter extends Ens.InboundAdapter, EnsLib.TCP.Common

A generic, protocol-agnostic TCP adapter. Handles making connections. Traffic content is up to the associated Business Service class.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
3 10 10


Summary

Properties
%CredentialsObj %PoolLimit %WarnedLatest %logConnections
%outIPAddr AllowedIPAddresses BusinessHost CallInterval
Connected Credentials Device IOAddr
JobPerConnection KeepaliveInterval LocalInterface OldIO
Port QSize ReadTimeout RegistryID
SSLConfig Socket StayConnected Terminators

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 ClearRuntimeAppData ClearStaticAppData
ConnectOut ConnectedSet CredentialsSet Disconnect
EnumerateSettingsClose EnumerateSettingsExecute EnumerateSettingsFetch FlushWrite
GetAddress GetSettings IsReadError IsWriteError
OnConnected OnInit OnKeepalive OnTask
OnTearDown TestConnection connectedJob

Subclasses
Ens.Enterprise.MsgBank.BankTCPAdapter EnsLib.EDI.X12.Adapter.TCPInboundAdapter EnsLib.HTTP.InboundAdapter
EnsLib.SOAP.InboundAdapter EnsLib.TCP.CountedInboundAdapter EnsLib.TCP.CountedXMLInboundAdapter
EnsLib.TCP.FramedInboundAdapter EnsLib.TCP.TextLineInboundAdapter

Parameters

• parameter OpenTimeout = 5;
• parameter SETTINGS = "Port:Basic,JobPerConnection:Connection,AllowedIPAddresses:Connection,QSize:Connection";
List of properties can be set as settings in the configuration file format is a comma separated list of property names
• parameter SINGLEPOOLJOB = 1;
Force a single listener job regardless of PoolSize setting

Properties

• property %PoolLimit as %Integer;
• property %outIPAddr as %String;
• property AllowedIPAddresses as %String(MAXLEN=1000);
Optional comma-separated list of remote IP addresses to accept connections from.

You may enter a comma-separated list of remote IP addresses to accept connections from, with IP addresses in dotted decimal form for IPV4 and colon-hex form for IPV6, with optional :port for IPV4 and |port for IPV6, e.g.

192.168.1.22, 192.168.1.22:3298 or fe80::4c60:9595:7fb3:8139, fe80::4c60:9595:7fb3:8139|3298.

If :port or |port is specified, connections from other ports at the associated address will be refused.

If AllowedIPAddresses starts with a '!', the Adapter will initiate a connection to the specified address. In this case only one address may be given. If a port is included, it will supersede the value of the Port setting; otherwise the Port setting will be used to connect to the remote system.

Leaving this value empty means connections will be accepted from any remote IP address.

• property JobPerConnection as %Boolean [ InitialExpression = 1 ];
Spawn a new Job to handle each incoming TCP connection. Allows simultaneous handling of multiple connections.
Note that the performance of this setting can be affected by changing the configured QSize setting of this adapter and by configuring Job Servers as a system configuration option. Note also that when JobPerConnection=1, PoolSize is used to limit the number of connection jobs if it is configured with a value greater than 1.
• property Port as Ens.DataType.TCPAgentPort [ Required ];
TCP Port to connect to (integer value below 65536), may be prepended with @AgentName:
• 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.


Methods

• method ConnectOut(pTimeout As %Numeric) as %Status
• method ConnectedSet(pValue As %Boolean) as %Status
This is a Set accessor method for the Connected property.
• method Disconnect()
• abstract method OnConnected() as %Status
• method OnInit() as %Status
This user callback method is called just after %OnNew()
• method OnKeepalive(pUnused As %Status) as %Status
This method is called from the Host.OnTask() method. It will be called within KeepaliveInterval of the last return from OnTask() or OnKeepalive().
• 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 TestConnection()
Fix up the properties reflecting our connection state in case we thought we were connected but we lost the socket.
• classmethod connectedJob(pBusinessServiceConfigName As %String, pPoolLimit As %Integer) as %Status


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