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 access CORBA objects in Orbix ?

1 Answers  


Does orbix provide tool to remove surplus empty lines from an orbix configuration file?

0 Answers  


Do the soft_limit and hard_limit configuration settings apply for each Orbix process or for a sum of Orbix processes running in an Orbix domain?

1 Answers  


Explain how you can configure an orbix domain to use the dns network alias hostname in iors for orbix services?

0 Answers  


Explain how to change the default orbix client timeout?

0 Answers  






How to configure an Orbix domain to use fully qualified host names rather than short host names or IP addresses

1 Answers  


Explain how to configure the license of orbix 3.3?

0 Answers  


How to developed the event service consumers and suppliers?

0 Answers  


How to configure an Orbix domain to contain corbaloc references instead of IORs for the Orbix services

1 Answers  


How you can access to corba objects in orbix?

0 Answers  


Does Orbix 6 support I/O callback feature?

1 Answers  


Will orbix 6 support i/o callback feature?

0 Answers  


Categories