Question
Kevin Kindschuh · Jan 15, 2020

How can I determine the IP address from which data is come from a TCP Inbound Adapter?

We want to be able to dispatch based on the IP address who connected to a TCP Inbound adapter.  

The address is in ..Adapter.%outIPAddr when the connection is made and reported with $$$LOGINFIO() but by the time OnProcessInput() is called the value is blank.  

0
0 178
Discussion (1)2
Log in or sign up to continue

Hi Kevin,

You can use IOAddr property from EnsLib.TCP.CountedInboundAdapter

IOAddr property come in this format : 57777<-127.0.0.1:54844

To extract the source IP adresse you can parse it like that :

set fullIOAddr = ..Adapter.IOAddr //57777<-127.0.0.1:54844
 
set remoteIP = $P($P(fullIOAddr,"-",2),":",1) //127.0.0.1