// Get the IIOP profile body
//
byte[] data = ior.profiles[i].profile_data;
org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer(
data, data.length);
InputStream in = new InputStream(buf, 0, false, null, 0);
in._OB_readEndian();
org.omg.IIOP.ProfileBody_1_0 body = org.omg.IIOP.ProfileBody_1_0Helper
.read(in);
//
// Read components if the IIOP version is > 1.0
//
org.omg.IOP.TaggedComponent[] components;
if (body.iiop_version.major > 1 || body.iiop_version.minor > 0) {
int len = in.read_ulong();
components = new org.omg.IOP.TaggedComponent[len];
for (int j = 0; j < len; j++)
components[j] = org.omg.IOP.TaggedComponentHelper
.read(in);
} else
components = new org.omg.IOP.TaggedComponent[0];
if (performMatch) {
//
// Check primary host/port
//
boolean match = false;
if (portNo == body.port
&& hostMatch(host, body.host, loopbackMatches)) {
match = true;
}
//
// Check alternate host/port
//
if (!match) {
for (int j = 0; j < components.length && !match; j++) {
if (components[j].tag == org.omg.IOP.TAG_ALTERNATE_IIOP_ADDRESS.value) {
byte[] d = components[j].component_data;
org.apache.yoko.orb.OCI.Buffer b = new org.apache.yoko.orb.OCI.Buffer(
d, d.length);
InputStream s = new InputStream(b, 0, false,
null, 0);
s._OB_readEndian();
String altHost = s.read_string();
short altPort = s.read_ushort();
if (portNo == altPort
&& hostMatch(host, altHost,
loopbackMatches)) {
match = true;
}