Question

I have a c++ client publishing Corba messages to a c# server via omniOrb. I have registered a PortableInterceptor with the Orb at the server end and can intercept messages. In debug I get a ServerRequestInfo message in the intercept and In debug watch window can see the all the way down to the RemoteEndPort with the IP of the client. A lot of these classes however have private members which I can't access in the code.

How do I do it?

Here is my code

// register the OrbInitialiser here in some  code
omg.org.CORBA.OrbServices orb = omg.org.CORBA.OrbServices.GetSingleton();
orb.RegisterPortableInterceptorInitalizer( new LT.Quantifi.BrokerOrbInitialiser());
orb.CompleteInterceptorRegistration();

// register the Inteceptor in the OrbInitialiser here
public class BrokerOrbInitialiser : omg.org.PortableInterceptor.ORBInitializer
{
    public void post_init(ORBInitInfo info)
    {
        BrokerRequestInterceptor serverRequests = new BrokerRequestInterceptor();
        info.add_server_request_interceptor(serverRequests);
     }
}

// Inteceptor catches messages here
Public class BrokerRequestInterceptor : omg.org.PortableInterceptor.ServerRequestInterceptor
{
.
.
    public void receive_request_service_contexts(ServerRequestInfo ri)
    {
        Console.WriteLine("I catch messages here");
    }
.
.
}

No correct solution

OTHER TIPS

There is no standard way to get access to that information in CORBA. Some implementations do have a custom way to get some information, for example TAO has a transport current object you can get access to. At the moment the call has been received using IIOP you can narrow that to a IIOP Transport Current which than gives you that information. Looks you need an extension for the C# ORB to have a similar extension

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top