I am trying to set up a server to connect to TREP and collect data, but instead of localhost i want to use different host (other than localhost). For this I tried changing the position parameter to different IP and host name but still no luck. Can you please advise me on this ?
Many thanks in advance!!
If using JRFA, to set position, encode it into Login,
Described in detail in JRFA Developer Guide->Login
... OMMMsg msg = _pool.acquireMsg(); msg.setMsgType(OMMMsg.MsgType.REQUEST); msg.setMsgModelType(RDMMsgTypes.LOGIN); msg.setIndicationFlags(OMMMsg.Indication.REFRESH); msg.setAttribInfo(null, "ltalok", RDMUser.NameType.USER_NAME); _ommEncoder.encodeMsgInit(msg, OMMTypes.ELEMENT_LIST, OMMTypes.NO_DATA); _ommEncoder.encodeElementListInit(OMMElementList.HAS_STANDARD_DATA, (short)0, (short) 0); _ommEncoder.encodeElementEntryInit("ApplicationId", OMMTypes.ASCII_STRING); _ommEncoder.encodeString("256", OMMTypes.ASCII_STRING); _ommEncoder.encodeElementEntryInit("Position", OMMTypes.ASCII_STRING); _ommEncoder.encodeString("10.0.40.183/ltalok", OMMTypes.ASCII_STRING); _ommEncoder.encodeAggregateComplete(); ...
You generally shouldn't need to mess with the position parameter as it will be set automatically be the RFA API.
If you really need to, then the position parameter must be a string on the form:
Where X is a string representation of an IP v4 address and Y is a hostname. If you cannot figure out a decent name for the host from which you are coming then just use "net". This is not uncommon in Java because - depending on the configuration of your computer - InetAddress.getLocalHost().getHostName() may very well throw UnknownHostException. There are other - and more prudent - ways to obtain a name for your own machine. See this for a better approach.
Some example values of what a position value may look like:
In reality DACS will only validate on the first part (the stuff before the slash) in order to figure out what the current connection count is from that position.
All of this isn't really documented that much but there you have it.
Make sure the X part is really a IPv4 address, not IPv6, as DACS will really choke on that.
What is the error message you received? If it's some message like "A21: A required argument was NULL", it was generated by DACS component DACS 6.3 or newer version requires the login position of consumer application to be in the format of "ip addr/hostname" or “ip addr/net” e.g.”192.168.1.1/net” as Lars said.
So if the position was configured to invalid format such as “localhost”, ADS and DACS would send down “A21: A required argument was NULL” error, and deny the login. You have to verify the Login position the application are sending to the ADS server.
If it's not above error, please let me know the status text you received.