Re: 回复:_Re:_[OB-Users]_a_ques tion_about_how_to_use_a_common_connection_in Orbacus

Stan Lewis <[email protected]> Thu, 26 Oct 2006 10:02:26 -0400
Newsgroups gmane.comp.corba.orbacus
Organization IONA Technologies
Message-ID <[email protected]>
Hi Zhai,

On Thursday 26 October 2006 05:40, =E7=BF=9F=E6=98=8E=E7=8E=89 wrote:

>=C2=A0 =C2=A0 In attached file Client.cpp, line 49, we try to invoke=20
>_OB_closeConnection(true), but it do not compile successful. how to deal=
=20
>with it? we hope to close the first connection. If it was closed, does i=
t=20
>have an influence on following operations?=20

Try:

hello->_OB_closeConnection(1);

If you close the connection, the ORB should open a new connection for=20
subsequent invocations automatically.

>    In ooc.conf, if ooc.orb.conc_model is setted to threaded,=20
> ooc.orb.client_timeout=3D2 works well. The following is the result:
>     from the above, we can see the first connection(192.1.101.205:36613=
 to
> 192.1.101.205:32323) was closed at the end of run() procedure, but we h=
ope
> it should be closed before the output "before  say_hello(), sleep 10...=
",
> because here it sleeps 5 seconds. why is the second
> connection(192.1.101.205:36614 to 192.1.101.205:32323) not closed befor=
e
> the output "before  say_hello() 1, sleep 10...", here it also sleeps 5
> seconds?  A now connection should be open for the second say_hello() ca=
ll.=20

I don't quite see this behavior here, instead I can see that the connecti=
on=20
gets closed while the client is sleeping in between invocations, for exam=
ple:

--------------- Calling hello ---------------
[ outgoing: trying to establish connection
  timeout: none
  id: iiop
  remote address: 127.0.0.1:40673 ]
[ client-side: new connection
  id: iiop
  local address: 127.0.0.1:37663
  remote address: 127.0.0.1:40673 ]
[ outgoing: sending transmission code sets
  char code set: ISO 8859-1:1987; Latin Alphabet No. 1
  wchar code set: ISO/IEC 10646-1:1993; UTF-16, UCS Transformation Format=
=20
16-bit form ]
[ incoming: Orbacus Peer Version 4030100 ]
--------------- After Calling hello ---------------

--------------- Sleeping ---------------
[ outgoing: closing connection
  id: iiop
  local address: 127.0.0.1:37663
  remote address: 127.0.0.1:40673 ]
--------------- Done Sleeping ---------------

Just to double check can you let me know the exact version of Orbacus you=
're=20
running there?  Can you also send me all the configuration you're setting=
=20
either on the command line or via a configuration file?

> What is the diffence between threaded and reactive client?

Reactive is single-threaded behavior for the client.  Generally you'd use=
 this=20
when you're trying to integrate an outside event loop, such as an X windo=
w or=20
Windows message loop.

Threaded allows the ORB to perform tasks concurrently, for example doing=20
things like closing connections.  It allows the ORB to properly close=20
connections to observe the client_timeout setting, as this is handled by =
a=20
separate timer thread in the ORB.  I believe that the reactive mode actua=
lly=20
prevents the ORB from doing this, so the connection can only be closed wh=
ile=20
your thread is down in the ORB layer.  At least this is the behavior I've=
=20
observed so far in testing.

Thanks,

Stan

--=20
Stan Lewis                         =20
Team Orbacus - Your CORBA Source
E-Mail: [email protected]
WWW: http://www.orbacus.com
_______________________________________________
OB-Users Mailing List - [email protected]
http://mail.ooc.nf.ca/mailman/listinfo/ob-users
Visit our support FAQ before you send a message.
http://www.orbacus.com/faq/support.html