From: Karel G. <kg...@us...> - 2002-03-23 20:17:50
|
Update of /cvsroot/micomt/mico/demo/codesets In directory usw-pr-cvs1:/tmp/cvs-serv31844/demo/codesets Modified Files: client.cc hello.idl runit server.cc Log Message: - merged with MICO 2.3.7 Index: client.cc =================================================================== RCS file: /cvsroot/micomt/mico/demo/codesets/client.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** client.cc 3 Nov 1999 23:20:52 -0000 1.1.1.1 --- client.cc 23 Mar 2002 20:17:11 -0000 1.2 *************** *** 4,7 **** --- 4,15 ---- #include "hello.h" + #ifdef HAVE_UNISTD_H + #include <unistd.h> + #endif + + #ifdef _WINDOWS + #include <direct.h> + #endif + int *************** *** 11,23 **** CORBA::BOA_var boa = orb->BOA_init (argc, argv, "mico-local-boa"); ! assert (argc == 2); ! CORBA::Object_var obj = orb->bind ("IDL:Hello:1.0", argv[1]); if (CORBA::is_nil (obj)) { ! cerr << "cannot bind to " << argv[1] << endl; return 1; } Hello_var hello = Hello::_narrow (obj); ! CORBA::String_var s = hello->hello ("öäü"); cout << s.in() << endl; --- 19,37 ---- CORBA::BOA_var boa = orb->BOA_init (argc, argv, "mico-local-boa"); ! /* ! * IOR is in server.ref in the local directory ! */ ! ! char pwd[256], uri[300]; ! sprintf (uri, "file://%s/server.ref", getcwd(pwd, 256)); ! ! CORBA::Object_var obj = orb->string_to_object (uri); if (CORBA::is_nil (obj)) { ! cerr << "cannot bind to " << uri << endl; return 1; } Hello_var hello = Hello::_narrow (obj); ! CORBA::String_var s = hello->sayHello ("öäü"); cout << s.in() << endl; Index: hello.idl =================================================================== RCS file: /cvsroot/micomt/mico/demo/codesets/hello.idl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** hello.idl 3 Nov 1999 23:20:52 -0000 1.1.1.1 --- hello.idl 23 Mar 2002 20:17:11 -0000 1.2 *************** *** 1,3 **** interface Hello { ! string hello (in string s); }; --- 1,3 ---- interface Hello { ! string sayHello (in string s); }; Index: runit =================================================================== RCS file: /cvsroot/micomt/mico/demo/codesets/runit,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** runit 3 Nov 1999 23:20:52 -0000 1.1.1.1 --- runit 23 Mar 2002 20:17:11 -0000 1.2 *************** *** 4,9 **** export MICORC - ADDR=inet:`uname -n`:12123 - # # there are two ORB options to specify the code sets the application --- 4,7 ---- *************** *** 17,21 **** # server speaks ISO-8859-1 (Latin1) ! ./server -ORBIIOPAddr $ADDR -ORBNativeCS '*8859-1*' & server_pid=$! --- 15,19 ---- # server speaks ISO-8859-1 (Latin1) ! ./server -ORBNativeCS '*8859-1*' -ORBGIOPVersion 1.2 -ORBIIOPVersion 1.2 & server_pid=$! *************** *** 25,28 **** # client speaks HTML ! ./client $ADDR -ORBNativeCS '*HTML*' --- 23,26 ---- # client speaks HTML ! ./client -ORBNativeCS '*HTML*' -ORBGIOPVersion 1.2 -ORBIIOPVersion 1.2 Index: server.cc =================================================================== RCS file: /cvsroot/micomt/mico/demo/codesets/server.cc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** server.cc 3 Nov 1999 23:20:52 -0000 1.1.1.1 --- server.cc 23 Mar 2002 20:17:11 -0000 1.2 *************** *** 2,10 **** #include <CORBA-SMALL.h> #include <iostream.h> #include "hello.h" class Hello_impl : virtual public Hello_skel { public: ! char *hello (const char *s) { cout << s << endl; --- 2,11 ---- #include <CORBA-SMALL.h> #include <iostream.h> + #include <fstream.h> #include "hello.h" class Hello_impl : virtual public Hello_skel { public: ! char *sayHello (const char *s) { cout << s << endl; *************** *** 19,23 **** CORBA::BOA_var boa = orb->BOA_init (argc, argv, "mico-local-boa"); ! (void)new Hello_impl; boa->impl_is_ready (CORBA::ImplementationDef::_nil()); --- 20,29 ---- CORBA::BOA_var boa = orb->BOA_init (argc, argv, "mico-local-boa"); ! Hello_impl * hi = new Hello_impl; ! ! ofstream of ("server.ref"); ! CORBA::String_var str = orb->object_to_string (hi); ! of << str.in() << endl; ! of.close (); boa->impl_is_ready (CORBA::ImplementationDef::_nil()); |