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 |
How you dump the orbix configuration?
Can a client use jdk orb to communicate with orbix domain?
Explain how you can configure orbix logging?
How are connections managed in Orbix Connect?
Will orbix 6 support i/o callback feature?
Explain how to change the default orbix client timeout?
How to download the orbix products?
Explain how to change the port of the orbix notification service?
Does Orbix Web Services provide locator functionality for Web Services endpoints?
Explain how to download the orbix products?
Can an interceptor capture SSL handshaking errors?
How to set the ORB properties?