question

Upvotes
Accepted
5 2 0 4

Programmatically close any existing connection without login handle

Hi,

Does anyone knows how to programmatically logoff/close any existing connection with TREP's API? Currently, we have a license that allows us to have only one connection at a time and sometimes while coding and testing the program doesn't unregister the login client before ending.

What we came up with was to always persist the login handle as soon as we get it and in the next run if we get an access denied error, we try to unregister the last login handle that we stored. But I'm not quite sure that is going to work... So I was wondering if there's a way of killing all existing connections (using our service account) without asking support to manually close the connection.

Thanks in advance!

Diego.

elektronrefinitiv-realtimetrepconnectionOMMlog-out
icon clock
10 |1500

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

1 Answer

· Write an Answer
Upvote
Accepted
4.4k 10 6 9

Hi @diego.acosta

Are you using RFA C++?

If the answer is yes, then what you did is correct. You have to call unregisterclient() with the login handle in order to log off.

Then again, you can also log off by clean up RFA and then re-initialize everything for your next test. But this could potentially cause a problem if you are not careful.

icon clock
10 |1500

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

Thanks for the quick response Warat! I'm using RFA .net library (for c#).

By "clean up RFA" did you mean using the Cleanup method that is in the code samples? If so, I'm using that code but the problem is that when coding and testing sometimes something goes wrong and the program doesn't reach to execute the cleanup method. That's why I was wondering if there's a way to cleanup previous logins without a handle id...

Not quite, I mean the OMMConsumer cleanup described in Developer Guide, it is chapter 11.3 for RFA .net.

Basically, you have to:

  1. Deactivate Event Queue
  2. Destroy Event Queue
  3. Destroy Event Source (OMMConsumer)
  4. Create new Event Queue and Event Source

The point is, you don't have to uninitialize context if you still using RFA.

Is it possible that if "Context.Uninitialize()" (part of Cleanup method) fails the logout is not completed no matter if the login handle has been successfully unregistered from the omm consumer?

No, Unregister login handle is not tied to Context Uninitialize. If you successfully unregistered login handle, then login closed message should be sent and you should be logged off from TREP.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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