CORBA :: Get the client ORB address and port with use of IIOP

I have application in CORBA using IIOP protocol, i am using the Java IDL component of the JDK 6 , another ORB implementation.

Implementation of both client and server in Java language.

Is there any way in the JDK ORB implementation to get the client ORB`s host and port from the server (ORB)code ?


is there any way with use of IIOP protocol, get client the host and port ?

This is we are doing for identification of the client to track the who is requested


I don't think there is any portable way to do this. Perhaps there is for your particular ORB, I don't know. Recall that CORBA tries very hard to hide the transport details from the application. The application may not even be using IIOP, and thus there would be no way to get TCP host and port information in any event.

You may want to consider adding additional identifier parameter(s) to your IDL so that the server can recognize clients. You may also consider making the clients call a "register" function on the server, and the server hands out an identifier that all clients must pass back to the server on subsequent calls.

This identifier can be as simple as a string or integer, or as complicated as some kind of security token that the server has to validate with a public key. It all depends on your application's requirements.

It depends on the situation but sometimes you need to extract host/port from IOR for testing, logging, debugging purposes. IOR contains host and port, you only need to decode it from byte array that IOR represents. So just take CORBA specification and dependencies) from GNU Classpath as example and do decoding yourself if you have time during weekend :)

If you do not have time as me, you can use command line utilities that are coming with ORBs:

  1. tao_catior in TAO/ACE ORB
  2. iordump in Orbix/Orbacus ORB's
  3. Parse IOR with web online tool
  4. Have not found possibility to use JDK CORBA to do the parsing. Although the code is definitely somewhere in internal sun packages.
  5. dior in Jacorb ORB. Or java jacorb.Orb.util.PrintIOR -i [IOR-string]

For me the answer #5 was good enough. I used Jacorb for my java based testing tool. But then again PrintIOR requires org.jacorb.orb.ORB to be instantiated by org.omg.CORBA.ORB.init(). So it can be tricky if you are forced to use JDK ORB in the same JVM.

Need Your Help

how to abstract tree view node creation/ population?

c# treeview

i have the below code i want to put in a global method set as static so that i can build a couple tree views on my web app. now i have each building its own tree view using the code below. ...

Understanding TCP URG flag

tcp flags

I made a simple portscanner with Python using Scapy.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.