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 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,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 ];
Property methods: %lastRetryReconnectDisplayToLogical(), %lastRetryReconnectGet(), %lastRetryReconnectIsValid(), %lastRetryReconnectLogicalToDisplay(), %lastRetryReconnectNormalize(), %lastRetryReconnectSet()
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.
If :port or |port is specified, connections from other ports at the associated address will be refused.

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()

Methods

method Connect(pTimeout As %Numeric) as %Status
method ConnectedSet(pValue As %Boolean) as %Status
method Disconnect()
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