<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>享受生活 － Enjoy Life! &#187; omniORB</title>
	<atom:link href="http://www.qiliang.net/blog/tag/omniorb/feed" rel="self" type="application/rss+xml" />
	<link>http://www.qiliang.net/blog</link>
	<description>Just so so.</description>
	<lastBuildDate>Wed, 28 Jul 2010 07:12:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>omniidl 的两个重要参数</title>
		<link>http://www.qiliang.net/blog/2008/03/omniidl-%e7%9a%84%e4%b8%a4%e4%b8%aa%e9%87%8d%e8%a6%81%e5%8f%82%e6%95%b0.html</link>
		<comments>http://www.qiliang.net/blog/2008/03/omniidl-%e7%9a%84%e4%b8%a4%e4%b8%aa%e9%87%8d%e8%a6%81%e5%8f%82%e6%95%b0.html#comments</comments>
		<pubDate>Thu, 13 Mar 2008 12:33:00 +0000</pubDate>
		<dc:creator>Cavendish</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[CORBA]]></category>
		<category><![CDATA[omniORB]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.qiliang.net/blog/?p=147</guid>
		<description><![CDATA[omniidl -bcxx -Wbh=.h -Wbs=.cpp your.idl
参考文献
C++ back-end options
]]></description>
			<content:encoded><![CDATA[<pre>omniidl -bcxx -Wbh=.h -Wbs=.cpp your.idl</pre>
<p><strong>参考文献</strong><br />
<a href="http://omniorb.sourceforge.net/omni41/omniORB/omniORB005.html#toc28">C++ back-end options</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.qiliang.net/blog/2008/03/omniidl-%e7%9a%84%e4%b8%a4%e4%b8%aa%e9%87%8d%e8%a6%81%e5%8f%82%e6%95%b0.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qt and omniORB &#8211; 2</title>
		<link>http://www.qiliang.net/blog/2008/03/qt-and-omniorb-2.html</link>
		<comments>http://www.qiliang.net/blog/2008/03/qt-and-omniorb-2.html#comments</comments>
		<pubDate>Tue, 11 Mar 2008 14:11:00 +0000</pubDate>
		<dc:creator>Cavendish</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[CORBA]]></category>
		<category><![CDATA[omniORB]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Qt]]></category>

		<guid isPermaLink="false">http://www.qiliang.net/blog/?p=145</guid>
		<description><![CDATA[Sorry, no time to update the description of the examples.
Files
eg2.tar.gz
call_back.tar.gz
]]></description>
			<content:encoded><![CDATA[<p>Sorry, no time to update the description of the examples.</p>
<p><strong>Files</strong><br />
<a href="http://www.qiliang.net/blog/wp-content/uploads/2009/07/eg2.tar.gz">eg2.tar.gz</a><br />
<a href="http://www.qiliang.net/blog/wp-content/uploads/2009/07/call_back.tar.gz">call_back.tar.gz</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.qiliang.net/blog/2008/03/qt-and-omniorb-2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qt and omniORB</title>
		<link>http://www.qiliang.net/blog/2008/02/qt-and-omniorb.html</link>
		<comments>http://www.qiliang.net/blog/2008/02/qt-and-omniorb.html#comments</comments>
		<pubDate>Wed, 13 Feb 2008 10:52:00 +0000</pubDate>
		<dc:creator>Cavendish</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[CORBA]]></category>
		<category><![CDATA[omniORB]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Qt]]></category>

		<guid isPermaLink="false">http://www.qiliang.net/blog/?p=138</guid>
		<description><![CDATA[PREFACE
About CORBA, please have a look at http://en.wikipedia.org/wiki/Corba.
omniORB is one of the CORBA implementations, please have a look at http://omniorb.sourceforge.net/.
About Qt, please have a look at http://en.wikipedia.org/wiki/Qt_%28toolkit%29.
And there is one add-on, QtCorba, http://trolltech.com/products/qt/addon/solutions/catalog/4/Utilities/qtcorba/, which is for the integration Qt 4.x with ACE/TAO or MICO(another two CORBA implementations). Then main concept in QtCorba is to convert [...]]]></description>
			<content:encoded><![CDATA[<p><strong>PREFACE</strong></p>
<p>About CORBA, please have a look at http://en.wikipedia.org/wiki/Corba.</p>
<p>omniORB is one of the CORBA implementations, please have a look at http://omniorb.sourceforge.net/.</p>
<p>About Qt, please have a look at http://en.wikipedia.org/wiki/Qt_%28toolkit%29.</p>
<p>And there is one add-on, QtCorba, http://trolltech.com/products/qt/addon/solutions/catalog/4/Utilities/qtcorba/, which is for the integration Qt 4.x with ACE/TAO or MICO(another two CORBA implementations). Then main concept in QtCorba is to convert ACE/TAO or MICO events into Qt event, just because they need the main thread to run their own event loop. QtCorba is not open source(it&#8217;s commercial product).</p>
<p>I had inquried the omniORB mailing list how to integrate omniORB with Qt 4.x. The core developer of omniORB, Duncan Grisby, gave me a reply on it.</p>
<p>http://www.omniorb-support.com/pipermail/omniorb-list/2008-February/029227.html</p>
<p>omniORB doesn&#8217;t have an application-hookable event loop like Mico. it<br />
always uses its own threads to dispatch CORBA calls. You can just use<br />
the main thread to service Qt&#8217;s event loop and it will work fine.</p>
<p>Then I tried some code, it works fine.</p>
<p>1. Install omniORB 4.1.1 and run the examples</p>
<p>I am using openSUSE 10.3, gcc 4.2.1 on 32bit PC.</p>
<p>Download: omniORB-4.1.1.tar.gz</p>
<p>http://sourceforge.net/project/showfiles.php?group_id=51138</p>
<p>There are four parts, BUILD omniORB, RUN omniORB EXAMPLES, BUILD Qt, RUN Qt&amp;omniORB EXAMPLES in this article.</p>
<p><strong>BUILD omniORB</strong></p>
<p>cd ~/tmp<br />
mkdir build<br />
tar zxvf omniORB-4.1.1.tar.gz<br />
cd omniORB-4.1.1<br />
./configure -prefix /user<br />
make<br />
sudo make install</p>
<p>Build examples:<br />
cd ~/tmp/omniORB-4.1.1<br />
cd src/examples/echo<br />
make</p>
<p>Please read Chapter 2 in doc/omniORB.pdf at first.</p>
<p><strong>RUN omniORB EXAMPLES</strong></p>
<p>(1) eg1 is an example which creates a corba object and invokes the method of it in same code.</p>
<p>cd ~/tmp/omniORB-4.1.1<br />
cd src/examples/echo<br />
./eg1</p>
<p>The result should be:<br />
I said, &#8220;Hello!&#8221;.<br />
The Echo object replied, &#8220;Hello!&#8221;.</p>
<p>(2) eg2_impl is the server, eg2_clt is the client, they are based on IOR, not need to run omniNames.</p>
<p>In terminal 1, run the server:<br />
cd ~/tmp/omniORB-4.1.1<br />
cd src/examples/echo<br />
./eg2_impl<br />
IOR:010000000d00000049444c3a4563686f3a312e3000000000010000000000000068000000010102000f0000003133342e33322e3138352e3232300000f96600000e000000fe23aab24700000562000000000000000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100</p>
<p>In terminal 2, run the client:<br />
cd ~/tmp/omniORB-4.1.1<br />
cd src/examples/echo<br />
./eg2_clt IOR:010000000d00000049444c3a4563686f3a312e3000000000010000000000000068000000010102000f0000003133342e33322e3138352e3232300000f96600000e000000fe23aab24700000562000000000000000200000000000000080000000100000000545441010000001c00000001000000010001000100000001000105090101000100000009010100</p>
<p>Yeap, you should use the IOR:01000&#8230;. string as the parameter of client side.</p>
<p>The output of server side:<br />
Upcall Hello!<br />
Upcall Hello!<br />
Upcall Hello!<br />
Upcall Hello!<br />
Upcall Hello!<br />
Upcall Hello!<br />
Upcall Hello!<br />
Upcall Hello!<br />
Upcall Hello!<br />
Upcall Hello!</p>
<p>The output of client side:<br />
I said, &#8220;Hello!&#8221;.<br />
The Echo object replied, &#8220;Hello!&#8221;.<br />
I said, &#8220;Hello!&#8221;.<br />
The Echo object replied, &#8220;Hello!&#8221;.<br />
I said, &#8220;Hello!&#8221;.<br />
The Echo object replied, &#8220;Hello!&#8221;.<br />
I said, &#8220;Hello!&#8221;.<br />
The Echo object replied, &#8220;Hello!&#8221;.<br />
I said, &#8220;Hello!&#8221;.<br />
The Echo object replied, &#8220;Hello!&#8221;.<br />
I said, &#8220;Hello!&#8221;.<br />
The Echo object replied, &#8220;Hello!&#8221;.<br />
I said, &#8220;Hello!&#8221;.<br />
The Echo object replied, &#8220;Hello!&#8221;.<br />
I said, &#8220;Hello!&#8221;.<br />
The Echo object replied, &#8220;Hello!&#8221;.<br />
I said, &#8220;Hello!&#8221;.<br />
The Echo object replied, &#8220;Hello!&#8221;.<br />
I said, &#8220;Hello!&#8221;.<br />
The Echo object replied, &#8220;Hello!&#8221;.</p>
<p>And you also can separately run server and client on different machines.</p>
<p>(3) eg3_impl is the server, eg3_clt is the client, they are based on omniNames(the nameing service).</p>
<p>Now we need do something about config file. There is a sample.cfg in ~/tmp/omniORB-4.1.1.</p>
<p>We create a server3.cfg and a client3.cfg in ~/tmp/cfg/.</p>
<p>diff -c sample.cfg server3.cfg<br />
*** sample.cfg  2008-02-13 09:34:57.000000000 +0100<br />
&#8212; server3.cfg 2008-02-13 09:54:42.000000000 +0100<br />
***************<br />
*** 329,334 ****<br />
&#8212; 329,335 &#8212;-<br />
#   corbaname URI:<br />
#<br />
#   InitRef = NameService=corbaname::my.host.name<br />
+    InitRef = NameService=corbaname::localhost<br />
#<br />
#<br />
#   Specify the Trading service and the interface repository using corbaloc:</p>
<p>diff -c sample.cfg client3.cfg<br />
*** sample.cfg  2008-02-13 09:34:57.000000000 +0100<br />
&#8212; client3.cfg 2008-02-12 14:27:59.000000000 +0100<br />
***************<br />
*** 329,334 ****<br />
&#8212; 329,335 &#8212;-<br />
#   corbaname URI:<br />
#<br />
#   InitRef = NameService=corbaname::my.host.name<br />
+    InitRef = NameService=corbaname::localhost<br />
#<br />
#<br />
#   Specify the Trading service and the interface repository using corbaloc:</p>
<p>We create a log directory for omniNames.<br />
cd ~/tmp<br />
mkdir log</p>
<p>In terminal 1, run the omniNames:<br />
export OMNIORB_CONFIG=~/tmp/cfg/server3.cfg<br />
omniNames -start -log ~/tmp/log<br />
(This is for first time to run.)<br />
omniName -log ~/tmp/log<br />
(This is for not first time to run.)</p>
<p>In terminal 2, run the server:<br />
cd ~/tmp/omniORB-4.1.1<br />
cd src/examples/echo<br />
unset OMNIORB_CONFIG<br />
./eg3_impl</p>
<p>In terminal 3, run the client:<br />
cd ~/tmp/omniORB-4.1.1<br />
cd src/examples/echo<br />
export OMNIORB_CONFIG=~/tmp/cfg/client3.cfg<br />
./eg3_clt</p>
<p>The output of client side is same as previous case.</p>
<p>If the Nameing Service(omniNames) is not running, then you will get:<br />
./eg3_clt<br />
Caught system exception TRANSIENT &#8212; unable to contact the server.</p>
<p>And you also can separately run server and client on different machines.<br />
Please make sure to edit the config file correctly, for example:<br />
You can replace &#8220;localhost&#8221; with your server&#8217;s ip or domain name in server3.cfg and client3.cfg.</p>
<p>(4) The applications are same with previous, but the config file are different, follow an old way.</p>
<p>diff -c sample.cfg server4.cfg<br />
*** sample.cfg  2008-02-13 10:07:09.000000000 +0100<br />
&#8212; server4.cfg 2008-02-13 10:23:49.000000000 +0100<br />
***************<br />
*** 329,334 ****<br />
&#8212; 329,335 &#8212;-<br />
#   corbaname URI:<br />
#<br />
#   InitRef = NameService=corbaname::my.host.name<br />
+    InitRef = NameService=corbaname::192.168.249.130<br />
#<br />
#<br />
#   Specify the Trading service and the interface repository using corbaloc:<br />
***************<br />
*** 1041,1044 ****<br />
# bootstrap agent protocol.  This enables interoperability between omniORB<br />
# servers and Sun&#8217;s javaIDL clients. When this option is enabled, an<br />
# omniORB server will respond to a bootstrap agent request.<br />
! supportBootstrapAgent = 0<br />
&#8212; 1042,1045 &#8212;-<br />
# bootstrap agent protocol.  This enables interoperability between omniORB<br />
# servers and Sun&#8217;s javaIDL clients. When this option is enabled, an<br />
# omniORB server will respond to a bootstrap agent request.<br />
! supportBootstrapAgent = 1</p>
<p>diff -c sample.cfg client4.cfg<br />
*** sample.cfg  2008-02-13 09:34:57.000000000 +0100<br />
&#8212; client4.cfg 2008-02-13 10:24:48.000000000 +0100<br />
***************<br />
*** 1042,1044 ****<br />
&#8212; 1042,1046 &#8212;-<br />
# servers and Sun&#8217;s javaIDL clients. When this option is enabled, an<br />
# omniORB server will respond to a bootstrap agent request.<br />
supportBootstrapAgent = 0<br />
+ bootstrapAgentHostname = 192.168.249.130<br />
+ bootstrapAgentPort = 2809</p>
<p>In terminal 1, run the omniNames:<br />
export OMNIORB_CONFIG=~/tmp/cfg/server4.cfg<br />
omniNames -start -log ~/tmp/log<br />
(This is for first time to run.)<br />
omniName -log ~/tmp/log<br />
(This is for not first time to run.)</p>
<p>In terminal 2, run the server:<br />
cd ~/tmp/omniORB-4.1.1<br />
cd src/examples/echo<br />
unset OMNIORB_CONFIG<br />
./eg3_impl</p>
<p>In terminal 3, run the client:<br />
cd ~/tmp/omniORB-4.1.1<br />
cd src/examples/echo<br />
export OMNIORB_CONFIG=~/tmp/cfg/client4.cfg<br />
./eg3_clt</p>
<p>The output of client side is same as previous case.</p>
<p><strong>BUILD Qt</strong></p>
<p>4.3.3 X11(Open Source or Commercial)</p>
<p>Ignore.</p>
<p><strong>RUN Qt&amp;omniORB EXAMPLES</strong></p>
<p>Based on Duncan Grisby&#8217;s reply, first I tried to run the omniORB code in a QThread, it works fine. Then I just run the omniORB code in my GUI code, it also works fine.</p>
<p>(1) eg1.tar.gz, just like the first example in echo.</p>
<p>cd ~/tmp<br />
tar zxvf eg1.tar.gz<br />
cd eg1<br />
ls<br />
echo.cpp  echo.h  echo.idl  eg1.pro  main.cpp  omniorbthread.cpp  omniorbthread.h</p>
<p>echo.h and echo.cpp are generated from echo.idl with omniidl.</p>
<p>omniidl -bcxx echo.idl</p>
<p>It will generate echo.hh and echoSK.cc.</p>
<p>mv echo.hh echo.h<br />
mv echoSK.cc echo.cpp</p>
<p>Then you need to modify the echo.cpp to include &#8220;echo.h&#8221;, not &#8220;echo.hh&#8221;.</p>
<p>qmake<br />
make</p>
<p>unset OMNIORB_CONFIG<br />
./eg1</p>
<p>I said, &#8220;Hello!&#8221;.<br />
The Echo object replied, &#8220;Hello!&#8221;.<br />
OmniORBThread is over!</p>
<p>(2) eg3.tar.gz, just like the third example in echo.</p>
<p>cd ~/tmp<br />
tar zxvf eg3.tar.gz<br />
cd eg3<br />
qmake<br />
make</p>
<p>ls<br />
client  echo.cpp  echo.h  echo.idl  eg3.pro  guiclient  guiclient2  server</p>
<p>server is a console server application which runs the omniORB code in a thread.<br />
client is a console client application which runs the omniORB code in a thread.<br />
guiclient is a gui client application which runs the omniORB code in a thread.<br />
guiclient2 is a gui client application which runs the omniORB code in main thread.</p>
<p>You can use server3.cfg/client3.cfg or server4.cfg/client4.cfg to run these examples application.</p>
<p><strong>Files</strong><br />
<a href="http://www.qiliang.net/blog/wp-content/uploads/2009/07/qt_and_omniorb.txt">qt_and_omniorb.txt</a><br />
<a href="http://www.qiliang.net/blog/wp-content/uploads/2009/07/cfg.tar.gz">cfg.tar.gz</a><br />
<a href="http://www.qiliang.net/blog/wp-content/uploads/2009/07/eg1.tar.gz">eg1.tar.gz</a><br />
<a href="http://www.qiliang.net/blog/wp-content/uploads/2009/07/eg3.tar.gz">eg3.tar.gz</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.qiliang.net/blog/2008/02/qt-and-omniorb.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
