//header
request_id = readULong( buf, MSG_HEADER_SIZE, little_endian );
}
else
{
throw new BAD_PARAM
("Messages of type " + msg_type + " don't have request ids");
}
}
else if( giop_minor == 0 || giop_minor == 1 )
{
if( msg_type == MsgType_1_1._Request ||
msg_type == MsgType_1_1._Reply )
{
// service contexts are the first entry in the header
//get the number of individual service contexts
int service_ctx_length = readULong( buf,
MSG_HEADER_SIZE,
little_endian );
if( service_ctx_length == 0 )
{
//array of length 0, so request id folows the
//array length entry
request_id = readULong( buf,
MSG_HEADER_SIZE + 4,
little_endian );
}
else
{
//get the first index after the contexts array
int pos = skipServiceContext( buf,
MSG_HEADER_SIZE + 4, // 4 bytes is ulong
service_ctx_length,
little_endian );
//the request id follows the body
request_id = readULong( buf, pos, little_endian );
}
}
else if( msg_type == MsgType_1_1._LocateRequest ||
msg_type == MsgType_1_1._LocateReply )
{
//easy, it's right after the message header
request_id = readULong( buf, MSG_HEADER_SIZE, little_endian );
}
else
{
throw new BAD_PARAM
("Messages of type " + msg_type + " don't have request ids");
}
}
return request_id;