transfer of structures with strings



Hi,

I was a bit puzzled by problems (segmentation violations) caused by 
transferring structures which contained strings.

For the incoming "in" structures I thought that the following would do 
to copy the entire structure, but this seemed to be a wrong idea:

local_struct = ORBit_copy_value( remote_struct, TC_XXX );

In the end I created some scripts which created functions that copy all 
subelements of each structure to its local counterpart for "in" 
argumetns and which use "CORBA_string_dup" for each string value. The 
smae goes for using a function which returns a structure, it is copied 
and "CORBA_string_duped" for each individual element of the structure.

The structures go back and forth between the client and the server and 
must remain valid throughout the lifetime of the program, so using one 
of the structures as a return value turned out to be  mistake too as it 
became invalid for further use. CORBA frees all return values ;-)

On both the server and the client side "strcpy" and "sprintf' can be 
used, as long as "CORBA_string_dup" is used when a transfer over the 
CORBA link is needed.

Everything seems to run smoothly now and the final tests are running.

Best regards,

Peter Van Osta

Union Biometrica N.V./S.A.
European Scientific Operations (ESO)
Cipalstraat 3
B-2440 Geel
Belgium
Tel.: +32 (0)14 570 620
Fax.: +32 (0)14 570 621

http://www.unionbio-eu.com/

http://ourworld.compuserve.com/homepages/pvosta/cvwww.htm




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]