[omniORB] omniEvents push array problem

Alex Tingle alex.tingle at bronermetals.com
Tue Apr 27 12:56:46 BST 2004


Coay,

I tried your code, and it works fine for me. So what's the difference?

- You don't specify what platform you are using. My test was on Tru64 
v5.1.

- I presume you compiled your Data_Type.idl with the `omniidl -bcxx 
-Wba' option that generates CORBA::Any support? - I'm pretty sure your 
code would fail to link if you had not.

- My GIOP max message size parameter was left at the default, which is 
~2Mb. Your array of 1000 floats is only ~4000 bytes - you would have to 
set the max message size really low to cause problems.

Finally, I suggest you make really sure that your supplier & consumer 
have been compiled against the same idl. You could easily get this 
problem if you change the array size in the IDL without recompiling 
everything that uses it. Imagine the supplier making 100 floats, and 
the consumer expecting 1000 floats! Nothing will catch this error at 
runtime - especially since you are not even checking whether the Any 
extraction is successful.

I can suggest three things you can do to try and track down the 
problem. Firstly add the proper check that the Any extraction has 
succeeded:

if( data >>= lh )
   ...
else
   cerr<<"oops"<<endl;

Secondly run your supplier & consumer with the trace level set high 
enough to see the actual messages - You should be able to tell whether 
they are being truncated simply from their size. If that doesn't help, 
then try building a simple `echo' client/server pair that passes your 
type - see if you can get that to work.

good luck,

-Alex Tingle

--
Dammit Jim, I'm a programmer... not a mind reader!
On 27 Apr 2004, at 10:13, caoy wrote:

> Hi, I modified pushcons.cc and pushsupp.cc in omniEvents 2_5_1.My
> purpose is to push a one dimension float array form supplier to
> consumer.When I set the size of the array 100, it passed.But when it 
> was
> set to more than 100 size , the array element after 100 is valid. I
> think the problem lie in the size of event channel.How to deal with it?
> I list part of the source codes below.
>
> Thanks.
>
> ______________________________________
>
> ===================================================================
>
>
> <Data_Type.idl><pushcons.cxx><pushsupp.cxx><ATT176795.txt>




More information about the omniORB-list mailing list