Skip to main content

EnsLib.TCP.OutboundAdapter

class EnsLib.TCP.OutboundAdapter extends Ens.OutboundAdapter, EnsLib.TCP.Common

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

Property Inventory

Method Inventory

Parameters

parameter FAILOVER = 1;
Tells us whether or not we have access to the failover feature implemented
parameter QSize = 0;
How many incoming connections should the OS hold open on our behalf until we get around to dealing with them? For outbound we don't need any QSize. Either we are outbound, or we are in '!' inbound mode, in which case only 1 client at a time (per BO pool job) is allowed.
parameter SETTINGS = RegistryID:Basic:selector?context={Ens.ServiceRegistry.External.ContextSearch/Services?Protocols_1=OTHER},IPAddress:Basic,Port:Basic,BackupIPAddr:Connection,BackupPort:Connection,RetriesToFailover:Connection,StayConnected:Connection,ConnectTimeout:Connection,ReconnectRetry:Connection,GetReply:Connection,ResponseTimeout:Connection;
Inherited description: List of properties can be set as settings in the configuration file format is a comma separated list of property names

Properties

property %lastRetryReconnect as %Integer [ InitialExpression = 0 ];
The value of RetryCount when we last did the reup logic for RetryReconnect. Has an effective minimum of 1 because that's what it gets set to almost instantly. Purpose is to ensure that we don't reup constantly after doing it the first time.
Property methods: %lastRetryReconnectDisplayToLogical(), %lastRetryReconnectGet(), %lastRetryReconnectIsValid(), %lastRetryReconnectLogicalToDisplay(), %lastRetryReconnectNormalize(), %lastRetryReconnectSet()
property BackupIPAddr as %String (MAXLEN = 1000);
IP address of the backup server to send to.
For this adapter, both Backup IP Address and Backup Port must be supplied in order to failover.
Note that this backup server must accept the same values as the original server for important settings such as SSLConfig.
Property methods: BackupIPAddrDisplayToLogical(), BackupIPAddrGet(), BackupIPAddrIsValid(), BackupIPAddrLogicalToDisplay(), BackupIPAddrLogicalToOdbc(), BackupIPAddrNormalize(), BackupIPAddrSet()
property BackupPort as %Integer (MAXVAL = 65535, MINVAL = 0);
Backup TCP Port to connect to in case of network error. Used only in conjunction with BackupIPAddr.
For this adapter, both Backup IP Address and Backup Port must be supplied in order to failover.
Property methods: BackupPortDisplayToLogical(), BackupPortGet(), BackupPortIsValid(), BackupPortLogicalToDisplay(), BackupPortNormalize(), BackupPortSet()
property ConnectTimeout as %Numeric (MINVAL = 0) [ InitialExpression = 5 ];
Number of seconds to wait on each connection attempt
Property methods: ConnectTimeoutDisplayToLogical(), ConnectTimeoutGet(), ConnectTimeoutIsValid(), ConnectTimeoutLogicalToDisplay(), ConnectTimeoutNormalize(), ConnectTimeoutSet()
property GetReply as %Boolean [ InitialExpression = 1 ];
If true, wait to read a reply message back from the socket before returning.
Property methods: GetReplyDisplayToLogical(), GetReplyGet(), GetReplyIsValid(), GetReplyLogicalToDisplay(), GetReplyNormalize(), GetReplySet()
property IPAddress as %String (MAXLEN = 1000) [ Required ];
IP Address to make a TCP connection to; may be prepended with @AgentName:.

If IPAddress starts with '!', the Adapter will wait for a connection from a remote system. If no IP address follows the '!', any remote system may connect; otherwise any listed IP addresses/ports will be allowed to connect.

After the '!' 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.

You may also include CIDR ranges, e.g
192.168.1.0/24 or fe80::4c60:9595:7fb3:0/112.

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

Property methods: IPAddressDisplayToLogical(), IPAddressGet(), IPAddressIsValid(), IPAddressLogicalToDisplay(), IPAddressLogicalToOdbc(), IPAddressNormalize(), IPAddressSet()
property KeepaliveInterval as %Numeric [ InitialExpression = 1 ];
Override initial value
Property methods: KeepaliveIntervalDisplayToLogical(), KeepaliveIntervalGet(), KeepaliveIntervalIsValid(), KeepaliveIntervalLogicalToDisplay(), KeepaliveIntervalNormalize(), KeepaliveIntervalSet()
property Port as %Integer (MAXVAL = 65535, MINVAL = 0) [ Required ];
TCP Port to connect to
Property methods: PortDisplayToLogical(), PortGet(), PortIsValid(), PortLogicalToDisplay(), PortNormalize(), PortSet()
property ReconnectRetry as %Integer (MINVAL = 0) [ InitialExpression = 5 ];
Number of times the adapter attempts to send a message before dropping the connection and reconnecting. A value of 0 (zero) means that the adapter attempts to send the message forever without disconnecting. The default value is 5.
Property methods: ReconnectRetryDisplayToLogical(), ReconnectRetryGet(), ReconnectRetryIsValid(), ReconnectRetryLogicalToDisplay(), ReconnectRetryNormalize(), ReconnectRetrySet()
property ResponseTimeout as %Numeric (MINVAL = -1) [ InitialExpression = 15 ];
Number of seconds to wait for a response to begin arriving back from the remote system after sending a request. Setting the timeout to -1 means wait forever.
Property methods: ResponseTimeoutDisplayToLogical(), ResponseTimeoutGet(), ResponseTimeoutIsValid(), ResponseTimeoutLogicalToDisplay(), ResponseTimeoutNormalize(), ResponseTimeoutSet()
property RetriesToFailover as %Integer (MINVAL = -1) [ InitialExpression = 5 ];
Number of times we need to retry before trying to failover to a backup address.
A value of -1 means never failover. A value of 0 means to failover for the first retry, 1 means to give it one retry with the normal address before failing over for the second retry, etc.
Default value is 5.
Note that if this value is equal to or less than the value of Reconnect Retry, we will swap to the backup before attempting to refresh the connection and so ReconnectRetry will not have a change to occur.
Property methods: RetriesToFailoverDisplayToLogical(), RetriesToFailoverGet(), RetriesToFailoverIsValid(), RetriesToFailoverLogicalToDisplay(), RetriesToFailoverNormalize(), RetriesToFailoverSet()

Methods

method Connect(pTimeout As %Numeric) as %Status
method ConnectedSet(pValue As %Boolean) as %Status
method Disconnect()
method Failover()
method OnInit() as %Status
Inherited description: This user callback method is called just after %OnNew()
method OnKeepalive(pUnused As %Status) as %Status
Inherited description: This method is called from the Host.OnTask() method. It will be called within KeepaliveInterval of the last return from OnTask() or OnKeepalive().
method OnTearDown() as %Status
Inherited description: 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.

Inherited Members

Inherited Properties

Inherited Methods

Subclasses

FeedbackOpens in a new tab