TAO FAQ
| |
Q: |
What is this FAQ about? |
A: |
This is
a FAQ for The ACE ORB (TAO), an open-source CORBA-compliant ORB born of research
at Washington University in St. Louis' Center for Distributed Object Computing
(http://www.cse.wustl.edu/~doc/). If your question isn't answered here, you might want to check out the following links:
We at OCI provide commercial-grade support for this ORB, along with documentation and consulting services (see our web page at http://www.ociweb.com for more details), and provide the site and content of this FAQ as a free service to the TAO community. If you have questions, and especially if you have answers to them, please send them to support@ociweb.com for inclusion in this FAQ! Let us know whether you'd like to be credited with the answer and, if so, how. |
Q: |
Where can I find the source code for the examples in the TAO Developer's Guide?; |
A: |
The source code for all the examples in recent versions of
the OCI TAO
Developer's Guide is available in the OCI
TAO source code distribution, itself. See
ACE_wrappers/TAO/DevGuideExamples/. For older
versions of TAO and the TAO Developer's Guide, the
source code for the examples can be downloaded from our web
site. See http://www.theaceorb.com/downloads/index.html
for more details. |
Q: |
What is the best way to start learning CORBA and TAO ? |
A: |
BooksAdvanced CORBA Programming with C++ book by Henning and Vinoski. It's the equivalent of the ACE tutorial (except it's much more complete). This is a general C++ CORBA book and covers the standard way of doing things. OnlineThe C++ Report and CUJ columns that Vinoski and Schmidt wrote over the past 4 years. They are all online at http://www.cs.wustl.edu/~schmidt/report-doc.html. TrainingDoug Schmidt teaches a course at UCLA Extension. See http://www.cs.wustl.edu/~schmidt/UCLA.html for more details. Tutorials
You can build TAO and work through the online tutorials in
|
Q: |
What's the relationship between OCI's TAO and the DOC Group's TAO? |
A: |
OCI's Distribution of TAO is signified with a
letter in the version number (e.g., TAO 1.3a, TAO 1.4a),
whereas DOC Group release version numbers do not include a letter
(e.g., TAO 1.4, TAO 1.5). OCI patch releases also indicate a
patch level (e.g., TAO 1.4a_p12), whereas DOC Group beta kits
indicate the beta number after a major release (e.g., TAO
1.5.4).
Each OCI release is derived from a DOC Group version (for example, TAO 1.4a was derived from TAO 1.4.3), but an OCI release does not correspond exactly to any DOC Group release. OCI seeks to maintain extremely stable, fully-tested, open source products backed by commercial support, training, consulting, and accompanied by extensive documentation and binaries on CD-ROM available for purchase. Many organizations desire a commercially-supported release of TAO as a basis for their mission critical applications. The DOC Group's primary focus is research and development rather than commercial support. Support is provided on a "best effort" basis through the public tao-users mailing list, and is often excellent. However, more "predictable" support is availble from OCI and other organizations. OCI selects a reasonably stable DOC Group release as the basis for each OCI distribution. OCI then builds and tests across over 50 combinations of hardware, operating systems, C++ compilers, and build flags. As bugs are encountered, they are fixed directly (and the fix is contributed back to DOC), fixed by integrating an existing DOC fix (depending on the severity and the degree of entanglement), or documented (if a fix is too involved to be accomplished without sponsorship). In addition, OCI applies various enhancements, sponsored by our customers. We also integrate these back into the DOC group repository. OCI also packages select binaries (custom builds are also available -- see http://www.theaceorb.com/product/index.html) and makes them available for purchase on CD-ROM. Since OCI's distribution of TAO is still open source, OCI also distributes the source code and all patches free of charge (see http://www.theaceorb.com/downloads).
In OCI distributions, the original DOC Group |
Q: |
What's a PRF? |
A: |
"PRF"
refers to the PROBLEM-REPORT-FORM, i.e., $ACE_ROOT/PROBLEM-REPORT-FORM.
This boilerplate document is found in both DOC distributions and OCI distributions.
The odds of getting questions answered, bugs fixed, etc., goes up significantly when you report problems using the PRF because it insures that developers and support personnel get the most commonly required information right away. Failure to use the PRF means that those folks have to spend valuable time (yours and theirs) having a conversation to get that information just to start debugging. Unless you've got a paid support contract, there's even a chance that nobody will answer!
So, always use the PRF!
|
Q: |
I want to ask a question about TAO; what can I do? |
A: |
See ACE+TAO Mailing lists for a full description of all the available ACE and TAO mailing lists.
Please remember to use the Problem Report Form (See What's a PRF?) when posting questions (and not
just "problems").
|
Q: |
With which OMG CORBA specifications is TAO compliant? |
A: |
Compliance, just like source code and the specifications
themselves, is a moving target. Each version of TAO is
compliant with various OMG CORBA specifications.
Each version of the TAO Developer's Guide includes an appendix that discusses compliance of that version of TAO in detail. These appendices are available via http://www.theaceorb.com/downloads/index.html. |
Q: |
How can I help extend TAO's functionality and add new features? |
A: |
TAO is open source and the development group welcomes code contributions.
Active participation by users ensures a robust implementation. Please refer to
the terms and conditions relating to software submissions in
the ACE, TAO, CIAO, and CoSMIC copyright and licensing
information:
http://www.cs.wustl.edu/~schmidt/ACE-copying.html.
In general, incorporation of your code into TAO results in it becoming "open" and the user
community being protected by the ACE/TAO copyright and terms.
OCI can also provide consulting and software engineering resources to help you add new functionality into TAO or to span additional platforms. We can also manage the inclusion of such code into the supported releases of new open source versions of TAO. We can provide anonymity if you wish to avoid exposing your technical strategies in public forums, where your competition may be watching. Contact sales@ociweb.com to discuss your project. Open source software can add immeasurably to the development of a
rich infrastructure, and the provision of a high degree of application
interoperability, from which we all may derive benefit. Read
more about the benefits of open source at http://theaceorb.com/product/benefit.html.
|
Q: |
Why doesn't TAO support the BOA? |
A: |
The short answer is that the BOA (Basic Object Adapter) is no longer part of the CORBA specification. The BOA was removed because of its lack of portability and underspecification among various other shortcomings. The main argument for adding BOA support to TAO is migration of existing CORBA applications. Because the BOA is implemented differently by each vendor, porting to a TAO BOA would probably be the same amount of work as porting to the POA (which provides true cross-vendor portability). All in all, applications are probably better off making the transition to the POA. |
Q: |
Is the tao-users mailing list archived anywhere? |
A: |
Yes.
You can find the tao-users archives on the web at http://groups.yahoo.com/group/tao-users/. The ace-users archive is available at http://groups.yahoo.com/group/ace-users/. ACE+TAO Mailing list info can be found at http://www.cs.wustl.edu/~schmidt/TAO-mail.html, which includes information about subscribing to the various mailing lists, including tao-users.
Thanks to Irfan Pyarali for providing this information!
|
Q: |
Can I use version X of TAO with version Y of ACE? |
A: |
Only if
X and Y were the versions of TAO and ACE that were released together. For
example, ACE 5.1/TAO 1.1 or ACE 5.1.12/TAO 1.1.12. There is no attempt to
make the interface between ACE and TAO backward (or forward) compatible.
That being said, you may be able to coerce mismatched versions to work together,
but it is not something you really want to do. |
| |
Q: |
How do I obtain, configure, and build ACE and TAO on Windows with Visual C++? |
A: |
This FAQ provides basic instructions for installing and
building ACE+TAO for Windows with Visual C++. ACE+TAO can
also be used on other major modern operating systems, such as
Linux, Solaris, AIX, and HP-UX, and some real-time and
embedded operating systems, such as VxWorks, LynxOS, Timesys
Linux, and Windows CE. On Windows, ACE+TAO can also be built
with the Borland C++ compiler.
Hardware Requirements
- CPU: ACE+TAO can be configured to build on a variety of 32
and 64 bit processors (Intel, AMD)
- Memory: 512 MB (more memory improves compile speed)
- Hard Drive Space: 256MB swap + 500 MB up to several GB
free (depending upon how much you build)
Operating System Requirements
- Windows 2000, 2003, or XP
C++ Compiler Requirements
- Microsoft Visual C++ 7.1 or 8.0
Other Software Requirements
- OCI's Distribution of TAO version 1.5a latest patch
release or the latest beta release of ACE+TAO (see
instructions below for obtaining and installing ACE+TAO)
- WinZIP or similar tool for extracting software archives
- ActiveState Perl v5.6.1 or newer (recommended, but not required)
Obtaining and Installing ACE+TAO
1. Download the latest release of OCI TAO 1.5a from:
http://download.ociweb.com/TAO-1.5a/
or download the latest beta release of ACE+TAO from:
http://download.dre.vanderbilt.edu/
2. Extract the archive into a path with no spaces in the path
name (e.g., C:\ACE_wrappers).
3. Set ACE_ROOT, TAO_ROOT, and PATH environment variables.
For example, if ACE+TAO are installed in C:\ACE_wrappers, the
variables will look like this:
ACE_ROOT=C:\ACE_wrappers
TAO_ROOT=%ACE_ROOT%\TAO
The PATH variable should contain these directories: %ACE_ROOT%\bin;%ACE_ROOT%\lib
4. Create a file named config.h in %ACE_ROOT%\ace with the following
contents:
#define ACE_DISABLE_WIN32_ERROR_WINDOWS
#define ACE_DISABLE_WIN32_INCREASE_PRIORITY
#include "ace/config-win32.h"
5. Build the Debug or Release configuration of ACE+TAO using
the following solution file:
%TAO_ROOT%\TAO_ACE.sln
The projects in the TAO_ACE solution build the ACE and
TAO libraries, TAO IDL compiler, gperf, ORB services
libraries and executables, and some common utilities.
They do not include any examples, tests, or performance
tests. (Separate directories and solutions exist for
them.) Libraries will be installed in %ACE_ROOT%\lib.
Some executables will be installed in %ACE_ROOT%\bin,
others (the ORB services executables) will be installed
in their source directories.
6. If you don't want to build all of the libraries and
executables from the TAO_ACE solution, we recommend just
building the Naming_Service project.
It, and the projects on which it depends, includes most
of the common ACE+TAO libraries that you need for
developing your applications.
7. If the above solution file does not exist, you will need
to generate it using MakeProjectCreator (MPC) (requires
Perl as listed above) with the following commands:
cd %TAO_ROOT%
%ACE_ROOT%\bin\mwc.pl -type vc71 TAO_ACE.mwc
More information on MPC is available here:
http://www.ociweb.com/products/mpc
|
Q: |
How do I obtain, configure, and build ACE and TAO on Linux? |
A: |
This FAQ provides basic instructions for installing and
building ACE+TAO for Linux. ACE+TAO can also be used on other
major modern operating systems, such as Windows, Solaris,
AIX, and HP-UX, and some real-time and embedded
operating systems, such as VxWorks, LynxOS, Timesys Linux, and
Windows CE.
Hardware Requirements
- CPU: ACE+TAO can be configured to build on a variety of 32
and 64 bit processors (Intel, AMD, PowerPC)
- Memory: 512 MB (more memory improves compile speed)
- Hard Drive Space: 256MB swap + 500 MB up to several GB
free (depending upon how much you build)
Operating System Requirements
- Linux 2.2 (or later) kernel
C++ Compiler Requirements
- gcc 3.2.x (or later)
Other Software Requirements
- OCI's Distribution of TAO version 1.5a latest patch
release or the latest beta release of ACE+TAO (see
instructions below for obtaining and installing ACE+TAO)
- GNU gunzip and GNU tar for extracting software archives
- GNU make
- Perl v5.6.1 or newer (recommended, but not required)
Obtaining and Installing OCI TAO
1. Download the latest release of OCI TAO 1.5a from:
http://download.ociweb.com/TAO-1.5a/
or download the latest beta release of ACE+TAO from:
http://download.dre.vanderbilt.edu/
2. Extract the archive into a path with no spaces in the path
name (e.g., /opt/ACE_wrappers)
3. Set ACE_ROOT, TAO_ROOT, PATH, and LD_LIBRARY_PATH environment
variables.
For example, if ACE+TAO are installed in /opt/ACE_wrappers,
the variables will look like this:
ACE_ROOT=/opt/ACE_wrappers
TAO_ROOT=$ACE_ROOT/TAO
PATH will include the directory $ACE_ROOT/bin
LD_LIBRARY_PATH will include the directory $ACE_ROOT/lib
4. Create a file named config.h in $ACE_ROOT/ace with the following
contents:
#include "ace/config-linux.h"
5. Create a file named platform_macros.GNU in
$ACE_ROOT/include/makeinclude with the following contents:
exceptions=1
inline=1
ami=1
rt_corba=1
interceptors=1
interface_repo=1
corba_messaging=1
probe=0
profile=0
fakesvcconf=0
shared_libs_only=1
debug=1 # (or debug=0)
optimize=0 # (or optimize=1)
include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
6. Build ACE+TAO using the following commands:
cd $TAO_ROOT
make
The above commands will build the ACE and TAO libraries,
TAO IDL compiler, gperf, ORB services libraries and
executables, and some common utilities. They will not
build any examples, tests, or performance tests.
(Separate directories and GNUmakefiles exist for them.)
Libraries will be installed in $ACE_ROOT/lib. Some
executables will be installed in $ACE_ROOT/bin, others
(the ORB services executables) will be installed in their
source directories.
7. If there are no GNUmakefiles, you will need to generate them
using MakeProjectCreator (MPC) (requires Perl as listed above)
with the following commands:
cd $TAO_ROOT
$ACE_ROOT/bin/mwc.pl -type gnuace TAO_ACE.mwc
More information on MPC is available here:
http://www.ociweb.com/products/mpc
|
Q: |
How do I generate static project files? |
A: |
If you have Perl installed, you can use the Makefile, Project,
and Workspace Creator (MPC) to generate them yourself. The
steps below, while they assume a UNIX platform, can be used (with minor
modifications) on any general purpose platform.
$ACE_ROOT/bin/MakeProjectCreator/config/default.features file.
Use the $ACE_ROOT/bin/MakeProjectCreator/config/global.features file as a template.Example: The following will generate static project files for the Visual C++ 7.1 compiler on Windows: % $ACE_ROOT/bin/mwc.pl -type vc71 -static -name_modifier *_Static TAO_ACE.mwcOn UNIX machines you will need to turn on the static_libs_only flag in $ACE_ROOT/include/makeinclude/platform_macros.GNU
to build static libraries.
|
Q: |
How can I build debug applications with non-debug libraries? |
A: |
During development, you will normally want to build your
application code with debugging enabled. However, you may be
using non-debug versions of the ACE, TAO, and CIAO libraries.
Depending upon your platform and development environment,
special care must be taken to make sure your debug-enabled
application can link against non-debug ACE, TAO, and CIAO
libraries. On platforms that use GNU Make, all you have to do to enable debugging in your application is set the debug
build flag to 1 when you build your application
code. You can do this by setting debug=1 on the
make command line, as follows:make debug=1Or, you can set debug=1 in your
platform_macros.GNU file when you build your
application. Note: If you have debug=1 in
platform_macros.GNU when you build the ACE, TAO,
and CIAO libraries, they will be built with debugging enabled,
too.On some platforms, such as Windows with Visual C++, the ACE, TAO, and CIAO library names may have a modifier appended to the library name to indicate whether it was built with a debug, static, MFC, or some other configuration. For example, in a debug build, the name of the ACE shared library will be ACEd.dll, whereas in a
non-debug (release) build, the name of the ACE shared library
will be ACE.dll.On these platforms, if you build your application with a debug configuration, and you are using project files generated by MPC, the linker will, by default, look for libraries with the "d" debug modifier appended to the library name. If you are building your debug application against non-debug libraries, you need to tell the linker to look for the unmodified library names. You can do this by directly editing the project settings (e.g., to remove the "d" from the library names). Or, you can use the -value_template MPC option to
override the default definition of the library modifier when
you generate your project files.For example, suppose your application's MPC workspace file is MyApp.mwc and suppose you are using Visual C++
7.1. If you want to build your application against the same
set of non-debug ACE, TAO, and CIAO libraries, regardless of
whether you build the debug or release configuration, you can
use the following command to generate your application's
project and solution files:$ACE_ROOT/bin/mwc.pl -type vc71 -value_template lib_modifier=The -value_template option in the above command
sets the value of the lib_modifier template
variable to an empty string, which causes no modifier to be
added to the library names with which your application will
link, regardless of which configuration (debug or release) you
build.Watch out for build problems if you have any settings in your config.h file that depend upon having debugging
enabled, for example:#if defined(_DEBUG) #undef __ACE_INLINE__ #endifFor more information on MPC, see the MPC documentation and the MPC FAQ: http://download.ociweb.com/MPC http://www.ociweb.com/products/mpc/faq.html |
| |
Q: |
What's the advantage to buying OCI's Distribution of TAO? |
A: |
Depending
upon your circumstances, there may be several advantages to buying OCI's
Distribtution of TAO rather than closely tracking the beta source code kits:
|
Q: |
Does the OCI documentation set include the CD, too? |
A: |
No, it does not. The documentation set only includes OCI's own
TAO
Developer's Guide. CDs containing prebuilt versions of TAO for multiple platforms are available separately. |
Q: |
If I install TAO from the OCI CD set, do I need to build it? |
A: |
In addition to the full source code for ACE and TAO, the OCI CD set includes
pre-built libraries for ACE, TAO, and TAO's CORBA
services, plus executables for TAO's IDL compiler, gperf, and servers for the
various services.
The CD set contains these pre-built components for many popular platforms, operating systems, and C++ compilers. In addition, the builds on the CD set include more than one build configuration (i.e., debug on or off, native C++ exception support on or off). Note that the CD set does not include pre-built binaries of the various tests, performance tests, and examples that come with ACE and TAO, but the full source code for them is there. So, if you install TAO from the OCI CD set for one of the existing platform / operating system / compiler combinations, you can get started writing, building, and running your own applications that use TAO right away.
Of course, since you have the full source code, you can custom build it yourself
(e.g., for a particular platform, operating system, compiler, or configuration
which is not present on the CD).
|
Q: |
Are the Table of Contents and Index for the TAO Developer's Guide available on-line? |
A: |
Yes.
The Table of Contents and Index for OCI's TAO Developer's Guide are available in PDF form via: http://www.theaceorb.com/downloads/index.html Just follow the appropriate links to download the files you want. |
Q: |
Is it possible to install debug and release versions of TAO on the same Windows machine? |
A: |
It is
possible to install both debug and release versions of TAO on one Windows machine
by selecting a different installation directory for each installation and
setting $ACE_ROOT and $TAO_ROOT appropriately. More efficienty, the debug
and release versions of TAO can be installed in the same directory since
the different versions of the libraries have slightly different names. |
Q: |
Why is the TAOd.dll library I install from OCI's CD so large? |
A: |
The DLLs
on the CD include all the information you need to debug TAO applications.
This information is normally stored by Visual C++ in .pdb files. Our builds
store them in the .dll in a location independent manner (using the C7 compatible
option for the debug information). This allows you to step into TAO code
in the Visual C++ debugger. If you desire a smaller set of libraries, either install the release
versions of the CD or rebuild the debug libraries with the default debug
configuration. |
Q: |
How do I get support from OCI? |
A: |
You're always welcome to send a question. However, the disposition of your
request depends upon whether or not you have a technical support contract
with OCI:
|
Q: |
Which platforms (hardware/OS combinations) are supported by OCI's Distribution of TAO? |
A: |
A full list of platforms (and other support details) is available at http://www.theaceorb.com/support/index.html.
|
| |
Q: |
I'm having weird problems with the Naming Service. How can I solve them? |
A: |
More than
likely you're having problems related to multicast discovery of the Naming
Service. Multicast was the default mechanism for finding the
Naming Service in older versions of TAO. Symptoms range
anywhere from a client not being able to find the Naming
Service at all, to finding it sometimes, to just completely bizarre and inexplicable behavior.
So, before you do anything, try it all again, but this time turn off multicast discovery. See How do I locate the Naming Service without resorting to multicast discovery?.
|
Q: |
How do I locate the Naming Service without resorting to multicast discovery? |
A: |
Here are some common ways to use the -ORBInitRef option to locate the Naming
Service (where bart is just an example host name):
# Store the IOR of the Naming Service's root Naming Context in a file: Naming_Service -m 0 -o /tmp/ns.ior client -ORBInitRef NameService=file:///tmp/ns.ior# Specify an IIOP endpoint when you start the Naming Service: Naming_Service -m 0 -ORBListenEndpoints iiop://bart:2809 client -ORBInitRef NameService=corbaloc:iiop:bart:2809/NameService You can also use the Naming_Service -m 0 -ORBListenEndpoints iiop://bart:2809 export NameServiceIOR=corbaloc:iiop:bart:2809/NameServiceNow, when your client calls resolve_initial_references("NameService"), no
multicast will be performed. The -m 0 option turns multicast off in the
Naming_Service server. This is the default in TAO versions 1.1.17 and later.
Earlier versions defaulted to multicast enabled in the server. |
Q: |
Why is multicast discovery of the Naming Service failing? |
A: |
There
can be a myriad of reasons, many related to network or OS-level issues rather
than TAO. Try turning on -ORBDebugLevel 5 to get some sense of what might
be happening internally.
If you're using Windows, check out Why doesn't using the Naming Service with Multicast work? and see if it applies.
|
Q: |
Is the Naming Service server's object reference "persistent?" |
A: |
Yes, TAO's
implementation of the OMG Naming Service always creates a persistent IOR
for the root Naming Context. That is to say, it creates the object reference
in a POA that has the PERSISTENT life span policy. Thus, you can use the
IOR across invocations of the Naming Service provided that the service always
starts up on the endpoint used when creating the original reference.
Use the Naming_Service -ORBListenEndpoints iiop://bart:2809The general form is: Naming_Service -ORBListenEndpoints iiop://name_server_host:name_server_portFor more detailed information on using the -ORBListenEndpoints option, see the TAO Developer's Guide
For more information on direct binding of persistent object references, see Henning's and Vinoski's Advanced CORBA Programming with C++, 14.3.2. |
Q: |
How do I keep Cos Event Service consumers from blocking suppliers? |
A: |
By default,
the COS event channel delivers an event to a consumer using the same thread
that received it from the supplier. When suppliers publish or emit events,
they do so using a two-way invocation. When the event channel delivers an
event, it also uses a two-way invocation. Since these are both two-way calls,
and the delivery invocation is initiated during the publishing invocation,
this causes the supplier to block (waiting for the response to its two-way
publication invocation) while the consumers process the event. This behavior can be avoided by directing the event channel to use a separate dispatching thread for the push to the consumers. This is accomplished differently depending on which COS EC is being used. When using the "native" COS EC, the -CECDispatching option can be used to change the dispatching strategy. A dispatching strategy of "mt" (multithreaded) will start a second thread and use it for the push calls to the consumer. Placing the following option in the service configurator file does the trick: static CEC_Factory "-CECDispatching mt"For example, if this line was placed in ec.conf, then the event channel server can be started with the following command: CosEvent_Service_Native -ORBSvcConf ec.confThe -CECDispatchingThreads option is used to control the number of threads used for consumer deliveries. When using the COS EC that wraps the RTEC (which is the only COS EC in older versions of TAO), the same effect can be accomplished by using the analogous options on the RTEC (-ECDispathing and -ECDispatchingThreads on the EC_Factory). For more information about these and other event channel options, see the TAO Developer's Guide, 14.8 and the online documentation at $TAO_ROOT/docs/cec_options.html and $TAO_ROOT/docs/ec_options.html. |
Q: |
Why does my event channel get so slow when consumers die? |
A: |
By default
the event channels (Cos and RTEC) in TAO continue to attempt to push new
events at consumers even after previous pushes to that consumer have failed.
If a particular consumer is destroyed without disconnecting from the event
channel, then all subsequent pushes by the corresponding supplier proxy will
fail. Since each of these require the ORB to timeout, they can drastically
affect the throughput of the EC. You can modify this behavior via the -ECSupplierControl and -ECConsumerControl options. The consumer control option sets the strategy used to deal with ill-behaved consumers. Put the following in a service configurator option file (ec.conf):
static EC_Factory "-ECConsumerControl reactive" This sets the control strategy for the consumers to reactive. Now start the event channel process with this configuration:
$TAO_ROOT/orbsvcs/Event_Service -ORBSvcConf ec.conf Any failed attempts to communicate with a consumer result in the disconnection of that consumer (and its proxy) from the event channel. The reactive strategy also polls all the consumers periodically and disconnects them if they fail to respond. The default polling period is 5 seconds and can be set via the -ECConsumerControlPeriod option. The supplier control strategy (and associated polling period) works the same way with suppliers. The native Cos Event Channel has analogous options (-CECConsumerControl,
-CECSupplierControl, -CECConsumerControlPeriod, and -CECSupplierControlPeriod).
|
Q: |
Does TAO's CosEvent Service support Typed Events? |
A: |
Yes, as of TAO 1.3.4. See $TAO_ROOT/orbsvcs/examples/CosEC/TypedSimple for a
simple example using Typed Events.
|
Q: |
What is the difference between TAO's Real-Time Event Service and the OMG Notification Service? |
A: |
The Notification
Service is an implementation of the OMG's Notification Service specification,
which originally came out of the Telecommunications working group within
the OMG. See http://www.omg.org/cgi-bin/doc?formal/2000-06-20 for the specification. The Notification Service is backwards compatible with the OMG Event Service.
The Real-Time Event Service is TAO specific. It was developed prior to the adoption of the OMG Notification Service specification. The RT Event Service was designed to meet the real-time and quality of service needs of certain sponsors of the DOC group, but has applicability in a wide variety of domains. On the surface, the two services provide several similar features,
though the specifics of their interfaces and implementations are quite different:
In addition, the RT Event Service provides some features that are not part of the Notification Service, such as event channel federations, event correlation, suspension and resumption of consumer connections, and integration with a scheduling service. The RT Event Service is older and perhaps more "mature" in that
it has been through multiple iterations of development and is in active use
by many real world applications. However, the Notification Service is also
quite good and since the Notification Service is based on an OMG specification,
it may be a better choice for your application, depending upon your needs.
|
| |
Q: |
Is it built automatically or do I have to do something special? |
A: |
Security and SSLIOP are not built in a default configuration. You must add stuff to your platform_macros.GNU (see How do I build TAO to get security and SSLIOP?) as well as install additional software (see What additional software do I need to install?).
|
Q: |
What additional software do I need to install? |
A: |
You'll need OpenSSL (http://www.openssl.org).
In addition, you might need a way of getting good random numbers.
|
Q: |
How do I build TAO to get security and SSLIOP? |
A: |
See https://svn.dre.vanderbilt.edu/viewvc/Middleware/trunk/TAO/docs/Security/SSLIOP-INSTALL.html?view=co.
See also the "TAO Security" chapter of the TAO Developer's Guide |
Q: |
Is it legal for me to have this? What sort of legalities are there in using this? |
A: |
First,
we're software developers and not lawyers. We might be able to write good
software, but it takes a mind far more twisted than ours to understand US
Export regulations, especially on cryptography and security issues. Therefore,
if you have concerns, you should consult your lawyer.
That said, you might look at http://www.bis.doc.gov/Encryption/ for current information from the U.S. Government if you're under its jurisdiction.
|
Q: |
How I can enter the certificate password using an API rather than requiring a user to type in the password? |
A: |
The ACE_SSL wrappers don't provide an API or wrapper method(s) to do
this. However, you can set a password callback function by manually
using the OpenSSL functions. For example, something like the
following should work:SSL_CTX *ctx = ACE_SSL_Context::instance ()->context ();where "your_callback" is a pointer to your PEM passwork callback function. See <openssl/ssl.h> and <openssl/pem.h> for the required callback function signature. |
Q: |
Why can't I make an SSLIOP connection using a DSA certificate? |
A: |
If you would like to create and use DSA certificates there are a couple of things that need
to be done for it to work with SSLIOP. When using DSA certificates you need to specify DH parameters.
You can do this by obtaining the SSL context before any connections are made using the ORB.
This is TAO specific therefore not portable to other ORBs. First you need to obtain a set of DH parameters.
You can either generate these at runtime ( which will take a very long time ),
or generate them once with the openssl tool and append them to the end of your certificate. openssl tool: [Command Line]
openssl gendh 512 >>cert.pem
This will add 512-bit DH parameters to the end of the file cert.pem.
After you have created these parameters you will need to load them in your application.#include "orbsvcs/SSLIOPC.h" #include "openssl/pem.h"This should be it. This sets the DH parameters needed to use a DSA certificate with SSLIOP. Please note that a greater degree of error checking should be done than what is provided in this code. |
Q: |
How can I use a non-security enabled Naming Service with a security (SSLIOP) enabled client? |
A: |
When security
is enabled in a CORBA client's ORB, all invocations will be attempted using
a secure connection. However, the Naming Service for example may not be
set up to use security. Invocations on that Naming Service will result in
a CORBA::INV_POLICY exception since the client is unable to make a secure/protected
invocation on that non-security enabled Naming Service. To correct this problem, protected invocations via the Naming Service's object reference must be disabled. This is achieved by setting a policy override on the Naming Service's object reference like so: // Disable protection on Naming Service invocations.This is based on TAO's Secure_Invocation test client side code in $TAO_ROOT/orbsvcs/tests/Security/Secure_Invocation/client.cpp. (TAO 1.2 or better) The above policy override code is standard and should be portable to all ORBs that support the SecurityLevel2::QOPPolicy quality-of-protection client-side policy. Don't forget to include "orbsvcs/SecurityC.h" (this is TAO-specific) to pull in the Security QoP policy related constants and types. |
Q: |
How can I make access to some objects more secure than access to others? |
A: |
Use the Security service's AccessDecision interface. This is available in via TAO/orbsvcs/orbsvcs/SecurityLevel2.idl. An example of using this interface is provided in TAO/orbsvcs/Security/mixed_security_test.
The AccessDecision interface gives the ability to weaken the security requirements for designated object references. Show here, its single operation is intended to be called from an interceptor, or perhaps from within a servant.
module SecurityLevel2 {
local interface AccessDecision {
# pragma version AccessDecision 1.8
boolean access_allowed (
in SecurityLevel2::CredentialsList cred_list,
in Object target,
in CORBA::Identifier operation_name,
in CORBA::Identifier target_interface_name
);
};
};
TAO also extends this interface in order to allow for runtime configuration of the supplied AccessDecision object, for adding or removing objects for consideration.
module TAO {
module SL2 {
local interface AccessDecision : SecurityLevel2::AccessDecision
{
/* TAO-specific access_allowed that works around deficiencies in
the SecurityLevel2::AccessDecision::access_allowed() operation. */
// Parameter object_id should be PortableInterceptor::ObjectId, but
// using that type would require including the PI_Forward.pidl file.
// By using the real type, we can avoid that dependency.
boolean access_allowed_ex (in ::CORBA::ORBid orb_id,
in ::CORBA::OctetSeq adapter_id,
in ::CORBA::OctetSeq object_id,
in ::SecurityLevel2::CredentialsList cred_list,
in ::CORBA::Identifier operation_name);
/*! Default value returned when a reference is not in the list. */
// Can't come up with a good name for this.
attribute boolean default_decision;
/*! Establish whether a particular object can be accessed via insecure
means. */
void add_object (in ::CORBA::ORBid orb_id,
in ::CORBA::OctetSeq adapter_id,
in ::CORBA::OctetSeq object_id,
in boolean allow_insecure_access);
void remove_object (in ::CORBA::ORBid orb_id,
in ::CORBA::OctetSeq adapter_id,
in ::CORBA::OctetSeq object_id);
};
};
};
In addition to adding operations for adding or removing object references for consideration by the AccessDecision object, an extended access allowed operation is also provided, to work around a deficiency in comparing object references. For TAO, serialized object references cannot be used for comparison because they are produced using CDR encoding. This encoding uses padding bytes for alignment of multibyte values, and the padding bytes are uninitialized, meaning they will contain random data, and thus cannot be used when comparing two serialized object references. Typically, your application will initialize the AccessDecision object by supplying it with information used to unambiguously identify the object reference, and rely on the built-in interceptor to make the call to access_allowed. TAO's security interceptor, supplied as part of the TAO_Security library, will first check with the AccessDecision object to see if unrestricted access is allowed, and if not will then evaluate the request based on the regular secure access rules. It is possible to implement your own AccessDecision object to provide even greater control, such as restriction based on the content of the supplied credentials, and even on a per-operation level. To use the AccessDecision interface, you must first obtain a reference to the Level 2 Security Manager from the ORB. From that you get the AccessDecision, and finally narrow that to a TAO::SL2::AccessDecision reference. #include At this point, you supply object references for consideration. It is best to do this when you are creating the references so that you don't have to keep track of the required information.
PortableServer::ObjectId_var oid = rootpoa->servant_to_id (server2);
CORBA::OctetSeq_var poaid = rootpoa->id();
CORBA::String_var orbid = orb->id();
sl2ad->add_object (orbid.in(), poaid.in(), oid.in(), true);
At this point, you are ready to go, the AccessDecision::access_allowed operation effectively adds a |
| |
Q: |
Can I use resolve_initial_references() to directly bind to my own servers? |
A: |
Instead
of binding object references with the Naming Service and requiring clients
to resolve them by name, you can make it possible for clients to directly
bind to objects using CORBA::ORB::resolve_initial_references(),
the same
mechanism used to bind to other important objects, such as the Naming Service.
For example, suppose you have a server that provides a Bank object (let's call it "CORBABank"). Rather than binding this object by name in a naming context in the Naming Service, you would like clients to access it directly by simply calling
orb->resolve_initial_references("CORBABank");
There are several ways to accomplish this.
The following steps describe one way to use the 3rd method described above.
The combination of the simple object key and the fixed endpoint allows us
to reference the object via a corbaloc-style reference in the
For example, we can start our processes as follows: server -ORBListenEndpoints iiop://bart:10200 client -ORBInitRef CORBABank=corbaloc:iiop:bart:10200/BankObject Where BankObject is the simple object key assigned to the CORBA object in the server.
Now, on the client side, we can use
// Initialize the ORB.
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
// Get a reference to the Bank using resolve_initial_references().
CORBA::Object_var obj = orb->resolve_initial_references("CORBABank");
Bank_var bank = Bank::_narrow(object.in());
if (CORBA::is_nil(bank.in())) {
cerr << "Bank::_narrow() failed!" << endl;
return 1;
}
// Use the Bank's object reference like you normally would...
Note that on older versions of TAO (before 1.1.10) the object reference format is slightly different: client -ORBInitRef CORBABank=iioploc://bart:10200/BankObject |
Q: |
How do I use a "corbaloc" object reference with a TAO server? |
A: |
Note:
The corbaloc style object reference was added to the CORBA standard via the
Interoperable Naming Service specification. For more information on "corbaloc",
see the CORBA 2.3.1 (or later) specification, section 13.6.6. TAO added support for corbaloc references in version 1.1.10. Prior to that, TAO supported an earlier version of the specification that used the iioploc format. You can use corbaloc references to contact servers built with any version of TAO (assuming the client ORB supports them). To simplify use if corbaloc object references, you
can register your CORBA object in the server ORB's IOR table so
it can be located via a simple object key. To bind an object reference to
this table in current versions of TAO (1.1.10 and later):
// Turn your object reference into an IOR string
CORBA::String_var ior_string = orb->object_to_string(obj.in());
// Get a reference to the IOR Table
CORBA::Object_var tobj = orb->resolve_initial_references("IORTable");
IORTable::Table_var table = IORTable::Table::_narrow(tobj.in());
// Bind your stringified IOR in the IOR Table
table->bind("CORBABank", ior_string.in());
You will also need to #include "tao/IORTable/IORTable.h" and link with the TAO_IORTable library.
In older versions of TAO (1.1.9 and prior) this binding is accomplished via the following code: // Add our Bank object to the ORB's IOR table (TAO specific). orb->_tao_add_to_IOR_table( "CORBABank", obj.in() ); Both of these techniques make it possible for corbaloc-style object references to locate the specified CORBA object via a simple object key ("CORBABank"). The Bank's object reference doesn't necessarily have to be a persistent object reference, but it can be. For more information on persistent object references, see How do I make my object references persistent?. When we run the TAO server, we must ensure that it listens on a host
and port that are known to the client. We use TAO's
-ORBListenEndpoints command-line option to do this. The format of -ORBListenEndpoints is -ORBListenEndpoints iiop://host:portFor example, if I'm running my server on host "myhost", listening on port 11019: server -ORBListenEndpoints iiop://myhost:11019When running the client, we'll use a "corbaloc" object reference. The format of the "corbaloc" object reference is corbaloc:protocol:host:port/ObjectKeyFor example: corbaloc:iiop:myhost:11019/CORBABankconnects to the server on host "myhost" at port 11019, and finds the object reference in that server corresponding to the "CORBABank" key. This object reference can be passed to ORB::string_to_object() and then is used like any
other object reference.
|
Q: |
How do I make my object references persistent? |
A: |
In CORBA
terminology a transient object reference is one that is only good for the
lifetime of a given server's execution. If you run a server, distribute
a transient reference to a client, and then kill the server, then the object
reference is now useless (even if the server is restarted). A persistent
reference allows you continue to use the reference even if the server is
restarted. In order to make your object references persistent you must do the following in your server:
For example:
// Initialize the ORB.
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
// Obtain an object reference for the root POA.
CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
PortableServer::POA_var rpoa = PortableServer::POA::_narrow(obj);
// Create a policy list for our child POA.
CORBA::PolicyList bankPolicies;
// Create the policies for our child POA:
// LifespanPolicy: PERSISTENT
// IdAssignmentPolicy: USER_ID
pols.length(2);
pols[0] = rpoa->create_lifespan_policy(PortableServer::PERSISTENT);
pols[1] = rpoa->create_id_assignment_policy(PortableServer::USER_ID);
// Get the Root POA's POA Manager so it can manage our child POA
PortableServer::POAManager_var poa_mgr = rpoa->the_POAManager();
// Create the child POA.
PortableServer::POA_var bank_poa =
rpoa->create_POA("BankPOA", poa_mgr, pols);
// Destroy the POA policies (create_POA() makes a copy).
pols[0]->destroy();
pols[1]->destroy();
// Create a Bank servant object and activate it with the POA.
Bank_i* bankServant = new Bank_i();
// Explicitly activate the Bank servant. We will use the string
// "CORBABank" to generate an ObjectId for the bank.
CORBA::String_var bankIdString = CORBA::string_dup("CORBABank");
PortableServer::ObjectId_var bankId =
PortableServer::string_to_ObjectId(bankIdString.in());
bank_poa->activate_object_with_id(bankId, bankServant);
obj = bank_poa->id_to_reference(bankId.in());
// Activate the POAs.
poa_mgr->activate();
// Handle requests from clients.
orb->run();
Since the Bank's object reference is a persistent IOR, when we invoke the Bank's server, we need to specify a particular endpoint for the ORB. For example:
BankServer -ORBListenEndpoints iiop://bart:10200 Now, any clients that receive these object references can use them between
different runs of the server. Note, that you still need to manually restart
the server, unless you use the Implementation Repository. |
Q: |
Using the Naming Service |
A: |
The Naming Service is a common boostrapping/discovery mechanism. The following FAQ's address the naming service: I'm having weird problems with the Naming Service. How can I solve them?, How do I locate the Naming Service without resorting to multicast discovery?, Why is multicast discovery of the Naming Service failing?, Is the Naming Service server's object reference "persistent?"
|
| |
Q: |
How do I get a TAO server to use IIOP v1.0 or v1.1? |
A: |
You must
use the -ORBListenEndpoints option. For further details, please refer to the TAO
Developer's Guide, the chapter on "ORB Initialization Options." Alternately
refer to $TAO_ROOT/docs/Options.html. The short answer is: -ORBListenEndpoints iiop://V.v@[hostname:[port]] The V.v@ portion of this syntax informs the server to use a specific major and minor version of the specified protocol. For example, to force a server to use IIOP v1.1 (instead of the default v1.2) on a host named "barney" at port 22000: -ORBListenEndpoints iiop://1.1@barney:22000 If you always want to force use of IIOP 1.0 or 1.1, you can set the following macro values and rebuild TAO (and your application):
#define TAO_DEF_GIOP_MAJOR 1
These macros are typically set in $TAO_ROOT/tao/orbconf.h or $ACE_ROOT/ace/config.h.
|
Q: |
Why is my "client" thread dispatching requests? |
A: |
By default,
TAO attempts to efficiently use all the threads that are given to it. This
includes "client" threads that have sent a request and are waiting for a
reply from the server. While waiting, these threads enter the normal thread
pool reactor event loop. This means that any incoming requests (assuming
that the process is also a server) may be dispatched using that thread. Such
a situation is referred to as a "nested upcall".
This has a couple of side effects that surpise many people. First, it is possible for even a single threaded server to process more than one request at the same time. Second, if you try to allocate threads exclusively as "server" threads and "client" threads, the ORB will pay no attention to your idea of what these threads are and dispatch requests on both. Why is this the default behavior of TAO? Mainly because nested upcalls avoid many potential deadlock situations. One example is a simple callback operation with a single threaded client. When the client sends a request to the server, the server sends a callback request back to the client. If the client's only thread is waiting for the reply and not dispatching incoming requests, then a deadlock is now in place. The default behavior allows the client ORB to process the callback request and send a reply to the server which frees the server ORB to send its reply back to the client. There however are situations where you may wish to prevent nested upcalls in your application. Some common reasons are:
See entry How can I prevent nested upcalls in my application? for techniques to prevent nested upcalls. |
Q: |
How can I prevent nested upcalls in my application? |
A: |
As discussed in entry Why is my "client" thread
dispatching requests? there are situations when we may want to
disable nested upcalls in our application. There are several techniques available
to prevent nested upcalls. These are:
-ORBWaitStrategy (formerly known as the
-ORBClientConnectionHandler)
service configurator option.Specifying an "rw" wait strategy causes threads waiting
for replies to not enter the normal event loop and instead block for their
pending reply. This keeps the ORB from dispatching incoming requests on
your "client" threads. One side effect of this option is that your client
is now more susceptible to deadlocks as discussed in Why is
my "client" thread dispatching requests?. Here are the required
directives (each directive should appear on one line):
static Client_Strategy_Factory "-ORBWaitStrategy rw -ORBTransportMuxStrategy exclusive -ORBConnectStrategy blocked -ORBConnectionHandlerCleanup 1" static Resource_Factory "-ORBFlushingStrategy blocking" Note that you should always set the
Also note that -ORBConnectionHandlerCleanup is not available in versions of TAO prior to 1.4a_p11. The reason for using exclusive transport multiplexing is that you must not allow another request to be sent over a connection if that connection is already being used by another thread that is waiting for a reply. The blocking connect and flushing strategies are required because the event handler for a connection used to send a request is not registered with the ORB's Reactor. The Connection Handler Cleanup strategy needs to be enabled to properly cleanup server side connection closure.
// Assume the callback's IOR is in a Callback_var called cb.
// First, "remarshal" the callback IOR using the "server" ORB.
CORBA::String_var cbstr =
server_orb->object_to_string(cb.in());
// Then, demarshal it using the "client" ORB.
CORBA::Object_var new_ior =
client_orb->string_to_object(cbstr.in());
// Finally, narrow it to the derived interface type
// (can reuse cb).
cb = Callback::_narrow(new_ior.in());
Now, when your application makes an invocation on the callback IOR, it will be sent via the "client" ORB, where it cannot be dispatched for nested upcalls. Note: Both Two-ORB and RW wait startegy are incompatible with
BiDirectional GIOP.
|
Q: |
What's the recommended configuration when using thread-per-connection? |
A: |
If you wish to use the thread-per-connection server-side concurrency model, a few other settings should also be present in your svc.conf file. Below is an example of this (each directive should appear on one line):
static Server_Strategy_Factory "-ORBConcurrency thread-per-connection"
static Client_Strategy_Factory "-ORBWaitStrategy rw -ORBTransportMuxStrategy exclusive
-ORBConnectStrategy blocked -ORBConnectionHandlerCleanup 1"
static Resource_Factory "-ORBFlushingStrategy blocking"
Note that -ORBConnectionHandlerCleanup is not available in versions of TAO prior to 1.4a_p11. The rational behind these settings is as follows: in thread-per-connection a thread is dedicated to servicing requests that come in on a given connection. In order to keep this thread dedicated to its connection, we need to prevent the thread from entering the reactor or the leader-follows pool even in the event that the thread attempts to make a request on a remote object (see the Client_Strategy_Factory settings) or cannot write a large reply back to the socket all at once (the -ORBFlushingStrategy setting). This is closely related to the use of the RW wait strategy in order to prevent nested upcalls. |
Q: |
How can I have some objects available to one interface and the rest available on another? |
A: |
There are two key techniques you can use in this situation. You can use multiple ORBs, or you can use a single ORB and use the TAO-specific endpoint policy to filter endpoints on a per-POA basis.
The two ORB approach works by passing separate endpoint collections defined with "-ORBEndpoint The endpoint policy approach allows you to have a process with a single ORB, and thus a single event loop and a single POA hierarchy, and still be able to have some POAs create object references containing a subset of the endpoints owned by the ORB. To see an example of the endpoint policy in action, look at TAO/tests/POA/EndpointPolicy.
The endpoint policy implementation is stored in libTAO_EndpointPolicy. If you are using MPC to manage your build environment, have your server project inherit the "endpointpolicy" base project. Somewhere in your application code, you must The policy value for the endpoint policy is a list of endpoints. This way you may supply more than one endpoint value, even for different protocols, to the same endpoint policy. The constructor for IIOP-specific endpoint values takes a hostname and a port number.
Endpoint policy instances are created the way any other custom policy might be, using the ORB's create_policy() operation.
Unlike other POA related policies, this policy is applied to a POA manager. This is done via the POAManagerFactory interface.
You then use this POAManager when you create POA instances. This POA manager is also the one on which you call activate to set all the related POAs to the active state.
At this point any object references created by the "goodPOA" will contain only the endpoints specified on the list given to the "goodPOAManager".
Important Note: The endpoint policy works to select endpoints that were previously passed to the ORB with the |
Q: |
Why do I get this: ACE_DLL::open failed for TAO_Codeset? |
A: |
Codeset negotiation is an optional feature for TAO. It is implemented in a
separate shared library, libTAO_Codeset.so, or TAO_Codeset.dll on Windows.
Typically, TAO is not explicitly linked to the codeset library, rather it
relies on the ACE Service Configuration framework to load the library for it.
The error in question is reported when ACE cannot find the Codeset library in
the LD_LIBRARY_PATH, or the runtime PATH on Windows. While most error or
warning reports such as the one in question are guarded by a log-level test,
this one is not, because the code in question is often used in static
initializers, which are called before a log-level determination can be made.
|
Q: |
Will TAO run without linking TAO_Codeset? |
A: |
Yes. However it will not participate in Codeset negotiate with other ORBs.
If you are in a mixed environment where you are mixing, say, Unicode, UTF-8,
or various Asian codesets, you will have problems with character interchange.
|
Q: |
I'm not interested in using Codeset Negotiation, how can I disable it? |
A: |
You may disable the codeset negotiation feature completely by passing
-ORBNegotiateCodesets 0 to ORB_init. When this is done, the TAO_Codeset library
is not loaded, thus saving the memory and messaging overhead of codeset
negotiation.
TAO may also be built with codeset negotiation off by default. This is done by
editing ACE_wrappers/ace/config.h and adding
This will set the internal default to not load the codeset library, but this
can be overridden by supplying -ORBNegotiateCodesets 1 to ORB_init.
|
Q: |
I'm building a statically linked application and want to statically link the codeset library. |
A: |
This may be done via MPC. Edit
$ACE_ROOT/bin/MakeProjectCreator/config/default.features file to add the line:
negotiate_codesets = 1
This will explicitly add TAO_Codeset to the link line of your application.
Somewhere within the body of your code, you must also add
|
| |
Q: |
How can I get TAO to use a transport protocol other than TCP/IP? |
A: |
TAO includes a "pluggable" transport protocol framework
that allows the ORB to be configured to work over transports
other than TCP/IP. In fact, the standard Internet Inter-ORB
Protocol (IIOP) is implemented in TAO as a pluggable transport
protocol that is based on TCP/IP. Besides IIOP, TAO comes
with several alternate transport protocol implementations,
including:
Currently, the UIOP, SHMIOP, DIOP, and SCIOP implementations
are all found in The use of the underlying transport protocol is completely transparent to the application. In fact, the ORB can actually be configured to use more than one transport protocol simultaneously. If one of the above built-in transport protocols does not meet your needs, you may need to implement one yourself. If done correctly, it should require no changes to the TAO core. Use one of the existing pluggable transport protocol implementations as guidance. Using and developing pluggable protocols is documented in detail in the TAO Developer's Guide. |
Q: |
Which thread does TAO use to dispatch a request? |
A: |
The answer to this depends on a number of conditions:
See https://svn.dre.vanderbilt.edu/viewvc/Middleware/trunk/TAO/docs/Options.html?view=co for more details on these options.
See http://www.cs.wustl.edu/~schmidt/PDF/C++-report-col18.pdf for a discussion of TAO's collocation optimizations.
|
Q: |
How can I detect when a connection between a client and server is broken? |
A: |
(Paraphrased from e-mail by Carlos O'Ryan coryan@uci.edu)
You cannot directly detect when this happens. You could write a pluggable protocol that informs your application when a connection dies, but that's about it. Typically behind this question is the issue: how can I detect if my client died. Using connections for that is a very bad idea: the client or server ORBs may close the connection just because it is idle for too long or there may not be a physical connection between two ORBs (they may be collocated or using shared memory to communicate). There can also be multiple connections between a given client-server pair. In CORBA, connections are hidden, and can come and go as needed. Trying to rely on them to establish if the client is still there does not work. In general you are better off using some application-level session
object that gets destroyed by the client when it terminates gracefully, and
that gets destroyed by an Evictor if it has been idle or unable to contact
the client for too long. |
Q: |
What are these CORBA::Environment parameters? Why do I get errors about pure virtual functions? |
A: |
The CORBA::Environment parameters are part of
the alternate exception mapping defined by the OMG's IDL to
C++ language mapping specification. Normally, CORBA
exceptions are mapped to C++ exceptions. The mapping also
allows CORBA to be used when C++ exceptions are unavailable or
undesirable by passing exception information via an extra
parameter of type CORBA::Environment. TAO
versions up to 1.5.1 support both mappings and you can build
ACE/TAO to support either mapping by passing
exceptions=0 or exceptions=1 to GNU
make or by defining the macro ACE_HAS_EXCEPTIONS.
If you build TAO to use native C++ exceptions, the IDL
compiler, by default, does not include the
For more information about Exceptions and TAO, see the Error
Handling chapter of the TAO Developer's Guide.
|
Q: |
What is involved with using std library (inc stl) with ACE/TAO? |
A: |
There are several conditional directives that are relevant:
In practice it is fairly common to use ACE_HAS_STANDARD_CPP_LIBRARY. I always use this, and prefer the standard library to ACE where there is overlap. (ie std::map or hash_map over ACE_Hash_Map_Manager_Ex) Of course this can be a portability issue. |
Q: |
Why does ORB_init change the order of the command line arguments if we pass argv to ORB_init(argc, argv)? |
A: |
CORBA::ORB_init() is supposed to remove all "-ORB" options it recognizes. One way of doing that logically and
efficiently is to put all of those recognized arguments at the end of the argument vector and adjust the argument count (argc) accordingly.
You are only supposed to use the first "argc" number of arguments after call CORBA::ORB_init(). In your case, you had:
argc = 3 and argv = { "ex", "-ORBDebugLevel", "5" }
After calling CORBA::ORB_init() you have:
argc = 1 and argv = { "ex", "5", "-ORBDebugLevel" }
This means that you should only be using first argument from the argument vector.If you need to maintain the order of the original argument vector for later use, then you have to make a copy before calling CORBA::ORB_init(). |
Q: |
Why don't signals work with the ORB's reactor? |
A: |
Signals and the ORB reactor:
By default ACE uses the ACE_Select reactor, which works with
signals. TAO defaults to use the thread pool (TP) reactor, which does
not currently work with signals. See DOC Bug 1031:
The call
Another possible approach for handling signals in a TAO
application that uses the default TP reactor would be to
spawn a separate thread and use |
Q: |
What is TransportCurrent library used for ? |
A: |
It provides an implementation of an interface(Transport::Current) for obtaining common transport
information and an implementation of IIOP specific interface (Transport::IIOP::Current) for obtaining
IIOP specific transport information. On the other hand it also is a framework for implementing
transport-specific plug-ins (for querying specific transport, other than IIOP).
Please see $TAO_ROOT/docs/transport_current/index.html for description of the Transport Current feature. |
Q: |
How can my TAO application obtain endpoint information (e.g., IP address and port for IIOP) of the client during a request invocation? |
A: |
The TransportCurrent(see What is TransportCurrent library used for ?) library provides the IIOP specific interface
(TAO::Transport::IIOP::Current) and implementation. The TAO::Transport::IIOP::Current interface
provides access to the information of the local and remote endpoints.
Here is an example to obtain endpoint information via TAO::Transport::IIOP::Current interface.
// Get the IIOP Current object.
CORBA::Object_var tcobject =
orb->resolve_initial_references (ACE_TEXT_ALWAYS_CHAR
("TAO::Transport::IIOP::Current"));
Transport::IIOP::Current_var tc =
Transport::IIOP::Current::_narrow (tcobject.in ());
if (CORBA::is_nil (tc.in ()))
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("Tester (%P|%t) ERROR: Could not resolve ")
ACE_TEXT ("TAO::Transport::IIOP::Current object.\n")));
throw CORBA::INTERNAL ();
}
// Access the host and the port of the remote endpoint.
::CORBA::String_var rhost (tc->remote_host ());
::CORBA::Long rport = tc->remote_port ();
// |