Re: [mico-devel] How to connect to server by inet address from client

2009-01-17 Thread Karel Gardas

Hi,

first please try to correct your IDL::black_board:1.0 to
IDL:black_board:1.0. If it still does not work, I would advice to read
some of POA sources. I'm not sure it supports MICO binder.

Cheers,
Karel

Yi Zhao wrote:
 hi, all, when I try to connect to server by inet adderss from client, I 
 failed, can anyone help me?  thanks very much.
  
 first, I create my server program as below:
 #-server--
 #include iostream
 #include black_board_impl.h
 using namespace std;
 int main(int argc, char *argv[])
 {
   CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, mico-local-orb);
   CORBA::Object_var obj = orb-resolve_initial_references (RootPOA);
   PortableServer::POA_var poa = PortableServer::POA::_narrow (obj);
   PortableServer::POAManager_var mgr = poa-the_POAManager();
   blackboard * servant = new blackboard;
   PortableServer::ObjectId_var oid = poa-activate_object (servant);
   mgr-activate();
   orb-run (); 
   return 0;
 }
 #--
 I start the server by the command: ./myprogram -ORBIIOPAddr 
 inet:127.0.0.1:12123
  
 I try to connect to server by inet address as below, but, I failed, can any 
 one tell my the reason?
 #-client--
   CORBA::ORB_var Orb = CORBA::ORB_init(argc, argv, mico-local-orb);
   CORBA::Object_var Obj = Orb-bind(IDL::black_board:1.0, 
 inet:127.0.0.1:12123);
   if (CORBA::is_nil (Obj)) {
 cout  cannot bind to server addr  endl;
 return 1;
   } else {
 cout  bind to server addr successfully  endl;
   }
  
  
 thanks very much!!!
 
 
   
 
 
 
 
 ___
 Mico-devel mailing list
 Mico-devel@mico.org
 http://www.mico.org/mailman/listinfo/mico-devel


-- 
Karel Gardas  kgar...@objectsecurity.com
ObjectSecurity Ltd.   http://www.objectsecurity.com
___
Mico-devel mailing list
Mico-devel@mico.org
http://www.mico.org/mailman/listinfo/mico-devel


Re: [mico-devel] Problems using Objects of type Any and Qt

2009-01-17 Thread Karel Gardas

Hi Pascal,

first of all, by PI I mean PortableInterceptor, i.e. specification which
also specifies API for CodecFactory and Codec which you seems to use in
the code below, but you didn't use in your original email where you used
MICO specific codec API. So everything is OK from this point of view.

Now, to your issue. As I understand the situation is that you have
perfectly working code and when you add #include QApplication to it
which comes from Qt library, then your code is not working at all. The
first thing which comes to mind is that your added include silently
redefine or undefine something which is needed and defined by the former
includes (CORBA). Hence I recommended to see if reordering of the
includes solves your issue. BTW: What compiler and on which platform do
you use exactly? i.e. version numbers might be interesting here.

Also what's very dangerous is to use any namespace in globaly included
header files. I would recommend you to use absolute scope names in all
your header files, hence fixing anyserial.h to:

#ifndef __ANYSERIAL__
#define __ANYSERIAL__

#include CORBA.h
#include mico/throw.h
#include coss/CosNaming.h

void operator ( CORBA::Any anyobject, const CORBA::OctetSeq dataseq);
void operator ( const CORBA::Any anyobject, CORBA::OctetSeq dataseq);

#endif

And finally third attempt I would do is to carefully examine
preprocessed source of your application to see any issue with silent
symbol undefine or redefine...

Cheers,
Karel
PS: also please sign to mico-devel@mico.org mailing list here:
http://www.mico.org/mailman/listinfo/mico-devel from your address you
are using now, otherwise you still will not be able to sent any email
into the list.

ld1bp...@unibw.de wrote:
 Hi Karel,
 many thanks again for your suggestions. I tried to change the #include
 order in the file but the problem still comes up. To give you the best
 answer regarding the anyserial.h file I just write you down the header and
 the cpp files so that you can see how they are structured.
 
 --- anyserial.h ---
 
 #ifndef __ANYSERIAL__
 #define __ANYSERIAL__
 
 #include CORBA.h
 #include mico/throw.h
 #include coss/CosNaming.h
 
 using namespace CORBA;
 
 void operator ( Any anyobject, const OctetSeq dataseq);
 void operator ( const Any anyobject, OctetSeq dataseq);
 
 #endif
 
 
 --- anyserial.cpp ---
 
 // anyserial implementation
 
 #include anyserial.h
 
 void operator ( Any anyobject, const OctetSeq dataseq)
 {
   // Codec
   ORB_var orb;
   Object_var obj;
   IOP::CodecFactory_var cf;
   IOP::Encoding enc2;
   IOP::Codec_ptr codec_ptr;
 
   // Generate codec based on CodecFactory
   int argc = 1;
   char* argv[1];
   argv[0] = anyserial;
   orb = ORB_init( argc, argv, mico-local-orb );
   obj = orb-resolve_initial_references(CodecFactory);
   cf = IOP::CodecFactory::_narrow(obj);
   enc2.format = IOP::ENCODING_CDR_ENCAPS;
   enc2.major_version = 1;
   enc2.minor_version = 2;
   codec_ptr = cf-create_codec(enc2);
 
   // Decode dataseq and copy new generated object of type any into 
 anyobject
   anyobject = *(codec_ptr-decode(dataseq));
 
 }
 
 void operator ( const Any anyobject, OctetSeq dataseq)
 {
   // Codec
   ORB_var orb;
   Object_var obj;
   IOP::CodecFactory_var cf;
   IOP::Encoding enc2;
   IOP::Codec_ptr codec_ptr;
 
   // Generate codec based on CodecFactory
   int argc = 1;
   char* argv[1];
   argv[0] = anyserial;
   orb = ORB_init( argc, argv, mico-local-orb );
   obj = orb-resolve_initial_references(CodecFactory);
   cf = IOP::CodecFactory::_narrow(obj);
   enc2.format = IOP::ENCODING_CDR_ENCAPS;
   enc2.major_version = 1;
   enc2.minor_version = 2;
   codec_ptr = cf-create_codec(enc2);
 
   // Encode anyobject and generate a new octet sequence
   OctetSeq_var newdataseq_ptr = codec_ptr-encode(anyobject);
   int length = newdataseq_ptr-length();
 
   // Copy generated octet sequence into dataseq
   dataseq.length(length);
 
   for (int i=0; ilength; i++)
   dataseq[i] = (*newdataseq_ptr)[i];
 }
 
 I think I used what is really necessary of MICO/CORBA, am I right? As you
 can see I also specified using namespace MICO;. What is PI?
 
 Pasquale
 
 
 Hi Pascal,

 this is strange, please try to reorder your header files to

 #include anyserial.h
 #include ifDKAircraftInterface.h
 #include QApplication

 or to:

 #include ifDKAircraftInterface.h
 #include anyserial.h
 #include QApplication

 BTW, does your anyserial includes anything from MICO/CORBA? Do you use
 inside it `using namespace CORBA'?

 Also please try to use PI's codec API as your college Andreas does.

 Cheers,
 Karel
 --
 Karel Gardas  kgar...@objectsecurity.com
 ObjectSecurity Ltd.   http://www.objectsecurity.com


 ld1bp...@unibw.de wrote:
 Hallo Karel,
 thank you very much for your support. The anyobject Any variable
 contains
 

Re: [mico-devel] Why is CosEventComm::PushConsumer_skel no longer generated in 2.3.13?

2009-01-17 Thread Karel Gardas

Guys,

you should really concentrate your energy on bringing your code up to
the MICO 2.3.13 compatibility. Please keep in mind that BOA is more than
10 years deprecated already! IIRC POA was specified in 1998...

It's not that hard at the end, and for your information we usually do
this during one or two days on-site consulting/training at the customer
office after which customer is able to port all their sources successfully.

Cheers,
Karel

Kretschel Klaus wrote:
 Hi Andreas,
 
 On Friday 16 January 2009 13:49, Andreas Benzler wrote:
 I am highly interested in your approach bringing mico 2.3.11 to a gcc4.3
 platform. Can you please describe a bit more detail what you did
 exactly. I am not an automake expert :-(.
 
 I did nothing but replace configure and configure.in from the mico 2.3.13 
 distribution. There is on thing more that I had fixed earlier: add #include 
 cstring in throw.h. Then follow the usual install procedure.
 
 However, I was possibly a little too fast, although I am not sure if the 
 error 
 I just got has really to do with MICO, but it seem to me that something is 
 not cleaned up correctly. I got a segmentation fault at the very end of a 
 test program that did not even use MICO services:
 
 Program received signal SIGSEGV, Segmentation fault.
 0x0021 in ?? ()
 (gdb) up
 #1  0x7fd364e36628 in __cxa_finalize () from /lib64/libc.so.6
 (gdb) up
 #2  0x7fd36866ad66 in __do_global_dtors_aux () from Current language:  
 auto; currently asm
 (gdb) up
 #3  0x0046fc90 in std::basic_ioschar, std::char_traitschar 
 ::basic_ios ()
 (gdb) up
 #4  0x7fff720e1540 in ?? ()
 (gdb)  up
 #5  0x7fd368873de1 in _fini () 
 from 
 /home/donau101/adsm/scia/ol_level_1_to_2/tools/mico/for-x86_64/mico.2.3.11/lib/libmico2.3.11.so
 (gdb) up
 #6  0x001a in ?? ()
 (gdb) up
 #7  0x7fd369ed4d94 in ?? () from /lib64/ld-linux-x86-64.so.2
 (gdb) up
 Initial frame selected; you cannot go up.
 (gdb) 
 
 Regards,
 Klaus
 ___
 Mico-devel mailing list
 Mico-devel@mico.org
 http://www.mico.org/mailman/listinfo/mico-devel
 


-- 
Karel Gardas  kgar...@objectsecurity.com
ObjectSecurity Ltd.   http://www.objectsecurity.com
___
Mico-devel mailing list
Mico-devel@mico.org
http://www.mico.org/mailman/listinfo/mico-devel