Re: CORBA_string question



Do you mean the following code is correct ?

static
CORBA_string impl_HelloStr_(impl_POA_HelloStr *servant,
                            CORBA_string *outStr, CORBA_Environment *ev)
{
       *outStr = CORBA_string_dup("HelloOutString");
       return CORBA_string_dup("HelloReturnString");
}

And I don't need to call CORBA_free() ... the skel & ORB will take care of
them automatically? 

Thanks
KC



Michael Meeks wrote:

>Hi Kuang,
>
>On Wed, 2004-01-07 at 03:14, Kuang-Chun Cheng wrote:
>  
>
>>I have a question about CORBA_string storage allocation
>>in both client/server side. In "C Language Mapping Specification",
>>it has detail description about how to handle CORBA_string in
>>client side and also how client stub will take care freeing the
>>allocated storage. But I can't find any word about server side.
>>Will server skeleton code also automatically allocate/free storage
>>for CORBA_string ?
>>    
>>
>
>	It will do the sensible thing. eg. if a method returns a CORBA_string,
>the skel has to return a newly allocated CORBA_string which will thenn
>be freed by the ORB when it has been marshaled.
>
>	A good way to think of it is that - in the in-process case it's
>possible to return directly from the skel to the stub without any magic
>allocation stuff happening.
>
>	Regards,
>
>		Michael.
>
>  
>





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