Welcome! Log In Create A New Profile


Convertor_var and bind()/rebind()

Posted by bobj 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Convertor_var and bind()/rebind()
April 04, 2006 12:11PM
(Cross posted to phorum)

Your Currency::Convertor_var type is essentially a smart pointer to an object reference, which in the sample code you provide (it may not be complete) isn't pointing at anything. Normally Convertor_var type would be used on the client side.

On the server side you need to
(1) first create a new servant implementation,
(2) then activate it with a POA (either explicitly or implicitly), and
(3) then get the object reference (the ref variable referred to below) and bind that with a name in the naming service.

Exactly how you do all that, I'll leave as an exercise for now (hint: its in tut102).


Werner Traut (W) wrote:
> Hi Bob,
> I'm trying to register my currency object in code as in section 7.4 but
> get some weird errors:
> C:\Cos311\Currency3>client -ORBInitRef
> NameService=corbaloc::gac-010052:5555/NameService
> Binding Currency in the Naming Service ... Done.
> [1679785623 - 0x3db8c0] c:/unisa/mico/include/mico/template.h:103:
> assertion failed
> This application has requested the Runtime to terminate it in an unsual
> way.
> Please contact the application's support team for more information.
> In the tut letter there is a line of code: nc->rebind(name, ref );
> What is this ref variable.
> Here is my code
> Currency::Convertor_var converter;
> //Construct naming Service
> CosNaming::Name name;
> name.length(1);
> name[0].id = CORBA::string_dup("Currency"winking smiley;
> name[0].kind = CORBA::string_dup(""winking smiley;
> cout << "Binding Bank in the Naming Service ... " << flush;
> nc->rebind(name, converter );
> cout << "Done." << endl;
Sorry, only registered users may post in this forum.

Click here to login