Re: tutorial on orbit



hi
 i am trying to run calculator example. here is my client code, cut and
paste from website. when ever i run the executable code i get segmentation
fault, core dumped. could you please tell me whats wrong with it.i am
using the the latest version of orbit.
#include "/usr/local/include/orbit-1.0/orb/orbit.h"
#include "calculator.h"
#include <stdio.h>

int main(int argc, char* argv[])
{
        CORBA_Environment ev;
        CORBA_ORB         orb;
        CORBA_Object      server;
        CORBA_double      res;
        gchar*            dummy_argv[2];
        gint              dummy_argc;

        dummy_argc = 1;
        dummy_argv[0] = argv[0];
        dummy_argv[1] = 0;

        CORBA_exception_init(&ev);
        orb =CORBA_ORB_init(&dummy_argc,dummy_argv,"orbit-local-orb",&ev);
        server = CORBA_ORB_string_to_object(orb, argv[1], &ev);
        res = Calculator_add(server,1.0, 2.0, &ev);
        fprintf(stdout,"1.0 + 2.0 = %2.0f\n", res);
        CORBA_Object_release(server,&ev);
        exit (0);
}


and one more thing. i plan to have my server in java, and client in C with
a callback method, i.e server invocating a method on client. so all i need
to do include my implementation file in client and look up for the server
using naming context. and my client will register the refernce to the
callback object in server, to which the server calls back.Is this the
right way.?
thank you
bharat.




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