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



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

Answer / 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

More Orbix Interview Questions

How to change the default Orbix client timeout?

1 Answers  


Explain how you can configure orbix logging?

0 Answers  


How you can configure an orbix domain to use fully qualified host names rather than short host names or ip addresses?

0 Answers  


How to configure an Orbix domain to use the DNS network alias hostname in IORs for Orbix services

1 Answers  


How can you dump the orbix configuration?

0 Answers  


Does server migration to new physical ip address also impact on orbix?

0 Answers  


Does Orbix 6 and Orbix 3 support Java 7?

1 Answers  


How to access CORBA objects in Orbix ?

1 Answers  


Explain how to increase the internal logging in orbix configure?

0 Answers  


Are Orbix 6 libraries thread safe?

1 Answers  


How to develop Event Service consumers and suppliers?

1 Answers  


How to increase internal logging in itconfigure.

1 Answers  


Categories