question

Upvotes
Accepted
13 5 8 9

Not able to use different position i.e. IP and hostname to connect to RFA other than localhost

Hi Team,

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!!

Cheers,Alok

treprfarfa-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

@alokreturns,

Just to clarify,

Are you looking to change position to be specified for entitlement, or are you looking to modify the TREP host you wish to connect to?

If you are running RFA Java,

Use Tools->Config Editor

To modify session->connection->serverList

to point to your trep ADS host.

If you are in RFA C++/.NET, please look at SDK examples, to see how to modify ExampleRFA.cfg or ExampleRFA.reg configuration file, depending on which you are using to configure, to point to the correct infra via

connection->hostname

Is this what you are looking to do?

Hi Zoya,Thanks for your feedback, However I want to connect to a server installed in another host not on 127.0.0.1 (i.e. localhost). Even if I change the hostname name still I can see the position as the local ip as position as shown below

ELEMENT_LIST ELEMENT_ENTRY ApplicationId: 256

ELEMENT_ENTRY Position: 10.0.40.183/ltalok

ELEMENT_ENTRY AllowSuspectData: 1 ELEMENT_ENTRY SingleOpen: 1 ELEMENT_ENTRY SupportBatchRequests: 1

Can you advise whether this is possible and if yes what changes i have to do ?

@alokreturns,

Understood. You will need to modify your RFA configuration.

Are you on RFA Java?

Please use Configuration Editor tool to modify as described in the previous comment.

Are you on RFA C++ or .Net?

Modify the configuration you are using to connect manually, as described in the previous comment. If you are reading config from windows registry, modify configuration using .reg, re-run .reg. If you are reading configuration from config file .cfg, then modify .cfg.

Hi Zoya,

Thanks for your explanation. If I need to change the position specified for entitlement then what I need to do ? Updating serverList in config editor is actually connecting to the server to connect and retrieve the data. I am using RFA java.

Is there anyway I can change the position to different one other than the local host ?

ELEMENT_ENTRY Position: 10.0.40.183/ltalok

Cheers,Alok

Which Edition of RFA that you're currently using (C++, Java or .NET)? Each edition pulls configuration setting differently. Knowing the edition will make me provide a more accurate answer.

Upvote
Accepted
23k 22 9 14

If using JRFA, to set position, encode it into Login,

Described in detail in JRFA Developer Guide->Login

For example:

...
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();
...
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Yes, you can choose to change the server list programmatically,

please refer to Config Package section of RFA Developer Guide to see how.

For additional info this question may be of interest:

Can we set up an RFA Session without using the Config Editor?

Thanks a lot. The above detailed explanation fixed my issue. Thanks again.

Hi Zoya,

Thanks a lot for the explanation!! It helped a lot.

My last doubt, I am using RFA java and using Configuration editor tool I am able to change the serverList. This is working fine. But is there any way we can change the server list programatically using java ? Like we can set the position while encoding login request ?

Thanks in advance!

Cheers,Alok

Upvotes
1.5k 3 5 7

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:

X/Y

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:

10.2.4.132/net
10.2.4.132/WS432D2

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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
7.6k 15 6 9

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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea