How to retrieve the local IP address on client side within an interceptor?

Answer Posted / chaitanya

OAccessing the local address on the client-side, e.g. in an interceptor can be achieved by using the following code:

CORBA::Object_var obj = orb->resolve_initial_references("IT_IPTransport");

if (CORBA::is_nil(obj))

{

self_addr = (const char*) 0;

return;

}

IT_ATLI2_IP::IPTransport_ptr ip_transport = IT_ATLI2_IP::IPTransport::_narrow(obj);

if (CORBA::is_nil(ip_transport))

{

self_addr = (const char*) 0;

return;

}

CORBA::String_var hostname = ip_transport->local_node_name();

IT_ATLI2_IP::IPAddressSeq_var ip_addresses =

ip_transport->name_to_addresses(

hostname,

0,

IT_ATLI2_IP::PROTOCOL_TCP,

IT_UtcT::never()

);

IT_ATLI2_IP::IPAddress_var ip_address = ip_addresses[0];

self_addr = ip_address->node_literal();

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a client use jdk orb to communicate with orbix domain?

418


How to programatically query the length of a workqueue

1085


How you can access to corba objects in orbix?

434


How we can access to corba objects in orbix?

433


Does orbix 3 support vos (virtualization operating systems)?

421






How to change the port of the orbix notification service?

434


Explain how you can configure orbix logging?

454


Explain how you can configure an orbix domain to contain corbaloc references instead of iors for the orbix services?

416


Tell me does orbix provide tool to remove surplus empty lines from an orbix configuration file?

417


Explain how you configure thread pool settings in orbix 6.3?

401


What soft_limit and hard_limit configuration settings apply for each orbix process or for a sum of orbix processes running in an orbix domain?

421


Does clients using orbix 3.x talk to servers using orbix 2000?

425


Explain how you can close the client connection to the orbix 3 daemon?

406


How to limit the connections to from a service?

451


How you can configure orbix logging?

453