break;
case SRVTYPERPLY:
msg = new ServiceTypeReply(in);
break;
default:
throw new ServiceLocationException(
ServiceLocationException.PARSE_ERROR, "Message type "
+ getType(funcID) + " not supported");
}
// set the fields
msg.address = senderAddr;
msg.port = senderPort;
msg.tcp = tcp;
msg.multicast = ((flags & 0x2000) >> 13) == 1 ? true : false;
msg.xid = xid;
msg.funcID = funcID;
msg.locale = locale;
if (msg.getSize() != length) {
SLPCore.platform.logError("Length of " + msg + " should be " + length + ", read "
+ msg.getSize());
// throw new ServiceLocationException(
// ServiceLocationException.INTERNAL_SYSTEM_ERROR,
// "Length of " + msg + " should be " + length + ", read "
// + msg.getSize());
}
return msg;
} catch (ProtocolException pe) {
throw pe;
} catch (IOException ioe) {
SLPCore.platform.logError("Network Error", ioe);
throw new ServiceLocationException(
ServiceLocationException.NETWORK_ERROR, ioe.getMessage());
}
}