[Pkg-corba-commits] r9 - in /trunk/omniorb4: ./ debian/ doc/omniORB/ doc/tex/ include/ mk/ src/lib/ src/lib/omnithread/ src/services/ src/services/mklib/ src/tool/

flub-guest at users.alioth.debian.org flub-guest at users.alioth.debian.org
Thu Sep 20 20:19:25 UTC 2007


Author: flub-guest
Date: Thu Sep 20 20:19:25 2007
New Revision: 9

URL: http://svn.debian.org/wsvn/pkg-corba/?sc=1&rev=9
Log:
Upgrade to omniORB 4.1.0.

Added:
    trunk/omniorb4/debian/libcos4-1.install
    trunk/omniorb4/debian/libomniorb4-1.install
    trunk/omniorb4/debian/omniMapper.8
    trunk/omniorb4/debian/omniNames.8
    trunk/omniorb4/debian/omnicpp.1
    trunk/omniorb4/debian/omniidl4.manpages
    trunk/omniorb4/debian/omniorb4-doc.docs
    trunk/omniorb4/debian/omniorb4-doc.examples
    trunk/omniorb4/debian/omniorb4-nameserver.dirs
    trunk/omniorb4/debian/omniorb4-nameserver.manpages
    trunk/omniorb4/debian/omniorb4.manpages
    trunk/omniorb4/include/omnithread.h
    trunk/omniorb4/src/lib/
    trunk/omniorb4/src/lib/omnithread/
    trunk/omniorb4/src/lib/omnithread/posix.cc
    trunk/omniorb4/src/services/
    trunk/omniorb4/src/services/mklib/
    trunk/omniorb4/src/services/mklib/libdefs.mk
Removed:
    trunk/omniorb4/debian/omniorb4.dirs
Modified:
    trunk/omniorb4/configure
    trunk/omniorb4/configure.ac
    trunk/omniorb4/debian/changelog
    trunk/omniorb4/debian/compat
    trunk/omniorb4/debian/control
    trunk/omniorb4/debian/copyright
    trunk/omniorb4/debian/libomniorb4-dev.install
    trunk/omniorb4/debian/libomnithread3c2.install
    trunk/omniorb4/debian/omniidl4.install
    trunk/omniorb4/debian/omniorb4-nameserver.init
    trunk/omniorb4/debian/omniorb4-nameserver.install
    trunk/omniorb4/debian/omniorb4-nameserver.postrm
    trunk/omniorb4/debian/omniorb4.install
    trunk/omniorb4/debian/rules
    trunk/omniorb4/doc/omniORB/omniORB001.html
    trunk/omniorb4/doc/omniORB/omniORB002.html
    trunk/omniorb4/doc/tex/omniNames.tex
    trunk/omniorb4/doc/tex/omniORB.tex
    trunk/omniorb4/include/omniconfig.h.in
    trunk/omniorb4/mk/beforeauto.mk.in
    trunk/omniorb4/sample.cfg
    trunk/omniorb4/src/tool/dir.mk

Modified: trunk/omniorb4/configure
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/configure?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/configure (original)
+++ trunk/omniorb4/configure Thu Sep 20 20:19:25 2007
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for omniORB 4.0.6.
+# Generated by GNU Autoconf 2.59 for omniORB 4.1.0.
 #
 # Report bugs to <bugs at omniorb-support.com>.
 #
@@ -269,11 +269,11 @@
 # Identity of this package.
 PACKAGE_NAME='omniORB'
 PACKAGE_TARNAME='omniorb'
-PACKAGE_VERSION='4.0.6'
-PACKAGE_STRING='omniORB 4.0.6'
+PACKAGE_VERSION='4.1.0'
+PACKAGE_STRING='omniORB 4.1.0'
 PACKAGE_BUGREPORT='bugs at omniorb-support.com'
 
-ac_unique_file="bin/scripts/omkdirhier"
+ac_unique_file="bin/scripts/distdate.py"
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
@@ -311,7 +311,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPP RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE PYTHON PYTHON_VERSION PYTHON_PREFIX PYTHON_EXEC_PREFIX PYTHON_PLATFORM pythondir pkgpythondir pyexecdir pkgpyexecdir PKG_CONFIG EXTRA_GCC_CXXFLAGS OPENSSL_CFLAGS OPENSSL_LIBS OPEN_SSL_ROOT OPEN_SSL_CPPFLAGS OPEN_SSL_LIB CXXCPP EGREP OMNIORB_CONFIG OMNINAMES_LOGDIR ENABLE_STATIC COMPILER_NAME PLATFORM_NAME PLATFORM_DEFINE OSVERSION PROCESSOR_NAME PROCESSOR_DEFINE LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPP RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE PYTHON PYTHON_VERSION PYTHON_PREFIX PYTHON_EXEC_PREFIX PYTHON_PLATFORM pythondir pkgpythondir pyexecdir pkgpyexecdir PKG_CONFIG EXTRA_GCC_CXXFLAGS OPENSSL_CFLAGS OPENSSL_LIBS OPEN_SSL_ROOT OPEN_SSL_CPPFLAGS OPEN_SSL_LIB CXXCPP EGREP ALLOCA OMNIORB_CONFIG OMNINAMES_LOGDIR ENABLE_STATIC COMPILER_NAME PLATFORM_NAME PLATFORM_DEFINE OSVERSION PROCESSOR_NAME PROCESSOR_DEFINE LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -792,7 +792,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures omniORB 4.0.6 to adapt to many kinds of systems.
+\`configure' configures omniORB 4.1.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -853,7 +853,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of omniORB 4.0.6:";;
+     short | recursive ) echo "Configuration of omniORB 4.1.0:";;
    esac
   cat <<\_ACEOF
 
@@ -864,6 +864,9 @@
                           enable-static)
   --enable-thread-tracing enable thread and mutex tracing (default
                           disable-thread-tracing)
+  --disable-ipv6          disable IPv6 support (default enable-ipv6)
+  --disable-alloca        disable use of alloca in omnicpp (default
+                          enable-alloca)
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -985,7 +988,7 @@
 test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
   cat <<\_ACEOF
-omniORB configure 4.0.6
+omniORB configure 4.1.0
 generated by GNU Autoconf 2.59
 
 Copyright (C) 2003 Free Software Foundation, Inc.
@@ -999,7 +1002,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by omniORB $as_me 4.0.6, which was
+It was created by omniORB $as_me 4.1.0, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   $ $0 $@
@@ -3315,81 +3318,6 @@
 
 
 
-echo "$as_me:$LINENO: checking whether $CC accepts -fno-unit-at-a-time" >&5
-echo $ECHO_N "checking whether $CC accepts -fno-unit-at-a-time... $ECHO_C" >&6
-if test "${omni_cv_no_unit_at_a_time+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-    ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-    save_CFLAGS=$CFLAGS
-    CFLAGS="$CFLAGS -fno-unit-at-a-time"
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-	 { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  omni_cv_no_unit_at_a_time="yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-omni_cv_no_unit_at_a_time="no"
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-    CFLAGS=$save_CFLAGS
-    ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
-fi
-echo "$as_me:$LINENO: result: $omni_cv_no_unit_at_a_time" >&5
-echo "${ECHO_T}$omni_cv_no_unit_at_a_time" >&6
-if test "x$omni_cv_no_unit_at_a_time" = "xyes"
-then
-  EXTRA_GCC_CXXFLAGS="-fno-unit-at-a-time"
-fi
-
 
 
 echo "$as_me:$LINENO: checking for OpenSSL root" >&5
@@ -4364,7 +4292,8 @@
 done
 
 
-for ac_header in ifaddrs.h
+
+for ac_header in sys/poll.h ifaddrs.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -9782,6 +9711,212 @@
 
 
 
+echo "$as_me:$LINENO: checking for struct sockaddr_in6" >&5
+echo $ECHO_N "checking for struct sockaddr_in6... $ECHO_C" >&6
+if test "${ac_cv_type_struct_sockaddr_in6+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <netinet/in.h>
+
+int
+main ()
+{
+if ((struct sockaddr_in6 *) 0)
+  return 0;
+if (sizeof (struct sockaddr_in6))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_struct_sockaddr_in6=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_struct_sockaddr_in6=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockaddr_in6" >&5
+echo "${ECHO_T}$ac_cv_type_struct_sockaddr_in6" >&6
+if test $ac_cv_type_struct_sockaddr_in6 = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_IN6 1
+_ACEOF
+
+
+fi
+echo "$as_me:$LINENO: checking for struct sockaddr_storage" >&5
+echo $ECHO_N "checking for struct sockaddr_storage... $ECHO_C" >&6
+if test "${ac_cv_type_struct_sockaddr_storage+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <netinet/in.h>
+
+int
+main ()
+{
+if ((struct sockaddr_storage *) 0)
+  return 0;
+if (sizeof (struct sockaddr_storage))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_struct_sockaddr_storage=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_struct_sockaddr_storage=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockaddr_storage" >&5
+echo "${ECHO_T}$ac_cv_type_struct_sockaddr_storage" >&6
+if test $ac_cv_type_struct_sockaddr_storage = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKADDR_STORAGE 1
+_ACEOF
+
+
+fi
+echo "$as_me:$LINENO: checking for struct lifconf" >&5
+echo $ECHO_N "checking for struct lifconf... $ECHO_C" >&6
+if test "${ac_cv_type_struct_lifconf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <netinet/in.h>
+
+int
+main ()
+{
+if ((struct lifconf *) 0)
+  return 0;
+if (sizeof (struct lifconf))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_struct_lifconf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_struct_lifconf=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_struct_lifconf" >&5
+echo "${ECHO_T}$ac_cv_type_struct_lifconf" >&6
+if test $ac_cv_type_struct_lifconf = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_LIFCONF 1
+_ACEOF
+
+
+fi
+
+
 echo "$as_me:$LINENO: checking for struct sockaddr_in.sin_len" >&5
 echo $ECHO_N "checking for struct sockaddr_in.sin_len... $ECHO_C" >&6
 if test "${ac_cv_member_struct_sockaddr_in_sin_len+set}" = set; then
@@ -10822,9 +10957,9 @@
 
 fi
 
-echo "$as_me:$LINENO: checking whether long is the same type as int" >&5
-echo $ECHO_N "checking whether long is the same type as int... $ECHO_C" >&6
-if test "${omni_cv_cxx_long_is_int+set}" = set; then
+echo "$as_me:$LINENO: checking whether the compiler supports covariant return types" >&5
+echo $ECHO_N "checking whether the compiler supports covariant return types... $ECHO_C" >&6
+if test "${omni_cv_cxx_covariant_returns+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_ext=cc
@@ -10840,13 +10975,21 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-int f(int  x){return 1;}
-int f(long x){return 1;}
+class A {};
+class B : public virtual A {};
+class C {
+public:
+  virtual A* test();
+};
+class D : public virtual C {
+public:
+  virtual B* test();
+};
 
 int
 main ()
 {
-long l = 5; return f(l);
+D d;
   ;
   return 0;
 }
@@ -10873,12 +11016,12 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  omni_cv_cxx_long_is_int=no
+  omni_cv_cxx_covariant_returns=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-omni_cv_cxx_long_is_int=yes
+omni_cv_cxx_covariant_returns=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
  ac_ext=cc
@@ -10889,6 +11032,83 @@
 
 
 fi
+echo "$as_me:$LINENO: result: $omni_cv_cxx_covariant_returns" >&5
+echo "${ECHO_T}$omni_cv_cxx_covariant_returns" >&6
+if test "$omni_cv_cxx_covariant_returns" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define OMNI_HAVE_COVARIANT_RETURNS
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking whether long is the same type as int" >&5
+echo $ECHO_N "checking whether long is the same type as int... $ECHO_C" >&6
+if test "${omni_cv_cxx_long_is_int+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int f(int  x){return 1;}
+int f(long x){return 1;}
+
+int
+main ()
+{
+long l = 5; return f(l);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  omni_cv_cxx_long_is_int=no
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+omni_cv_cxx_long_is_int=yes
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+fi
 echo "$as_me:$LINENO: result: $omni_cv_cxx_long_is_int" >&5
 echo "${ECHO_T}$omni_cv_cxx_long_is_int" >&6
 if test "$omni_cv_cxx_long_is_int" = yes; then
@@ -10907,6 +11127,7 @@
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
 
 
 
@@ -11016,12 +11237,7 @@
 
 
 
-
-
-
-
-
-for ac_func in isinf insinff isinfl nanosleep sigaction sigvec snprintf
+for ac_func in getnameinfo inet_ntop
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -11128,7 +11344,8 @@
 
 
 
-for ac_func in strcasecmp strdup strerror stricmp strncasecmp strtoul
+
+for ac_func in isinf insinff isinfl localtime nanosleep poll sigaction
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -11234,7 +11451,9 @@
 
 
 
-for ac_func in strtoull strtouq uname vprintf vsnprintf
+
+
+for ac_func in sigvec snprintf strcasecmp strdup strerror strftime stricmp
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -11335,6 +11554,474 @@
 fi
 done
 
+
+
+
+
+
+
+
+for ac_func in strncasecmp strtoul strtoull strtouq uname vprintf vsnprintf
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments.  Useless!
+echo "$as_me:$LINENO: checking for working alloca.h" >&5
+echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6
+if test "${ac_cv_working_alloca_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <alloca.h>
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_working_alloca_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_working_alloca_h=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
+echo "${ECHO_T}$ac_cv_working_alloca_h" >&6
+if test $ac_cv_working_alloca_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALLOCA_H 1
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking for alloca" >&5
+echo $ECHO_N "checking for alloca... $ECHO_C" >&6
+if test "${ac_cv_func_alloca_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+#  include <malloc.h>
+#  define alloca _alloca
+# else
+#  if HAVE_ALLOCA_H
+#   include <alloca.h>
+#  else
+#   ifdef _AIX
+ #pragma alloca
+#   else
+#    ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+#    endif
+#   endif
+#  endif
+# endif
+#endif
+
+int
+main ()
+{
+char *p = (char *) alloca (1);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_alloca_works=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_alloca_works=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
+echo "${ECHO_T}$ac_cv_func_alloca_works" >&6
+
+if test $ac_cv_func_alloca_works = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALLOCA 1
+_ACEOF
+
+else
+  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble.  Some versions do not even contain alloca or
+# contain a buggy version.  If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+
+ALLOCA=alloca.$ac_objext
+
+cat >>confdefs.h <<\_ACEOF
+#define C_ALLOCA 1
+_ACEOF
+
+
+echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
+echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6
+if test "${ac_cv_os_cray+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#if defined(CRAY) && ! defined(CRAY2)
+webecray
+#else
+wenotbecray
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "webecray" >/dev/null 2>&1; then
+  ac_cv_os_cray=yes
+else
+  ac_cv_os_cray=no
+fi
+rm -f conftest*
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
+echo "${ECHO_T}$ac_cv_os_cray" >&6
+if test $ac_cv_os_cray = yes; then
+  for ac_func in _getb67 GETB67 getb67; do
+    as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define CRAY_STACKSEG_END $ac_func
+_ACEOF
+
+    break
+fi
+
+  done
+fi
+
+echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
+echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6
+if test "${ac_cv_c_stack_direction+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_c_stack_direction=0
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+int
+find_stack_direction ()
+{
+  static char *addr = 0;
+  auto char dummy;
+  if (addr == 0)
+    {
+      addr = &dummy;
+      return find_stack_direction ();
+    }
+  else
+    return (&dummy > addr) ? 1 : -1;
+}
+
+int
+main ()
+{
+  exit (find_stack_direction () < 0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_stack_direction=1
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_c_stack_direction=-1
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
+echo "${ECHO_T}$ac_cv_c_stack_direction" >&6
+
+cat >>confdefs.h <<_ACEOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+_ACEOF
+
+
+fi
+
 ac_ext=cc
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -11808,6 +12495,54 @@
 
 cat >>confdefs.h <<\_ACEOF
 #define OMNIORB_ENABLE_LOCK_TRACES
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking whether to support IPv6" >&5
+echo $ECHO_N "checking whether to support IPv6... $ECHO_C" >&6
+if test "${omni_cv_enable_ipv6+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Check whether --enable-ipv6 or --disable-ipv6 was given.
+if test "${enable_ipv6+set}" = set; then
+  enableval="$enable_ipv6"
+  omni_cv_enable_ipv6=$enableval
+else
+  omni_cv_enable_ipv6=yes
+fi;
+
+fi
+echo "$as_me:$LINENO: result: $omni_cv_enable_ipv6" >&5
+echo "${ECHO_T}$omni_cv_enable_ipv6" >&6
+if test "$omni_cv_enable_ipv6" = "no"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define OMNI_DISABLE_IPV6
+_ACEOF
+
+fi
+
+echo "$as_me:$LINENO: checking whether alloca should be used in omnicpp" >&5
+echo $ECHO_N "checking whether alloca should be used in omnicpp... $ECHO_C" >&6
+if test "${omni_cv_enable_alloca+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Check whether --enable-alloca or --disable-alloca was given.
+if test "${enable_alloca+set}" = set; then
+  enableval="$enable_alloca"
+  omni_cv_enable_alloca=$enableval
+else
+  omni_cv_enable_alloca=yes
+fi;
+
+fi
+echo "$as_me:$LINENO: result: $omni_cv_enable_alloca" >&5
+echo "${ECHO_T}$omni_cv_enable_alloca" >&6
+if test "$omni_cv_enable_alloca" = "no"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define OMNIORB_DISABLE_ALLOCA
 _ACEOF
 
 fi
@@ -11857,7 +12592,7 @@
 
 case "$host" in
   *-*-linux-*)   plat_name="Linux";    plat_def="__linux__";    os_v="2";;
-  *-*-cygwin*)   plat_name="Cygwin";   plat_def="__linux__";    os_v="2";;
+  *-*-cygwin*)   plat_name="Cygwin";   plat_def="__cygwin__";   os_v="1";;
   *-*-solaris*)  plat_name="SunOS";    plat_def="__sunos__";    os_v="5";;
   *-*-osf3*)     plat_name="OSF1";     plat_def="__osf1__";     os_v="3";;
   *-*-osf4*)     plat_name="OSF1";     plat_def="__osf1__";     os_v="4";;
@@ -11872,6 +12607,10 @@
   *-*-freebsd3*) plat_name="FreeBSD";  plat_def="__freebsd__";  os_v="3";;
   *-*-freebsd4*) plat_name="FreeBSD";  plat_def="__freebsd__";  os_v="4";;
   *-*-freebsd5*) plat_name="FreeBSD";  plat_def="__freebsd__";  os_v="5";;
+  *-*-freebsd6*) plat_name="FreeBSD";  plat_def="__freebsd__";  os_v="6";;
+  *-*-freebsd7*) plat_name="FreeBSD";  plat_def="__freebsd__";  os_v="7";;
+  *-*-kfreebsd5*) plat_name="kFreeBSD";  plat_def="__FreeBSD_kernel__";  os_v="5";;
+  *-*-kfreebsd6*) plat_name="kFreeBSD";  plat_def="__FreeBSD_kernel__";  os_v="6";;
   *-*-netbsd*)   plat_name="NetBSD";   plat_def="__netbsd__";   os_v="1";;
   *-*-openbsd*)  plat_name="OpenBSD";  plat_def="__openbsd__";  os_v="3";;
   *-*-sco*)      plat_name="OSR5";     plat_def="__osr5__";     os_v="5";;
@@ -11912,7 +12651,7 @@
 
           ac_config_files="$ac_config_files src/tool/omniidl/python/scripts/omniidl"
 
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ac_config_files="$ac_config_files src/appl/GNUmakefile src/appl/omniMapper/GNUmakefile src/appl/omniNames/GNUmakefile src/appl/utils/catior/GNUmakefile src/appl/utils/convertior/GNUmakefile src/appl/utils/GNUmakefile src/appl/utils/genior/GNUmakefile src/appl/utils/nameclt/GNUmakefile src/GNUmakefile src/examples/anyExample/GNUmakefile src/examples/bidir/GNUmakefile src/examples/boa/GNUmakefile src/examples/call_back/GNUmakefile src/examples/dii/GNUmakefile src/examples/GNUmakefile src/examples/dsi/GNUmakefile src/examples/echo/GNUmakefile src/examples/partcl/GNUmakefile src/examples/poa/GNUmakefile src/examples/poa/implicit_activation/GNUmakefile src/examples/poa/persistent_objref/GNUmakefile src/examples/poa/servant_manager/GNUmakefile src/examples/poa/threading/GNUmakefile src/examples/ssl_echo/GNUmakefile src/examples/thread/GNUmakefile src/lib/GNUmakefile src/lib/omniORB/codesets/GNUmakefile src/lib/omniORB/GNUmakefile src/lib/omniORB/dynamic/GNUmakefile src/lib/omniORB/omniidl_be/cxx/GNUmakefile src/lib/omniORB/omniidl_be/cxx/dynskel/GNUmakefile src/lib/omniORB/omniidl_be/cxx/header/GNUmakefile src/lib/omniORB/omniidl_be/cxx/impl/GNUmakefile src/lib/omniORB/omniidl_be/cxx/skel/GNUmakefile src/lib/omniORB/omniidl_be/GNUmakefile src/lib/omniORB/orbcore/GNUmakefile src/lib/omniORB/orbcore/ssl/GNUmakefile src/lib/omnithread/GNUmakefile src/services/GNUmakefile src/services/mklib/GNUmakefile src/services/mklib/mkBOAlib/GNUmakefile src/tool/GNUmakefile src/tool/omkdepend/GNUmakefile src/tool/omniidl/cxx/cccp/GNUmakefile src/tool/omniidl/cxx/GNUmakefile src/tool/omniidl/GNUmakefile src/tool/omniidl/python/GNUmakefile src/tool/omniidl/python/omniidl_be/GNUmakefile src/tool/omniidl/python/omniidl/GNUmakefile src/tool/omniidl/python/scripts/GNUmakefile"
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ac_config_files="$ac_config_files src/appl/GNUmakefile src/appl/omniMapper/GNUmakefile src/appl/omniNames/GNUmakefile src/appl/utils/catior/GNUmakefile src/appl/utils/convertior/GNUmakefile src/appl/utils/GNUmakefile src/appl/utils/genior/GNUmakefile src/appl/utils/nameclt/GNUmakefile src/GNUmakefile src/examples/anyExample/GNUmakefile src/examples/bidir/GNUmakefile src/examples/boa/GNUmakefile src/examples/call_back/GNUmakefile src/examples/dii/GNUmakefile src/examples/GNUmakefile src/examples/dsi/GNUmakefile src/examples/echo/GNUmakefile src/examples/poa/GNUmakefile src/examples/poa/implicit_activation/GNUmakefile src/examples/poa/persistent_objref/GNUmakefile src/examples/poa/servant_manager/GNUmakefile src/examples/poa/threading/GNUmakefile src/examples/ssl_echo/GNUmakefile src/examples/thread/GNUmakefile src/examples/valuetype/GNUmakefile src/examples/valuetype/simple/GNUmakefile src/lib/GNUmakefile src/lib/omniORB/codesets/GNUmakefile src/lib/omniORB/GNUmakefile src/lib/omniORB/dynamic/GNUmakefile src/lib/omniORB/omniidl_be/cxx/GNUmakefile src/lib/omniORB/omniidl_be/cxx/dynskel/GNUmakefile src/lib/omniORB/omniidl_be/cxx/header/GNUmakefile src/lib/omniORB/omniidl_be/cxx/impl/GNUmakefile src/lib/omniORB/omniidl_be/cxx/skel/GNUmakefile src/lib/omniORB/omniidl_be/GNUmakefile src/lib/omniORB/orbcore/GNUmakefile src/lib/omniORB/orbcore/ssl/GNUmakefile src/lib/omniORB/connections/GNUmakefile src/lib/omnithread/GNUmakefile src/services/GNUmakefile src/services/mklib/GNUmakefile src/services/mklib/mkBOAlib/GNUmakefile src/tool/GNUmakefile src/tool/omkdepend/GNUmakefile src/tool/omniidl/cxx/cccp/GNUmakefile src/tool/omniidl/cxx/GNUmakefile src/tool/omniidl/GNUmakefile src/tool/omniidl/python/GNUmakefile src/tool/omniidl/python/omniidl_be/GNUmakefile src/tool/omniidl/python/omniidl/GNUmakefile src/tool/omniidl/python/scripts/GNUmakefile"
 
 
                                                   ac_config_files="$ac_config_files include/GNUmakefile include/omniconfig.h include/omnithread/GNUmakefile include/omniORB4/GNUmakefile include/omniORB4/internal/GNUmakefile"
@@ -11927,7 +12666,7 @@
                     ac_config_files="$ac_config_files contrib/GNUmakefile contrib/pkgconfig/GNUmakefile"
 
 
-                                                  ac_config_files="$ac_config_files contrib/pkgconfig/omnithread3.pc contrib/pkgconfig/omniORB4.pc contrib/pkgconfig/omniDynamic4.pc contrib/pkgconfig/omniCOS4.pc contrib/pkgconfig/omniCOSDynamic4.pc"
+                                                            ac_config_files="$ac_config_files contrib/pkgconfig/omnithread3.pc contrib/pkgconfig/omniORB4.pc contrib/pkgconfig/omniDynamic4.pc contrib/pkgconfig/omniCOS4.pc contrib/pkgconfig/omniCOSDynamic4.pc contrib/pkgconfig/omniConnectionMgmt4.pc"
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -12290,7 +13029,7 @@
 } >&5
 cat >&5 <<_CSEOF
 
-This file was extended by omniORB $as_me 4.0.6, which was
+This file was extended by omniORB $as_me 4.1.0, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -12350,7 +13089,7 @@
 
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-omniORB config.status 4.0.6
+omniORB config.status 4.1.0
 configured by $0, generated by GNU Autoconf 2.59,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
@@ -12474,7 +13213,6 @@
   "src/examples/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/examples/GNUmakefile" ;;
   "src/examples/dsi/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/examples/dsi/GNUmakefile" ;;
   "src/examples/echo/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/examples/echo/GNUmakefile" ;;
-  "src/examples/partcl/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/examples/partcl/GNUmakefile" ;;
   "src/examples/poa/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/examples/poa/GNUmakefile" ;;
   "src/examples/poa/implicit_activation/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/examples/poa/implicit_activation/GNUmakefile" ;;
   "src/examples/poa/persistent_objref/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/examples/poa/persistent_objref/GNUmakefile" ;;
@@ -12482,6 +13220,8 @@
   "src/examples/poa/threading/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/examples/poa/threading/GNUmakefile" ;;
   "src/examples/ssl_echo/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/examples/ssl_echo/GNUmakefile" ;;
   "src/examples/thread/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/examples/thread/GNUmakefile" ;;
+  "src/examples/valuetype/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/examples/valuetype/GNUmakefile" ;;
+  "src/examples/valuetype/simple/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/examples/valuetype/simple/GNUmakefile" ;;
   "src/lib/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/GNUmakefile" ;;
   "src/lib/omniORB/codesets/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/codesets/GNUmakefile" ;;
   "src/lib/omniORB/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/GNUmakefile" ;;
@@ -12494,6 +13234,7 @@
   "src/lib/omniORB/omniidl_be/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/omniidl_be/GNUmakefile" ;;
   "src/lib/omniORB/orbcore/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/orbcore/GNUmakefile" ;;
   "src/lib/omniORB/orbcore/ssl/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/orbcore/ssl/GNUmakefile" ;;
+  "src/lib/omniORB/connections/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/omniORB/connections/GNUmakefile" ;;
   "src/lib/omnithread/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/lib/omnithread/GNUmakefile" ;;
   "src/services/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/services/GNUmakefile" ;;
   "src/services/mklib/GNUmakefile" ) CONFIG_FILES="$CONFIG_FILES src/services/mklib/GNUmakefile" ;;
@@ -12522,6 +13263,7 @@
   "contrib/pkgconfig/omniDynamic4.pc" ) CONFIG_FILES="$CONFIG_FILES contrib/pkgconfig/omniDynamic4.pc" ;;
   "contrib/pkgconfig/omniCOS4.pc" ) CONFIG_FILES="$CONFIG_FILES contrib/pkgconfig/omniCOS4.pc" ;;
   "contrib/pkgconfig/omniCOSDynamic4.pc" ) CONFIG_FILES="$CONFIG_FILES contrib/pkgconfig/omniCOSDynamic4.pc" ;;
+  "contrib/pkgconfig/omniConnectionMgmt4.pc" ) CONFIG_FILES="$CONFIG_FILES contrib/pkgconfig/omniConnectionMgmt4.pc" ;;
   "include/omniORB4/acconfig.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/omniORB4/acconfig.h" ;;
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
@@ -12650,6 +13392,7 @@
 s, at OPEN_SSL_LIB@,$OPEN_SSL_LIB,;t t
 s, at CXXCPP@,$CXXCPP,;t t
 s, at EGREP@,$EGREP,;t t
+s, at ALLOCA@,$ALLOCA,;t t
 s, at OMNIORB_CONFIG@,$OMNIORB_CONFIG,;t t
 s, at OMNINAMES_LOGDIR@,$OMNINAMES_LOGDIR,;t t
 s, at ENABLE_STATIC@,$ENABLE_STATIC,;t t

Modified: trunk/omniorb4/configure.ac
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/configure.ac?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/configure.ac (original)
+++ trunk/omniorb4/configure.ac Thu Sep 20 20:19:25 2007
@@ -1,8 +1,8 @@
 dnl -*- M4 -*-
-AC_INIT(omniORB, 4.0.6, bugs at omniorb-support.com)
+AC_INIT(omniORB, 4.1.0, bugs at omniorb-support.com)
 
 AC_PREREQ(2.52)
-AC_CONFIG_SRCDIR(bin/scripts/omkdirhier)
+AC_CONFIG_SRCDIR(bin/scripts/distdate.py)
 AC_CONFIG_AUX_DIR(bin/scripts)
 
 AC_CANONICAL_BUILD
@@ -26,11 +26,11 @@
 
 AC_LANG(C++)
 
-OMNI_CHECK_NO_UNIT_AT_A_TIME
-if test "x$omni_cv_no_unit_at_a_time" = "xyes"
-then
-  EXTRA_GCC_CXXFLAGS="-fno-unit-at-a-time"
-fi
+dnl OMNI_CHECK_NO_UNIT_AT_A_TIME
+dnl if test "x$omni_cv_no_unit_at_a_time" = "xyes"
+dnl then
+dnl   EXTRA_GCC_CXXFLAGS="-fno-unit-at-a-time"
+dnl fi
 AC_SUBST(EXTRA_GCC_CXXFLAGS)
 
 dnl ** Libraries
@@ -42,7 +42,7 @@
 
 AC_CHECK_HEADERS(errno.h fcntl.h netdb.h signal.h stdlib.h string.h strings.h)
 AC_CHECK_HEADERS(unistd.h nan.h sys/if.h sys/ioctl.h sys/param.h sys/time.h)
-AC_CHECK_HEADERS(ifaddrs.h)
+AC_CHECK_HEADERS(sys/poll.h ifaddrs.h)
 AC_HEADER_TIME
 
 
@@ -63,7 +63,13 @@
 AC_CHECK_SIZEOF(void*, 4)
 
 
-dnl ** Struct members
+dnl ** Structs and members
+
+AC_CHECK_TYPES([struct sockaddr_in6, struct sockaddr_storage, struct lifconf],,,
+[#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <netinet/in.h>])
 
 AC_CHECK_MEMBERS([struct sockaddr_in.sin_len, struct sockaddr_in.sin_zero],,,
 [#include <sys/types.h>
@@ -83,6 +89,7 @@
 
 OMNI_CXX_CATCH_BY_BASE
 OMNI_CXX_NEED_FQ_BASE_CTOR
+OMNI_CXX_COVARIANT_RETURNS
 OMNI_CXX_LONG_IS_INT
 
 
@@ -90,9 +97,11 @@
 
 AC_LANG(C)
 AC_CHECK_FUNCS(getaddrinfo gethostname getopt getpid gettimeofday)
-AC_CHECK_FUNCS(isinf insinff isinfl nanosleep sigaction sigvec snprintf)
-AC_CHECK_FUNCS(strcasecmp strdup strerror stricmp strncasecmp strtoul)
-AC_CHECK_FUNCS(strtoull strtouq uname vprintf vsnprintf)
+AC_CHECK_FUNCS(getnameinfo inet_ntop)
+AC_CHECK_FUNCS(isinf insinff isinfl localtime nanosleep poll sigaction)
+AC_CHECK_FUNCS(sigvec snprintf strcasecmp strdup strerror strftime stricmp)
+AC_CHECK_FUNCS(strncasecmp strtoul strtoull strtouq uname vprintf vsnprintf)
+AC_FUNC_ALLOCA
 AC_LANG(C++)
 
 OMNI_HAVE_ISNANORINF
@@ -107,6 +116,8 @@
 OMNI_OMNINAMES_LOGDIR
 OMNI_DISABLE_STATIC
 OMNI_DISABLE_THREAD_TRACING
+OMNI_DISABLE_IPV6_CHECK
+OMNI_DISABLE_ALLOCA
 
 
 dnl ** Compiler name
@@ -153,7 +164,7 @@
 
 case "$host" in
   *-*-linux-*)   plat_name="Linux";    plat_def="__linux__";    os_v="2";;
-  *-*-cygwin*)   plat_name="Cygwin";   plat_def="__linux__";    os_v="2";;
+  *-*-cygwin*)   plat_name="Cygwin";   plat_def="__cygwin__";   os_v="1";;
   *-*-solaris*)  plat_name="SunOS";    plat_def="__sunos__";    os_v="5";;
   *-*-osf3*)     plat_name="OSF1";     plat_def="__osf1__";     os_v="3";;
   *-*-osf4*)     plat_name="OSF1";     plat_def="__osf1__";     os_v="4";;
@@ -168,6 +179,10 @@
   *-*-freebsd3*) plat_name="FreeBSD";  plat_def="__freebsd__";  os_v="3";;
   *-*-freebsd4*) plat_name="FreeBSD";  plat_def="__freebsd__";  os_v="4";;
   *-*-freebsd5*) plat_name="FreeBSD";  plat_def="__freebsd__";  os_v="5";;
+  *-*-freebsd6*) plat_name="FreeBSD";  plat_def="__freebsd__";  os_v="6";;
+  *-*-freebsd7*) plat_name="FreeBSD";  plat_def="__freebsd__";  os_v="7";;
+  *-*-kfreebsd5*) plat_name="kFreeBSD";  plat_def="__FreeBSD_kernel__";  os_v="5";;
+  *-*-kfreebsd6*) plat_name="kFreeBSD";  plat_def="__FreeBSD_kernel__";  os_v="6";;
   *-*-netbsd*)   plat_name="NetBSD";   plat_def="__netbsd__";   os_v="1";;
   *-*-openbsd*)  plat_name="OpenBSD";  plat_def="__openbsd__";  os_v="3";;
   *-*-sco*)      plat_name="OSR5";     plat_def="__osr5__";     os_v="5";;
@@ -220,7 +235,6 @@
                 src/examples/GNUmakefile
                 src/examples/dsi/GNUmakefile
                 src/examples/echo/GNUmakefile
-                src/examples/partcl/GNUmakefile
                 src/examples/poa/GNUmakefile
                 src/examples/poa/implicit_activation/GNUmakefile
                 src/examples/poa/persistent_objref/GNUmakefile
@@ -228,6 +242,8 @@
                 src/examples/poa/threading/GNUmakefile
                 src/examples/ssl_echo/GNUmakefile
                 src/examples/thread/GNUmakefile
+                src/examples/valuetype/GNUmakefile
+                src/examples/valuetype/simple/GNUmakefile
                 src/lib/GNUmakefile
                 src/lib/omniORB/codesets/GNUmakefile
                 src/lib/omniORB/GNUmakefile
@@ -240,6 +256,7 @@
                 src/lib/omniORB/omniidl_be/GNUmakefile
                 src/lib/omniORB/orbcore/GNUmakefile
                 src/lib/omniORB/orbcore/ssl/GNUmakefile
+                src/lib/omniORB/connections/GNUmakefile
                 src/lib/omnithread/GNUmakefile
                 src/services/GNUmakefile
                 src/services/mklib/GNUmakefile
@@ -275,4 +292,5 @@
 contrib/pkgconfig/omniDynamic4.pc
 contrib/pkgconfig/omniCOS4.pc
 contrib/pkgconfig/omniCOSDynamic4.pc
+contrib/pkgconfig/omniConnectionMgmt4.pc
 ])

Modified: trunk/omniorb4/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/changelog?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/debian/changelog (original)
+++ trunk/omniorb4/debian/changelog Thu Sep 20 20:19:25 2007
@@ -1,3 +1,16 @@
+omniorb4 (4.1.0-1) unstable; urgency=low
+
+  * New upstream release (Closes: #398462).
+  * Patch for kfreebsd (Closes: #341089).
+  * Include examples (Closes: #197061).
+  * Change presistent data direcotry of omniNames (Closes: #282811).
+  * Enable all COS stubs to be build (Closes: #107107).
+  * Removed omniidl4.prerm as pycentral does that job now.
+  * Replace ${Source-Version} by ${binary:Version} in debian/control.
+  * Remove the #! line from omniidl's main.py in site-packages.
+
+ -- Floris Bruynooghe <floris.bruynooghe at gmail.com>  Thu, 20 Sep 2007 20:09:05 +0100
+
 omniorb4 (4.0.6-2.3) unstable; urgency=low
 
   * Non-maintainer upload.

Modified: trunk/omniorb4/debian/compat
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/compat?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/debian/compat (original)
+++ trunk/omniorb4/debian/compat Thu Sep 20 20:19:25 2007
@@ -1,1 +1,1 @@
-4
+5

Modified: trunk/omniorb4/debian/control
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/control?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/debian/control (original)
+++ trunk/omniorb4/debian/control Thu Sep 20 20:19:25 2007
@@ -1,15 +1,15 @@
 Source: omniorb4
 Section: devel
 Priority: optional
-Maintainer: Bastian Blank <waldi at debian.org>
-Build-Depends: debhelper (>= 4.1.67), python-dev, libssl-dev, autotools-dev, python-central (>= 0.5.6)
+Maintainer: Debian CORBA Team <pkg-corba-devel at lists.alioth.debian.org>
+Uploaders: Floris Bruynooghe <floris.bruynooghe at gmail.com>
+Build-Depends: debhelper (>= 5.0.38), python-dev, libssl-dev, autotools-dev, python-central (>= 0.5.6)
 XS-Python-Version: current
 Standards-Version: 3.7.2
 
 Package: omniorb4
 Architecture: any
 Depends: ${shlibs:Depends}
-Conflicts: omniorb
 Description:  omniORB4 - CORBA ORB - programs
  omniORB is a freely available Common Object Request Broker
  Architecture (CORBA) 2.6 compliant object request broker (ORB)
@@ -19,7 +19,6 @@
 
 Package: omniorb4-idl
 Architecture: all
-Conflicts: omniorb-idl
 Description:  omniORB4 - CORBA ORB - idl files
  omniORB is a freely available Common Object Request Broker
  Architecture (CORBA) 2.6 compliant object request broker (ORB)
@@ -32,8 +31,6 @@
 Package: omniorb4-nameserver
 Architecture: any
 Depends: ${shlibs:Depends}
-Provides: omniorb-nameserver
-Conflicts: omniorb-nameserver
 Description:  omniORB4 - CORBA ORB - nameserver
  omniORB is a freely available Common Object Request Broker
  Architecture (CORBA) 2.6 compliant object request broker (ORB)
@@ -55,12 +52,10 @@
  .
  This includes the documentation.
 
-Package: libcos4c2
+Package: libcos4-1
 Architecture: any
 Section: libs
 Depends: ${shlibs:Depends}
-Conflicts: libcos4
-Replaces: libcos4
 Description: omniORB4 - CORBA ORB - libcos4
  omniORB4 is a freely available Common Object Request Broker
  Architecture (CORBA) 2.6 compliant object request broker (ORB)
@@ -73,7 +68,7 @@
 Package: libcos4-dev
 Architecture: any
 Section: libdevel
-Depends: libcos4c2 (= ${Source-Version}), libomniorb4-dev (= ${Source-Version}), pkg-config
+Depends: libcos4-1 (= ${binary:Version}), libomniorb4-dev (= ${binary:Version}), pkg-config
 Description: omniORB4 - CORBA ORB - libcos4 - developer files
  omniORB4 is a freely available Common Object Request Broker
  Architecture (CORBA) 2.6 compliant object request broker (ORB)
@@ -83,12 +78,10 @@
  .
  This includes developer files for libcos4 and libcosdynamic4.
 
-Package: libomniorb4c2
+Package: libomniorb4-1
 Architecture: any
 Section: libs
 Depends: ${shlibs:Depends}
-Conflicts: libomniorb4
-Provides: libomniorb4
 Description: omniORB4 - CORBA ORB - libomniorb4
  omniORB4 is a freely available Common Object Request Broker
  Architecture (CORBA) 2.6 compliant object request broker (ORB)
@@ -102,7 +95,7 @@
 Package: libomniorb4-dev
 Architecture: any
 Section: libdevel
-Depends: libomniorb4c2 (= ${Source-Version}), libomnithread3-dev (= ${Source-Version}), libssl-dev, pkg-config
+Depends: libomniorb4-1 (= ${binary:Version}), libomnithread3-dev (= ${binary:Version}), libssl-dev, pkg-config
 Description: omniORB4 - CORBA ORB - developer files
  omniORB4 is a freely available Common Object Request Broker
  Architecture (CORBA) 2.6 compliant object request broker (ORB)
@@ -117,8 +110,6 @@
 Architecture: any
 Section: libs
 Depends: ${shlibs:Depends}
-Conflicts: libomnithread3
-Provides: libomnithread3
 Description: omniORB4 - CORBA ORB - libomnithread3
  omniORB4 is a freely available Common Object Request Broker
  Architecture (CORBA) 2.6 compliant object request broker (ORB)
@@ -131,7 +122,7 @@
 Package: libomnithread3-dev
 Architecture: any
 Section: libdevel
-Depends: libomnithread3c2 (= ${Source-Version}), pkg-config
+Depends: libomnithread3c2 (= ${binary:Version}), pkg-config
 Description: omniORB4 - CORBA ORB - developer files
  omniORB4 is a freely available Common Object Request Broker
  Architecture (CORBA) 2.6 compliant object request broker (ORB)
@@ -146,7 +137,6 @@
 Depends: ${shlibs:Depends}, ${python:Depends}
 XB-Python-Version: ${python:Versions}
 Recommends: omniidl4-python
-Conflicts: omniidl
 Description: omniORB4 - idl compiler
  omniORB4 is a freely available Common Object Request Broker
  Architecture (CORBA) 2.6 compliant object request broker (ORB)

Modified: trunk/omniorb4/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/copyright?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/debian/copyright (original)
+++ trunk/omniorb4/debian/copyright Thu Sep 20 20:19:25 2007
@@ -1,8 +1,15 @@
-This is the debian package for OmniORB.
+This package was debianized by Bastian Blank <waldi at debian.org> on
+Wed, 27 Mar 2002 17:29:02 +0100
 
 It was downloaded from http://omniorb.sf.net/.
 
-Copyright:
+Upstrea Author: Duncan Grisby <duncan at grisby.org>
+
+Copyright: Copyright (C) 1999, 2000, 2001 AT&T Laboratories Cambride
+           Copyright (C) 2002 Duncan Grisby
+           Copyright (C) 2002, 2003 Apasphere Ltd.
+
+License:
 
     This package is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public

Added: trunk/omniorb4/debian/libcos4-1.install
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/libcos4-1.install?rev=9&op=file
==============================================================================
--- trunk/omniorb4/debian/libcos4-1.install (added)
+++ trunk/omniorb4/debian/libcos4-1.install Thu Sep 20 20:19:25 2007
@@ -1,0 +1,2 @@
+usr/lib/libCOS4.so.*
+usr/lib/libCOSDynamic4.so.*

Added: trunk/omniorb4/debian/libomniorb4-1.install
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/libomniorb4-1.install?rev=9&op=file
==============================================================================
--- trunk/omniorb4/debian/libomniorb4-1.install (added)
+++ trunk/omniorb4/debian/libomniorb4-1.install Thu Sep 20 20:19:25 2007
@@ -1,0 +1,4 @@
+usr/lib/libomniCodeSets4.so.*
+usr/lib/libomniDynamic4.so.*
+usr/lib/libomniORB4.so.*
+usr/lib/libomnisslTP4.so.*

Modified: trunk/omniorb4/debian/libomniorb4-dev.install
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/libomniorb4-dev.install?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/debian/libomniorb4-dev.install (original)
+++ trunk/omniorb4/debian/libomniorb4-dev.install Thu Sep 20 20:19:25 2007
@@ -1,11 +1,14 @@
 usr/lib/libomniCodeSets4.a
 usr/lib/libomniCodeSets4.so
+usr/lib/libomniConnectionMgmt4.a
+usr/lib/libomniConnectionMgmt4.so
 usr/lib/libomniDynamic4.a
 usr/lib/libomniDynamic4.so
 usr/lib/libomniORB4.a
 usr/lib/libomniORB4.so
-usr/lib/libomnisslTP.a
-usr/lib/libomnisslTP.so
+usr/lib/libomnisslTP4.a
+usr/lib/libomnisslTP4.so
+usr/lib/pkgconfig/omniConnectionMgmt4.pc
 usr/lib/pkgconfig/omniDynamic4.pc
 usr/lib/pkgconfig/omniORB4.pc
 usr/include/omniconfig.h

Modified: trunk/omniorb4/debian/libomnithread3c2.install
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/libomnithread3c2.install?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/debian/libomnithread3c2.install (original)
+++ trunk/omniorb4/debian/libomnithread3c2.install Thu Sep 20 20:19:25 2007
@@ -1,2 +1,1 @@
 usr/lib/libomnithread.so.*
-

Added: trunk/omniorb4/debian/omniMapper.8
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/omniMapper.8?rev=9&op=file
==============================================================================
--- trunk/omniorb4/debian/omniMapper.8 (added)
+++ trunk/omniorb4/debian/omniMapper.8 Thu Sep 20 20:19:25 2007
@@ -1,0 +1,75 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH OMNIMAPPER 8 "30 Apr 2007"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+omniMapper \- Simple proxy for CORBA naming service from omniORB
+.SH SYNOPSIS
+.B omniMapper
+.RI [ options ]
+.SH DESCRIPTION
+This manual page documents briefly the
+.B omniMapper
+command.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
+.\" respectively.
+\fBomniMapper\fP is a simple daemon which listens on port 2809 (or any
+other port) and redirects IIOP requets for configured object keys to
+associated persistent IORs.  It can be used to make a naming service
+(even an old non-INS aware version of omniNames or other ORB's naming
+service) appear on port 2809 with the object key \fINameService\fP.
+The same goes for any other service you may wish to specify, such as
+an interace repository.
+.SH OPTIONS
+A summary of options is included below.
+For a complete description, see the HTML pages included in the
+omniorb4-doc package.
+.TP
+.BI \-port \ port
+This allows you to choose a port other than 2809 to listen on.
+.TP
+.BI \-config \ config_file
+This specifies a location for the configuration file.  The default
+name is \fI/etc/omniMapper.cfg\fP.
+.TP
+.BI \-v
+\fBomniMapper\fP does not normally print anything; this option makes
+it verbose so it prints configuration information and a record of the
+redirections it makes to standard output.
+.SH CONFIGURATION FILE
+The configuration file is very simple.  Each line contains a string to
+be used as an object key, some white space and an IOR (or any valid
+URI) that it will redirect that object key to.  Comments should be
+prefixed with a \fI#\fP character.  For example:
+.br
+    # Example omniMapper.cfg
+.br
+    NameService         IOR:000f...
+.br
+    InterfaceRepository IOR:0100...
+.SH SEE ALSO
+.BR omniNames (8).
+.br
+The programs are documented fully by the HTML documentation in the
+omniorb4-doc package.
+.SH AUTHOR
+omniNames was written by Duncan Grisby <duncan at grisby.org>
+.PP
+This manual page was written by Floris Bruynooghe
+<floris.bruynooghe at gmail.com>, for the Debian project (but may be
+used by others).

Added: trunk/omniorb4/debian/omniNames.8
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/omniNames.8?rev=9&op=file
==============================================================================
--- trunk/omniorb4/debian/omniNames.8 (added)
+++ trunk/omniorb4/debian/omniNames.8 Thu Sep 20 20:19:25 2007
@@ -1,0 +1,68 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH OMNINAMES 8 "30 Apr 2007"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+omniNames \- OmniORB Interoperable Naming Service
+.SH SYNOPSIS
+.B omniNames
+.RI [ options ] [ omniORB-options ]
+.SH DESCRIPTION
+This manual page documents briefly the
+.B omniNames
+command.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
+.\" respectively.
+\fBomniNames\fP is omniORBs Interoperable Naming Service for CORBA.
+To make it easy to use \fBomniNames\fP with \fIcorbaname\fP URIs, it
+starts with the default port of 2809 and an object key of
+\fINameService\fP for the root naming context.
+.SH OPTIONS
+A summary of options is included below.
+For a complete description, see the HTML pages included in the
+omniorb4-doc package.
+.TP
+.BI \-start\ [ port ]
+This needs to be used the first time omniNames is run.  With no
+\fIport\fP argument the standard default of 2809 is used.
+.TP
+.BI \-logdir \ directory_name
+This specifies the directory where the log/data files are kept.  By
+default \fI/var/lib/omniorb-nameserver/\fP is used.
+.TP
+.BI \-errlog \ file_name
+Where to redirect standard error output.
+.TP
+.B \-ignoreport
+Ignore the port specification.
+.SH ENVIRONMENT
+.TP
+OMNINAMES_LOGDIR
+Alternate way to specify the directory where the log/data files are
+kept.
+.SH SEE ALSO
+.BR omniMapper (8).
+.br
+The programs are documented fully by the HTML documentation in the
+omniorb4-doc package.
+.SH AUTHOR
+omniNames was written by Duncan Grisby <duncan at grisby.org>
+.PP
+This manual page was written by Floris Bruynooghe
+<floris.bruynooghe at gmail.com>, for the Debian project (but may be
+used by others).

Added: trunk/omniorb4/debian/omnicpp.1
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/omnicpp.1?rev=9&op=file
==============================================================================
--- trunk/omniorb4/debian/omnicpp.1 (added)
+++ trunk/omniorb4/debian/omnicpp.1 Thu Sep 20 20:19:25 2007
@@ -1,0 +1,62 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH OMNICPP 8 "30 Apr 2007"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert line break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+omnicpp \- OmniORB cpp preprocessor for IDL compiler
+.SH SYNOPSIS
+.B omnicpp
+.RI [ options ]
+.SH DESCRIPTION
+This manual page documents briefly the
+.B omnicpp
+command.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
+.\" respectively.
+\fBomniidl\fP is omniORBs IDL compiler and uses \fBomnicpp\fP as it's
+C preprocessor.  \fBomnicpp\fP is really just the GNU C preprocessor
+under a different name.  Normally you should not need to invoke this
+directly but should use \fBomniidl\fP instead.
+.SH OPTIONS
+As this is just the GNU C preprocessor \fBcpp\fP you can see that
+program for the full options.  Normally you should not be invoking
+this directly but should use \fBomniidl\fP instead.  The options
+listed here should really be given to \fBomniidl\fP, but they are
+passed straight to \fBomnicpp\fP.
+.TP
+.BI \-D \ name
+Define \fIname\fP for the preprocessor.
+.TP
+.BI \-U \ name
+Undefine \fIname\fP for the preprocessor.
+.TP
+.BI \-I \ dir
+Include \fIdir\fP in the preprocessor search path.  Note that the
+current directory is not on the include search path by default.  Use
+\fI-I.\fP for that.
+.SH SEE ALSO
+.BR omniidl (1).
+.br
+The programs are documented fully by the HTML documentation in the
+omniorb4-doc package.
+.SH AUTHOR
+omniNames was written by Duncan Grisby <duncan at grisby.org>
+.PP
+This manual page was written by Floris Bruynooghe
+<floris.bruynooghe at gmail.com>, for the Debian project (but may be
+used by others).

Modified: trunk/omniorb4/debian/omniidl4.install
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/omniidl4.install?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/debian/omniidl4.install (original)
+++ trunk/omniorb4/debian/omniidl4.install Thu Sep 20 20:19:25 2007
@@ -1,4 +1,3 @@
-../../man/man1/omniidl.1 /usr/share/man/man1/
 usr/bin/omnicpp
-usr/bin/omniidl*
+usr/bin/omniidl
 usr/lib/python*.*/site-packages/

Added: trunk/omniorb4/debian/omniidl4.manpages
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/omniidl4.manpages?rev=9&op=file
==============================================================================
--- trunk/omniorb4/debian/omniidl4.manpages (added)
+++ trunk/omniorb4/debian/omniidl4.manpages Thu Sep 20 20:19:25 2007
@@ -1,0 +1,2 @@
+man/man1/omniidl.1
+debian/omnicpp.1

Added: trunk/omniorb4/debian/omniorb4-doc.docs
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/omniorb4-doc.docs?rev=9&op=file
==============================================================================
--- trunk/omniorb4/debian/omniorb4-doc.docs (added)
+++ trunk/omniorb4/debian/omniorb4-doc.docs Thu Sep 20 20:19:25 2007
@@ -1,0 +1,2 @@
+doc/*.html
+doc/omniORB/

Added: trunk/omniorb4/debian/omniorb4-doc.examples
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/omniorb4-doc.examples?rev=9&op=file
==============================================================================
--- trunk/omniorb4/debian/omniorb4-doc.examples (added)
+++ trunk/omniorb4/debian/omniorb4-doc.examples Thu Sep 20 20:19:25 2007
@@ -1,0 +1,1 @@
+src/examples/*

Added: trunk/omniorb4/debian/omniorb4-nameserver.dirs
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/omniorb4-nameserver.dirs?rev=9&op=file
==============================================================================
--- trunk/omniorb4/debian/omniorb4-nameserver.dirs (added)
+++ trunk/omniorb4/debian/omniorb4-nameserver.dirs Thu Sep 20 20:19:25 2007
@@ -1,0 +1,1 @@
+var/lib/omniorb4-nameserver/

Modified: trunk/omniorb4/debian/omniorb4-nameserver.init
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/omniorb4-nameserver.init?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/debian/omniorb4-nameserver.init (original)
+++ trunk/omniorb4/debian/omniorb4-nameserver.init Thu Sep 20 20:19:25 2007
@@ -1,50 +1,69 @@
-#! /bin/sh
+#!/bin/sh -e
+
+### BEGIN INIT INFO
+# Provides:          omniNames
+# Required-Start:    $local_fs $network
+# Required-Stop:     $local_fs $network
+# Should-Start:      $syslog
+# Should-Stop:       $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start the omniNames Interoperable Naming Service
+# Description:       Starts the CORBA Interoperable Naming Service
+#                    from omniORB.
+### END INIT INFO
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 DAEMON=/usr/bin/omniNames
+ERRLOG="-errlog /var/log/omniorb4-nameserver"
 NAME=omniNames
-DESC="omniorb name server"
+DESC="omniORB name server"
 
 test -f $DAEMON || exit 0
 
-set -e
+. /lib/lsb/init-functions
+
 
 case "$1" in
   start)
-	echo -n "Starting $DESC: "
-	if [ -f /var/log/omninames-`uname -n`.log ] ; then
+	log_begin_msg "Starting $DESC"
+	if [ -f /var/lib/omniorb4-nameserver/omninames-`uname -n`.log ] ; then
 		start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
-			--make-pidfile --background --exec $DAEMON
+                  --make-pidfile --background --exec $DAEMON -- $ERRLOG
 	else
 		start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
-			--make-pidfile --background --exec $DAEMON -- -start
+                  --make-pidfile --background --exec $DAEMON -- -start $ERRLOG
 	fi
-	echo "$NAME."
+	log_end_msg $?
 	;;
   stop)
-	echo -n "Stopping $DESC: "
+	log_begin_msg "Stopping $DESC"
 	start-stop-daemon --oknodo --stop --quiet --pidfile /var/run/$NAME.pid \
 		--exec $DAEMON
-	echo "$NAME."
+	log_end_msg $?
 	;;
   restart|force-reload)
-	echo -n "Restarting $DESC: "
+	log_begin_msg "Restarting $DESC: "
 	start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
 		--exec $DAEMON
 	sleep 1
-	if [ -f /var/log/omninames-`uname -n`.log ] ; then
+	if [ -f /var/lib/omniorb4-nameserver/omninames-`uname -n`.log ] ; then
 		start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
-			--make-pidfile --background --exec $DAEMON
+                  --make-pidfile --background --exec $DAEMON -- $ERRLOG
 	else
 		start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
-			--make-pidfile --background --exec $DAEMON -- -start
+                  --make-pidfile --background --exec $DAEMON -- -start $ERRLOG
 	fi
-        echo "$NAME."
+        log_end_msg $?
 	;;
+  try-restart|status)
+        log_failure_msg "unimplemented feature"
+        exit 3
+        ;;
   *)
 	N=/etc/init.d/$NAME
 	echo "Usage: $N {start|stop|restart|force-reload}" >&2
-	exit 1
+	exit 2
 	;;
 esac
 

Modified: trunk/omniorb4/debian/omniorb4-nameserver.install
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/omniorb4-nameserver.install?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/debian/omniorb4-nameserver.install (original)
+++ trunk/omniorb4/debian/omniorb4-nameserver.install Thu Sep 20 20:19:25 2007
@@ -1,2 +1,1 @@
-../../man/man1/omniNames.1 usr/share/man/man1/
 usr/bin/omniNames

Added: trunk/omniorb4/debian/omniorb4-nameserver.manpages
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/omniorb4-nameserver.manpages?rev=9&op=file
==============================================================================
--- trunk/omniorb4/debian/omniorb4-nameserver.manpages (added)
+++ trunk/omniorb4/debian/omniorb4-nameserver.manpages Thu Sep 20 20:19:25 2007
@@ -1,0 +1,1 @@
+debian/omniNames.8

Modified: trunk/omniorb4/debian/omniorb4-nameserver.postrm
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/omniorb4-nameserver.postrm?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/debian/omniorb4-nameserver.postrm (original)
+++ trunk/omniorb4/debian/omniorb4-nameserver.postrm Thu Sep 20 20:19:25 2007
@@ -6,6 +6,7 @@
 case "$1" in
     purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
 	rm -f /var/log/omninames-* > /dev/null 2>&1 || /bin/true
+        rm -rf /var/lib/omniorb-nameserver/ > /dev/null 2>&1 || /bin/true
         ;;
 
     *)

Modified: trunk/omniorb4/debian/omniorb4.install
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/omniorb4.install?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/debian/omniorb4.install (original)
+++ trunk/omniorb4/debian/omniorb4.install Thu Sep 20 20:19:25 2007
@@ -1,5 +1,3 @@
-../../man/man1/catior.1 ../../man/man1/genior.1 ../../man/man1/nameclt.1 usr/share/man/man1/
-../convertior.1 usr/share/man/man1/
 usr/bin/catior
 usr/bin/convertior
 usr/bin/genior

Added: trunk/omniorb4/debian/omniorb4.manpages
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/omniorb4.manpages?rev=9&op=file
==============================================================================
--- trunk/omniorb4/debian/omniorb4.manpages (added)
+++ trunk/omniorb4/debian/omniorb4.manpages Thu Sep 20 20:19:25 2007
@@ -1,0 +1,5 @@
+man/man1/catior.1
+man/man1/genior.1
+man/man1/nameclt.1
+debian/convertior.1
+debian/omniMapper.8

Modified: trunk/omniorb4/debian/rules
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/debian/rules?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/debian/rules (original)
+++ trunk/omniorb4/debian/rules Thu Sep 20 20:19:25 2007
@@ -12,7 +12,6 @@
 
 build/config.status:
 	dh_testdir
-
 	cp -f /usr/share/misc/config.sub /usr/share/misc/config.guess bin/scripts
 	-mkdir build
 	cd build && \
@@ -23,68 +22,49 @@
 		--disable-thread-tracing \
 		--with-openssl=/usr \
 		--with-omniORB-config=/etc/omniORB4.cfg \
-		--with-omniNames-logdir=/var/log
+		--with-omniNames-logdir=/var/lib/omniorb4-nameserver
 
 build: build-stamp
 build-stamp: build/config.status
 	dh_testdir
-
 	$(MAKE) -C build
-
 	touch build-stamp
 
 clean:
 	dh_testdir
 	dh_testroot
 	rm -f build-stamp configure-stamp
-
 	-rm -rf build
 	-find . -name "*.pyc" -exec rm {} \;
 	-rm bin/scripts/config.guess bin/scripts/config.sub
-
 	dh_clean
 
 install: build
 	dh_testdir
 	dh_testroot
 	dh_clean -k
-	dh_installdirs
-
 	$(MAKE) -C build install DESTDIR=$(CURDIR)/debian/tmp
-
 	-find debian/tmp -name "*.pyc" -exec rm {} \;
-
 	dh_install --sourcedir=debian/tmp
-
-	install -m644 sample.cfg \
-		debian/libomniorb4c2/etc/omniORB4.cfg
-	install -m644 debian/omniorb4.override \
-		debian/omniorb4/usr/share/lintian/overrides/omniorb4
+	mkdir debian/libomniorb4-1/etc/
+	install -m 0644 sample.cfg debian/libomniorb4-1/etc/omniORB4.cfg
+	sed -i '1d' debian/omniidl4/usr/lib/python2.*/site-packages/omniidl/main.py
 
 # Build architecture-independent files here.
 binary-indep: build install
 	dh_testdir -i
 	dh_testroot -i
-#	dh_installdebconf -i
+	dh_installdirs -i
 	dh_installdocs -i
-#	dh_installexamples -i
-#	dh_installmenu -i
-#	dh_installlogrotate -i
-#	dh_installemacsen -i
-#	dh_installpam -i
-#	dh_installmime -i
-#	dh_installinit -i
-#	dh_installcron -i
-#	dh_installman -i
-#	dh_installinfo -i
-#	dh_undocumented -i
+	dh_installexamples -i
+	chmod -R -x debian/omniorb4-doc/usr/share/doc/omniorb4-doc/examples
+	dh_installman -i
 	dh_installchangelogs update.log -i
 	dh_link -i
 	dh_compress -i
 	dh_fixperms -i
 	dh_pycentral -i
 	dh_installdeb -i
-#	dh_perl -i
 	dh_gencontrol -i
 	dh_md5sums -i
 	dh_builddeb -i
@@ -93,28 +73,19 @@
 binary-arch: build install
 	dh_testdir -a
 	dh_testroot -a
-#	dh_installdebconf -a
+	dh_installdirs -a
 	dh_installdocs -a
-#	dh_installexamples -a
-#	dh_installmenu -a
-#	dh_installlogrotate -a
-#	dh_installemacsen -a
-#	dh_installpam -a
-#	dh_installmime -a
+	dh_installexamples -a
 	dh_installinit -a
-#	dh_installcron -a
-#	dh_installman -a
-#	dh_installinfo -a
-#	dh_undocumented -a
+	dh_installman -a
 	dh_installchangelogs update.log -a
 	dh_strip -a
 	dh_link -a
 	dh_compress -a
 	dh_fixperms -a
-	dh_makeshlibs -a -n -V
+	dh_makeshlibs -a -V -X_omniidlmodule.so
 	dh_pycentral -a
 	dh_installdeb -a
-#	dh_perl -a
 	dh_shlibdeps -a
 	dh_gencontrol -a
 	dh_md5sums -a

Modified: trunk/omniorb4/doc/omniORB/omniORB001.html
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/doc/omniORB/omniORB001.html?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/doc/omniORB/omniORB001.html (original)
+++ trunk/omniorb4/doc/omniORB/omniORB001.html Thu Sep 20 20:19:25 2007
@@ -3,10 +3,13 @@
 <HTML>
 <HEAD>
 
+
+
 <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<META name="GENERATOR" content="hevea 1.06">
+<META name="GENERATOR" content="hevea 1.08">
+<LINK rel="stylesheet" type="text/css" href="omniORB.css">
 <TITLE>
- Introduction
+Introduction
 </TITLE>
 </HEAD>
 <BODY >
@@ -14,14 +17,14 @@
 <A HREF="omniORB002.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
 <HR>
 
-<H1><A NAME="htoc1">Chapter&nbsp;1</A>&nbsp;&nbsp;Introduction</H1>
+<H1 CLASS="chapter"><A NAME="htoc1">Chapter&nbsp;1</A>&nbsp;&nbsp;Introduction</H1>
 
 omniORB is an Object Request Broker (ORB) that implements the 2.6
 specification of the Common Object Request Broker Architecture
-(CORBA)&nbsp;[<A HREF="omniORB013.html#corba26-spec"><CITE>OMG01</CITE></A>]<SUP><A NAME="text1" HREF="#note1"><FONT SIZE=2>1</FONT></A></SUP>. It has
+(CORBA)&nbsp;[<A HREF="omniORB014.html#corba26-spec"><CITE>OMG01</CITE></A>]<SUP><A NAME="text1" HREF="#note1">1</A></SUP>. It has
 passed the Open Group CORBA compliant testsuite (for CORBA 2.1) and
 was one of the three ORBs to be granted the CORBA brand in June
-1999<SUP><A NAME="text2" HREF="#note2"><FONT SIZE=2>2</FONT></A></SUP>.<BR>
+1999<SUP><A NAME="text2" HREF="#note2">2</A></SUP>.<BR>
 <BR>
 This user guide tells you how to use omniORB to develop CORBA
 applications. It assumes a basic understanding of CORBA.<BR>
@@ -30,9 +33,9 @@
 and what you need to do to setup your environment to run omniORB.<BR>
 <BR>
 <A NAME="toc1"></A>
-<H2><A NAME="htoc2">1.1</A>&nbsp;&nbsp;Features</H2>
-
-<H3><A NAME="htoc3">1.1.1</A>&nbsp;&nbsp;Multithreading</H3>
+<H2 CLASS="section"><A NAME="htoc2">1.1</A>&nbsp;&nbsp;Features</H2>
+
+<H3 CLASS="subsection"><A NAME="htoc3">1.1.1</A>&nbsp;&nbsp;Multithreading</H3>
 omniORB is fully multithreaded. To achieve low call overhead,
 unnecessary call-multiplexing is eliminated. With the default
 policies, there is at most one call in-flight in each communication
@@ -48,18 +51,18 @@
 messages are fragmented, so the marshaller can start transmission
 before it knows how large the entire message will be.<BR>
 <BR>
-New in version 4.0, omniORB also supports a flexible thread pooling
-policy, and supports sending multiple interleaved calls on a single
-connection. This policy leads to a small amount of additional call
-overhead, compared to the default thread per connection model, but
-allows omniORB to scale to extremely large numbers of concurrent
+From version 4.0 onwards, omniORB also supports a flexible thread
+pooling policy, and supports sending multiple interleaved calls on a
+single connection. This policy leads to a small amount of additional
+call overhead, compared to the default thread per connection model,
+but allows omniORB to scale to extremely large numbers of concurrent
 clients.<BR>
 <BR>
 
-<H3><A NAME="htoc4">1.1.2</A>&nbsp;&nbsp;Portability</H3>
+<H3 CLASS="subsection"><A NAME="htoc4">1.1.2</A>&nbsp;&nbsp;Portability</H3>
 omniORB has always been designed to be portable. It runs on many
 flavours of Unix, Windows, several embedded operating systems, and
-relatively obscure systems such as OpenVMS, Fujitsu-Siemens BS2000.
+relatively obscure systems such as OpenVMS and Fujitsu-Siemens BS2000.
 It is designed to be easy to port to new platforms. The IDL to C++
 mapping for all target platforms is the same.<BR>
 <BR>
@@ -70,7 +73,7 @@
 nested classes.<BR>
 <BR>
 omniORB relies on native thread libraries to provide multithreading
-capability. A small class library (omnithread&nbsp;[<A HREF="omniORB013.html#tjr96a"><CITE>Ric96</CITE></A>]) is used
+capability. A small class library (omnithread&nbsp;[<A HREF="omniORB014.html#tjr96a"><CITE>Ric96</CITE></A>]) is used
 to encapsulate the APIs of the native thread libraries. In application
 code, it is recommended but not mandatory to use this class library
 for thread management. It should be easy to port omnithread to any
@@ -78,28 +81,23 @@
 thread package that supports similar capabilities.<BR>
 <BR>
 
-<H3><A NAME="htoc5">1.1.3</A>&nbsp;&nbsp;Missing features</H3>
+<H3 CLASS="subsection"><A NAME="htoc5">1.1.3</A>&nbsp;&nbsp;Missing features</H3>
 <A NAME="sec:missing"></A>
 omniORB is not (yet) a complete implementation of the CORBA 2.6 core.
 The following is a list of the most significant missing features.
-<UL><LI>omniORB does not have its own Interface Repository. However, it
+<UL CLASS="itemize"><LI CLASS="li-itemize">omniORB does not have its own Interface Repository. However, it
 can act as a client to an IfR. The omniifr project
 (<A HREF="http://omniifr.sourceforge.net/"><TT>http://omniifr.sourceforge.net/</TT></A>) aims to create an IfR for
 omniORB.<BR>
 <BR>
-<LI>Objects by value (IDL valuetype) is not supported in this
-release.<BR>
-<BR>
-<LI>Local interfaces are not supported.<BR>
-<BR>
-<LI>omniORB supports interceptors, but not the standard Portable
+<LI CLASS="li-itemize">omniORB supports interceptors, but not the standard Portable
 Interceptor API.</UL>
 These features may be implemented in the short to medium term. It is
 best to check out the latest status on the omniORB home page
 (<A HREF="http://omniorb.sourceforge.net/"><TT>http://omniorb.sourceforge.net/</TT></A>).<BR>
 <BR>
 <A NAME="toc2"></A>
-<H2><A NAME="htoc6">1.2</A>&nbsp;&nbsp;Setting Up Your Environment</H2>
+<H2 CLASS="section"><A NAME="htoc6">1.2</A>&nbsp;&nbsp;Setting up your environment</H2>
 <A NAME="sec:setup"></A>
 To get omniORB running, you first need to install omniORB according to
 the instructions in the installation notes for your platform. Most
@@ -110,40 +108,41 @@
 it according to your required set-up. The configuration can be set
 with a configuration file, environment variables, command-line
 arguments or, on Windows, the Windows registry.
-<UL><LI>On Unix platforms, the omniORB runtime looks for the environment
+<UL CLASS="itemize"><LI CLASS="li-itemize">On Unix platforms, the omniORB runtime looks for the environment
 variable <TT>OMNIORB_CONFIG</TT>. If this variable is defined, it
 contains the pathname of the omniORB configuration file. If the
 variable is not set, omniORB will use the compiled-in pathname to
-locate the file (by default <TT>/etc/omniORB.cfg</TT>).<BR>
-<BR>
-<LI>On Win32 platforms (Windows NT, 2000, 95, 98), omniORB first
-checks the environment variable <TT>OMNIORB_CONFIG</TT> to obtain the
+locate the file (by default <TT>/etc/omniORB4.cfg</TT>).<BR>
+<BR>
+<LI CLASS="li-itemize">On Win32 platforms (Windows NT, 2000, 95, 98), omniORB first
+checks the environment variable <TT>OMNIORB_CONFIG</TT>&nbsp;to obtain the
 pathname of the configuration file. If this is not set, it then
 attempts to obtain configuration data in the system registry. It
 searches for the data under the key
-<CODE>HKEY_LOCAL_MACHINE\SOFTWARE\omniORB</CODE>.</UL>
+<TT>HKEY_LOCAL_MACHINE\SOFTWARE\omniORB</TT>.</UL>
 omniORB has a large number of parameters than can be configured. See
-chapter&nbsp;<A HREF="omniORB004.html#chap:config">441omniORB configuration and APIchapter.4</A> for full details. The files
+chapter&nbsp;<A HREF="omniORB004.html#chap:config">4</A> for full details. The files
 <TT>sample.cfg</TT> and <TT>sample.reg</TT> contain an example
 configuration file and set of registry entries respectively.<BR>
 <BR>
 To get all the omniORB examples running, the main thing you need to
 configure is the Naming service, omniNames. To do that, the
 configuration file or registry should contain an entry of the form
-<PRE>
+<PRE CLASS="verbatim">
   InitRef = NameService=corbaname::my.host.name
 </PRE>
-See section&nbsp;<A HREF="omniORB006.html#sec:corbaname">6.1.264corbanamesubsection.6.1.2</A> for full details of corbaname URIs.<BR>
+See section&nbsp;<A HREF="omniORB006.html#sec:corbaname">6.1.2</A> for full details of corbaname URIs.<BR>
 <BR>
 <A NAME="toc3"></A>
-<H2><A NAME="htoc7">1.3</A>&nbsp;&nbsp;Platform specific variables</H2>
+<H2 CLASS="section"><A NAME="htoc7">1.3</A>&nbsp;&nbsp;Platform specific variables</H2>
 To compile omniORB programs correctly, several C++ preprocessor defines
 <B>must</B> be specified to identify the target platform. On Unix
 platforms where omniORB was configured with Autoconf, the
 <TT>omniconfig.h</TT> file sets these for you. On other platforms, and
 Unix platforms when Autoconf is not used, you must specify the
 following defines:<BR>
-<DIV ALIGN=left>
+<BR>
+<DIV CLASS="flushleft">
 <TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1>
 <TR><TD ALIGN=left NOWRAP>Platform</TD>
 <TD ALIGN=left NOWRAP>CPP defines</TD>
@@ -200,6 +199,7 @@
 <TD ALIGN=left NOWRAP><CODE>__x86__     __uw7__      __OSVERSION__=5</CODE></TD>
 </TR></TABLE>
 </DIV><BR>
+<BR>
 The preprocessor defines for new platform ports not listed above can
 be found in the corresponding platform configuration files. For
 instance, the platform configuration file for Sun Solaris 2.6 is in
@@ -212,11 +212,11 @@
 If you are building for a single platform, you can edit
 include/omniconfig.h to add the definitions.<BR>
 <BR>
-<HR WIDTH="50%" SIZE=1><DL><DT><A NAME="note1" HREF="#text1"><FONT SIZE=5>1</FONT></A><DD>Most of the 2.6 features have
+<HR WIDTH="50%" SIZE=1><DL CLASS="list"><DT CLASS="dt-list"><A NAME="note1" HREF="#text1"><FONT SIZE=5>1</FONT></A><DD CLASS="dd-list">Most of the 2.6 features have
 been implemented. The features still missing in this release are
-listed in section&nbsp;<A HREF="#sec:missing">1.1.32Missing featuressubsection.1.1.3</A>. Where possible, backward
+listed in section&nbsp;<A HREF="#sec:missing">1.1.3</A>. Where possible, backward
 compatibility has been maintained up to specification 2.0.
-<DT><A NAME="note2" HREF="#text2"><FONT SIZE=5>2</FONT></A><DD>More information can be found at
+<DT CLASS="dt-list"><A NAME="note2" HREF="#text2"><FONT SIZE=5>2</FONT></A><DD CLASS="dd-list">More information can be found at
 <A HREF="http://www.opengroup.org/press/7jun99_b.htm"><TT>http://www.opengroup.org/press/7jun99_b.htm</TT></A>
 </DL>
 <HR>

Modified: trunk/omniorb4/doc/omniORB/omniORB002.html
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/doc/omniORB/omniORB002.html?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/doc/omniORB/omniORB002.html (original)
+++ trunk/omniorb4/doc/omniORB/omniORB002.html Thu Sep 20 20:19:25 2007
@@ -3,10 +3,13 @@
 <HTML>
 <HEAD>
 
+
+
 <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<META name="GENERATOR" content="hevea 1.06">
+<META name="GENERATOR" content="hevea 1.08">
+<LINK rel="stylesheet" type="text/css" href="omniORB.css">
 <TITLE>
- The Basics
+The Basics
 </TITLE>
 </HEAD>
 <BODY >
@@ -15,7 +18,7 @@
 <A HREF="omniORB003.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
 <HR>
 
-<H1><A NAME="htoc8">Chapter&nbsp;2</A>&nbsp;&nbsp;The Basics</H1>
+<H1 CLASS="chapter"><A NAME="htoc8">Chapter&nbsp;2</A>&nbsp;&nbsp;The Basics</H1>
 <A NAME="chap:basic"></A>
 In this chapter, we go through three examples to illustrate the
 practical steps to use omniORB. By going through the source code of
@@ -30,27 +33,27 @@
 Portable Object Adapter, there are very few omniORB specific details.<BR>
 <BR>
 <A NAME="toc4"></A>
-<H2><A NAME="htoc9">2.1</A>&nbsp;&nbsp;The Echo Object Example</H2>
+<H2 CLASS="section"><A NAME="htoc9">2.1</A>&nbsp;&nbsp;The Echo Object Example</H2>
 Our example is an object which has only one method. The method simply
 echos the argument string. We have to:
-<OL type=1><LI>define the object interface in IDL;
-<LI>use the IDL compiler to generate the stub code<SUP><A NAME="text3" HREF="#note3"><FONT SIZE=2>1</FONT></A></SUP>;
-<LI>provide the <I>servant</I> object implementation;
-<LI>write the client code.</OL>
+<OL CLASS="enumerate" type=1><LI CLASS="li-enumerate">define the object interface in IDL;
+<LI CLASS="li-enumerate">use the IDL compiler to generate the stub code<SUP><A NAME="text3" HREF="#note3">1</A></SUP>;
+<LI CLASS="li-enumerate">provide the <I>servant</I> object implementation;
+<LI CLASS="li-enumerate">write the client code.</OL>
 These examples are in the <TT>src/examples/echo</TT> directory of the
 omniORB distribution; there are several other examples one directory
 above that in <TT>src/examples</TT>.<BR>
 <BR>
 <A NAME="toc5"></A>
-<H2><A NAME="htoc10">2.2</A>&nbsp;&nbsp;Specifying the Echo interface in IDL</H2>
-We define an object interface, called <TT>Echo</TT>, as follows:
-<PRE>
-interface Echo {
-    string echoString(in string mesg);
-};
-</PRE>
+<H2 CLASS="section"><A NAME="htoc10">2.2</A>&nbsp;&nbsp;Specifying the Echo interface in IDL</H2>
+We define an object interface, called <TT>Echo</TT>, as follows:<BR>
+<BR>
+<DIV CLASS="lstlisting"><TT><B>interface</B> Echo {</TT><TT>
+</TT><TT>    <B>string</B> echoString(<B>in</B> <B>string</B> mesg);</TT><TT>
+</TT><TT>};</TT></DIV><BR>
+<BR>
 If you are new to IDL, you can learn about its syntax in Chapter 3 of
-the CORBA 2.6 specification&nbsp;[<A HREF="omniORB013.html#corba26-spec"><CITE>OMG01</CITE></A>]. For the moment, you
+the CORBA 2.6 specification&nbsp;[<A HREF="omniORB014.html#corba26-spec"><CITE>OMG01</CITE></A>]. For the moment, you
 only need to know that the interface consists of a single operation,
 <TT>echoString()</TT>, which takes a string as an input argument and returns
 a copy of the same string.<BR>
@@ -70,38 +73,38 @@
 can help a lot.<BR>
 <BR>
 <A NAME="toc6"></A>
-<H2><A NAME="htoc11">2.3</A>&nbsp;&nbsp;Generating the C++ stubs</H2>
+<H2 CLASS="section"><A NAME="htoc11">2.3</A>&nbsp;&nbsp;Generating the C++ stubs</H2>
 From the IDL file, we use the IDL compiler to produce the C++ mapping
 of the interface. The IDL compiler for omniORB is called omniidl.
 Given the IDL file, omniidl produces two stub files: a C++ header file
 and a C++ source file. For example, from the file <TT>echo.idl</TT>, the
 following files are produced:
-<UL><LI>
+<UL CLASS="itemize"><LI CLASS="li-itemize">
 <TT>echo.hh</TT>
-<LI><TT>echoSK.cc</TT>
+<LI CLASS="li-itemize"><TT>echoSK.cc</TT>
 </UL>
 omniidl must be invoked with the <TT>-bcxx</TT> argument to
 tell it to generate C++ stubs. The following command line generates
-the stubs for <TT>echo.idl</TT>:
-<PRE>
-omniidl -bcxx echo.idl
-</PRE>
+the stubs for <TT>echo.idl</TT>:<BR>
+<BR>
+<DIV CLASS="lstlisting"><TT>omniidl -bcxx echo.idl</TT></DIV><BR>
+<BR>
 If you are using our make environment (ODE), you don't need
 to invoke omniidl explicitly. In the example file <TT>dir.mk</TT>, we
-have the following line:
-<PRE>
-CORBA_INTERFACES = echo
-</PRE>
+have the following line:<BR>
+<BR>
+<DIV CLASS="lstlisting"><TT>CORBA_INTERFACES = echo</TT></DIV><BR>
+<BR>
 That is all we need to instruct ODE to generate the stubs.
 Remember, you won't find the stubs in your working directory because
 all stubs are written into the <TT>stub</TT> directory at the top level
 of your build tree.<BR>
 <BR>
 The full arguments to omniidl are detailed in
-chapter&nbsp;<A HREF="omniORB005.html#chap:omniidl">557The IDL compilerchapter.5</A>.<BR>
+chapter&nbsp;<A HREF="omniORB005.html#chap:omniidl">5</A>.<BR>
 <BR>
 <A NAME="toc7"></A>
-<H2><A NAME="htoc12">2.4</A>&nbsp;&nbsp;Object References and Servants</H2>
+<H2 CLASS="section"><A NAME="htoc12">2.4</A>&nbsp;&nbsp;Object References and Servants</H2>
 We contact a CORBA object through an <I>object reference</I>. The
 actual implementation of a CORBA object is termed a <I>servant</I>.<BR>
 <BR>
@@ -113,8 +116,9 @@
 compiler will complain if you use a servant when an object reference
 is expected, or vice-versa.<BR>
 <BR>
-<HR SIZE=2><DL COMPACT=compact><DT><DD>
-<DIV ALIGN=center><B>Warning</B></DIV><BR>
+<HR SIZE=2><DL CLASS="list" COMPACT="compact"><DT CLASS="dt-list"><DD CLASS="dd-list">
+<DIV CLASS="center"><B>Warning</B></DIV><BR>
+<BR>
 omniORB 2.x <EM>did not</EM> use distinct types for object references
 and servants, and often accepted a pointer to a servant when the CORBA
 specification says it should only accept an object reference. If you
@@ -123,9 +127,9 @@
 </DL><HR SIZE=2><BR>
 <BR>
 <A NAME="toc8"></A>
-<H2><A NAME="htoc13">2.5</A>&nbsp;&nbsp;A Quick Tour of the C++ stubs</H2>
-The C++ stubs conform to the mapping defined in the CORBA
-specification&nbsp;[<A HREF="omniORB013.html#cxxmapping"><CITE>OMG03</CITE></A>]. It is important to understand the
+<H2 CLASS="section"><A NAME="htoc13">2.5</A>&nbsp;&nbsp;A Quick Tour of the C++ stubs</H2>
+The C++ stubs conform to the standard mapping defined in the CORBA
+specification&nbsp;[<A HREF="omniORB014.html#cxxmapping"><CITE>OMG03</CITE></A>]. It is important to understand the
 mapping before you start writing any serious CORBA applications.
 Before going any further, it is worth knowing what the mapping looks
 like.<BR>
@@ -134,34 +138,34 @@
 reference is <TT>Echo_ptr</TT>. The type is defined in <TT>echo.hh</TT>.
 The relevant section of the code is reproduced below. The stub code
 produced by other ORBs will be functionally equivalent to omniORB's,
-but will almost certainly look very different.
-<PRE>
-class Echo;
-class _objref_Echo;
-class _impl_Echo;
-typedef _objref_Echo* Echo_ptr;
-
-class Echo {
-public:
-  // Declarations for this interface type.
-  typedef Echo_ptr _ptr_type;
-  typedef Echo_var _var_type;
-
-  static _ptr_type _duplicate(_ptr_type);
-  static _ptr_type _narrow(CORBA::Object_ptr);
-  static _ptr_type _nil();
-
-  // ... methods generated for internal use
-};
-
-class _objref_Echo :
-  public virtual CORBA::Object, public virtual omniObjRef {
-public:
-  char * echoString(const char* mesg);
-
-  // ... methods generated for internal use
-};
-</PRE>
+but will almost certainly look very different.<BR>
+<BR>
+<DIV CLASS="lstlisting"><TT><B>class</B> Echo;</TT><TT>
+</TT><TT><B>class</B> _objref_Echo;</TT><TT>
+</TT><TT><B>class</B> _impl_Echo;</TT><TT>
+</TT><TT><B>typedef</B> _objref_Echo* Echo_ptr;</TT><TT>
+</TT><TT>
+</TT><TT><B>class</B> Echo {</TT><TT>
+</TT><TT><B>public</B>:</TT><TT>
+</TT><TT>  <I>// Declarations for this interface type.</I></TT><TT>
+</TT><TT>  <B>typedef</B> Echo_ptr _ptr_type;</TT><TT>
+</TT><TT>  <B>typedef</B> Echo_var _var_type;</TT><TT>
+</TT><TT>
+</TT><TT>  <B>static</B> _ptr_type _duplicate(_ptr_type);</TT><TT>
+</TT><TT>  <B>static</B> _ptr_type _narrow(CORBA::Object_ptr);</TT><TT>
+</TT><TT>  <B>static</B> _ptr_type _nil();</TT><TT>
+</TT><TT>
+</TT><TT>  <I>// ... methods generated for internal use</I></TT><TT>
+</TT><TT>};</TT><TT>
+</TT><TT>
+</TT><TT><B>class</B> _objref_Echo :</TT><TT>
+</TT><TT>  <B>public</B> <B>virtual</B> CORBA::Object, <B>public</B> <B>virtual</B> omniObjRef {</TT><TT>
+</TT><TT><B>public</B>:</TT><TT>
+</TT><TT>  <B>char</B> * echoString(<B>const</B> <B>char</B>* mesg);</TT><TT>
+</TT><TT>
+</TT><TT>  <I>// ... methods generated for internal use</I></TT><TT>
+</TT><TT>};</TT></DIV><BR>
+<BR>
 In a compliant application, the operations defined in an object
 interface should <B>only</B> be invoked via an object reference.
 This is done by using arrow (`<TT>-&gt;</TT>') on an object reference.
@@ -181,10 +185,10 @@
 <TT>_duplicate()</TT>, and <TT>_narrow()</TT>.<BR>
 <BR>
 The <TT>_nil()</TT> function returns a nil object reference of the Echo
-interface. The following call is guaranteed to return TRUE:
-<PRE>
-CORBA::Boolean true_result = CORBA::is_nil(Echo::_nil());
-</PRE>
+interface. The following call is guaranteed to return TRUE:<BR>
+<BR>
+<DIV CLASS="lstlisting"><TT>CORBA::Boolean true_result = CORBA::is_nil(Echo::_nil());</TT></DIV><BR>
+<BR>
 Remember, <TT>CORBA::is_nil()</TT> is the only compliant way to check if an
 object reference is nil. You should not use the equality
 <TT>operator==</TT>. Many C++ ORBs use the null pointer to represent a
@@ -217,33 +221,33 @@
 <BR>
 To indicate that an object reference will no longer be accessed, you
 must call the <TT>CORBA::release()</TT> operation. Its signature is as
-follows:
-<PRE>
-namespaceCORBA {
-  void release(CORBA::Object_ptr obj);
-  ... // other methods
-};
-</PRE>
+follows:<BR>
+<BR>
+<DIV CLASS="lstlisting"><TT><B>namespace</B> CORBA {</TT><TT>
+</TT><TT>  <B>void</B> release(CORBA::Object_ptr obj);</TT><TT>
+</TT><TT>  ... <I>// other methods</I></TT><TT>
+</TT><TT>};</TT></DIV><BR>
+<BR>
 Once you have called <TT>CORBA::release()</TT> on an object reference, you
 must no longer use that reference. This is because the associated
 resources may have been deallocated. Notice that we are referring to
 the resources associated with the object reference and <B>not the
 servant object</B>. Servant objects are not affected by the lifetimes of
 object references. In particular, servants are not deleted when all
-references to them have been released---CORBA does not perform
+references to them have been released&mdash;CORBA does not perform
 distributed garbage collection.<BR>
 <BR>
 As described above, the equality <TT>operator==</TT> should not be used
 on object references. To test if two object references are equivalent,
 the member function <TT>_is_equivalent()</TT> of the generic object
-<TT>CORBA::Object</TT> can be used. Here is an example of its usage:
-<PRE>
-Echo_ptr A;
-...            // initialise A to a valid object reference 
-Echo_ptr B = A;
-CORBA::Boolean true_result = A-&gt;_is_equivalent(B); 
-// Note: the above call is guaranteed to be TRUE
-</PRE>
+<TT>CORBA::Object</TT> can be used. Here is an example of its usage:<BR>
+<BR>
+<DIV CLASS="lstlisting"><TT>Echo_ptr A;</TT><TT>
+</TT><TT>...            <I>// initialise A to a valid object reference </I></TT><TT>
+</TT><TT>Echo_ptr B = A;</TT><TT>
+</TT><TT>CORBA::Boolean true_result = A-&gt;_is_equivalent(B);</TT><TT>
+</TT><TT><I>// Note: the above call is guaranteed to be TRUE</I></TT></DIV><BR>
+<BR>
 You have now been introduced to most of the operations that can be
 invoked via <TT>Echo_ptr</TT>. The generic object <TT>CORBA::Object</TT>
 provides a few more operations and all of them can be invoked via
@@ -254,32 +258,32 @@
 Since object references must be released explicitly, their usage is
 prone to error and can lead to memory leakage. The mapping defines the
 <I>object reference variable</I> type to make life easier. In our
-example, the variable type <TT>Echo_var</TT> is defined<SUP><A NAME="text4" HREF="#note4"><FONT SIZE=2>2</FONT></A></SUP>.<BR>
+example, the variable type <TT>Echo_var</TT> is defined<SUP><A NAME="text4" HREF="#note4">2</A></SUP>.<BR>
 <BR>
 The <TT>Echo_var</TT> is more convenient to use because it will
 automatically release its object reference when it is deallocated or
 when assigned a new object reference. For many operations, mixing data
 of type <TT>Echo_var</TT> and <TT>Echo_ptr</TT> is possible without any
-explicit operations or castings<SUP><A NAME="text5" HREF="#note5"><FONT SIZE=2>3</FONT></A></SUP>. For instance, the operation
+explicit operations or castings<SUP><A NAME="text5" HREF="#note5">3</A></SUP>. For instance, the operation
 <TT>echoString()</TT> can be called using the arrow (`<TT>-&gt;</TT>') on a
 <TT>Echo_var</TT>, as one can do with a <TT>Echo_ptr</TT>.<BR>
 <BR>
-The usage of <TT>Echo_var</TT> is illustrated below:
-<PRE>
-Echo_var a;
-Echo_ptr p = ... // somehow obtain an object reference
-
-a = p;           // a assumes ownership of p, must not use p any more
-
-Echo_var b = a;  // implicit _duplicate
-
-p = ...          // somehow obtain another object reference
-
-a = Echo::_duplicate(p);     // release old object reference
-                             // a now holds a copy of p.
-</PRE>
-
-<H3><A NAME="htoc14">2.5.1</A>&nbsp;&nbsp;Servant Object Implementation</H3>
+The usage of <TT>Echo_var</TT> is illustrated below:<BR>
+<BR>
+<DIV CLASS="lstlisting"><TT>Echo_var a;</TT><TT>
+</TT><TT>Echo_ptr p = ... <I>// somehow obtain an object reference</I></TT><TT>
+</TT><TT>
+</TT><TT>a = p;           <I>// a assumes ownership of p, must not use p any more</I></TT><TT>
+</TT><TT>
+</TT><TT>Echo_var b = a;  <I>// implicit _duplicate</I></TT><TT>
+</TT><TT>
+</TT><TT>p = ...          <I>// somehow obtain another object reference</I></TT><TT>
+</TT><TT>
+</TT><TT>a = Echo::_duplicate(p);     <I>// release old object reference</I></TT><TT>
+</TT><TT>                             <I>// a now holds a copy of p.</I></TT></DIV><BR>
+<BR>
+
+<H3 CLASS="subsection"><A NAME="htoc14">2.5.1</A>&nbsp;&nbsp;Servant Object Implementation</H3>
 <A NAME="stubobjimpl"></A>
 Before the Portable Object Adapter (POA) specification, many of the
 details of how servant objects should be implemented and registered
@@ -287,7 +291,7 @@
 between ORBs. The POA specification rectifies that. omniORB 4 still
 supports the old omniORB 2.x BOA mapping, but you should always use
 the POA mapping for new code. BOA code and POA code can coexist within
-a single program. See section&nbsp;<A HREF="omniORB003.html#sec:BOAcompat">3.139omniORB 2 BOA compatibilitysection.3.1</A> for details of the
+a single program. See section&nbsp;<A HREF="omniORB003.html#sec:BOAcompat">3.1</A> for details of the
 BOA compatibility, and problems you may encounter.<BR>
 <BR>
 For each object interface, a <I>skeleton</I> class is generated. In
@@ -297,36 +301,36 @@
 derives from the skeleton class.<BR>
 <BR>
 The skeleton class <TT>POA_Echo</TT> is defined in <TT>echo.hh</TT>. The
-relevant section of the code is reproduced below.
-<PRE>
-class POA_Echo :
-  public virtual PortableServer::ServantBase
-{
-public:
-  Echo_ptr _this();
-
-  virtual char * echoString(const char*  mesg) = 0;
-  // ...
-};
-</PRE>
+relevant section of the code is reproduced below.<BR>
+<BR>
+<DIV CLASS="lstlisting"><TT><B>class</B> POA_Echo :</TT><TT>
+</TT><TT>  <B>public</B> <B>virtual</B> PortableServer::ServantBase</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT><B>public</B>:</TT><TT>
+</TT><TT>  Echo_ptr _this();</TT><TT>
+</TT><TT>
+</TT><TT>  <B>virtual</B> <B>char</B> * echoString(<B>const</B> <B>char</B>*  mesg) = 0;</TT><TT>
+</TT><TT>  <I>// ...</I></TT><TT>
+</TT><TT>};</TT></DIV><BR>
+<BR>
 The code fragment shows the only member functions that can be used in
 the object implementation code. Other member functions are generated
 for internal use only. As with the code generated for object
 references, other POA-based ORBs will generate code which looks
 different, but is functionally equivalent to this.
-<DL COMPACT=compact><DT><B><TT>echoString()</TT></B><DD><BR>
+<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><B><TT>echoString()</TT></B><DD CLASS="dd-description"><BR>
 It is through this abstract function that an implementation class
 provides the implementation of the <TT>echoString()</TT> operation. Notice
 that its signature is the same as the <TT>echoString()</TT> function that
 can be invoked via the <TT>Echo_ptr</TT> object reference.<BR>
 <BR>
-<DT><B><TT>_this()</TT></B><DD><BR>
+<DT CLASS="dt-description"><B><TT>_this()</TT></B><DD CLASS="dd-description"><BR>
 This function returns an object reference for the target object,
 provided the POA policies permit it. The returned value must be
-deallocated via <TT>CORBA::release()</TT>. See section&nbsp;<A HREF="#objeg1">2.813Example 1 --- Colocated Client and Implementationsection.2.8</A>
+deallocated via <TT>CORBA::release()</TT>. See section&nbsp;<A HREF="#objeg1">2.8</A>
 for an example of how this function is used.</DL>
 <A NAME="toc9"></A>
-<H2><A NAME="htoc15">2.6</A>&nbsp;&nbsp;Writing the servant implementation</H2>
+<H2 CLASS="section"><A NAME="htoc15">2.6</A>&nbsp;&nbsp;Writing the servant implementation</H2>
 <A NAME="objimpl"></A>
 You define an implementation class to provide the servant
 implementation. There is little constraint on how you design your
@@ -336,24 +340,23 @@
 operation of the interface. They are the hooks for the ORB to perform
 upcalls to your implementation.<BR>
 <BR>
-Here is a simple implementation of the Echo object.
-<PRE>
-class Echo_i : public POA_Echo,
-        public PortableServer::RefCountServantBase
-{
-public:
-  inline Echo_i() {}
-  virtual ~Echo_i() {}
-  virtual char* echoString(const char* mesg);
-};
-
-char* Echo_i::echoString(const char* mesg)
-{
-  return CORBA::string_dup(mesg);
-}
-</PRE>
+Here is a simple implementation of the Echo object.<BR>
+<BR>
+<DIV CLASS="lstlisting"><TT><B>class</B> Echo_i : <B>public</B> POA_Echo</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT><B>public</B>:</TT><TT>
+</TT><TT>  <B>inline</B> Echo_i() {}</TT><TT>
+</TT><TT>  <B>virtual</B> ~Echo_i() {}</TT><TT>
+</TT><TT>  <B>virtual</B> <B>char</B>* echoString(<B>const</B> <B>char</B>* mesg);</TT><TT>
+</TT><TT>};</TT><TT>
+</TT><TT>
+</TT><TT><B>char</B>* Echo_i::echoString(<B>const</B> <B>char</B>* mesg)</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT>  <B>return</B> CORBA::string_dup(mesg);</TT><TT>
+</TT><TT>}</TT></DIV><BR>
+<BR>
 There are four points to note here:
-<DL COMPACT=compact><DT><B>Storage Responsibilities</B><DD><BR>
+<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><B>Storage Responsibilities</B><DD CLASS="dd-description"><BR>
 A string, which is used both as an in argument and the return value of
 <TT>echoString()</TT>, is a variable size data type. Other examples of
 variable size data types include sequences, type `any', etc. For these
@@ -367,7 +370,7 @@
 storage when the variables will no longer be used. For details,
 please refer to the C++ mapping specification.<BR>
 <BR>
-<DT><B>Multi-threading</B><DD><BR>
+<DT CLASS="dt-description"><B>Multi-threading</B><DD CLASS="dd-description"><BR>
 As omniORB is fully multithreaded, multiple threads may perform the
 same upcall to your implementation concurrently. It is up to your
 implementation to synchronise the threads' accesses to shared data.
@@ -378,50 +381,48 @@
 <TT>SINGLE_THREAD_MODEL</TT> Thread Policy. This guarantees that all
 calls to that POA are processed sequentially.<BR>
 <BR>
-<DT><B>Reference Counting</B><DD><BR>
-As well as inheriting from the Echo skeleton class, the servant class
-is also derived from <TT>PortableServer::RefCountServantBase</TT> which,
-as the name suggests, is a mixin class which provides reference
-counting for the servant object. This means that an <TT>Echo_i</TT>
-instance will be deleted when no more references to it are held by
-application code or the POA itself. Note that this is totally separate
-from the reference counting which is associated with object
-references---a servant object is <EM>never</EM> deleted due to a CORBA
-object reference being released.<BR>
-<BR>
-<DT><B>Instantiation</B><DD><BR>
-Servants that derive from <TT>PortableServer::RefCountServantBase</TT>
-must not be instantiated as automatic variables (i.e. on the stack).
-Instead, you should always instantiate them using the <TT>new</TT>
-operator, i.e. their storage is allocated on the heap. Otherwise, the
-POA may attempt to delete an object on the stack.</DL>
+<DT CLASS="dt-description"><B>Reference Counting</B><DD CLASS="dd-description"><BR>
+All servant objects are reference counted. The base
+<TT>PortableServer::ServantBase</TT> class from which all servant
+skeleton classes derive defines member functions named <TT>_add_ref()</TT>
+and <TT>_remove_ref()</TT><SUP><A NAME="text6" HREF="#note6">4</A></SUP>. The reference
+counting means that an <TT>Echo_i</TT> instance will be deleted when no
+more references to it are held by application code or the POA
+itself. Note that this is totally separate from the reference counting
+which is associated with object references&mdash;a servant object is
+<EM>never</EM> deleted due to a CORBA object reference being released.<BR>
+<BR>
+<DT CLASS="dt-description"><B>Instantiation</B><DD CLASS="dd-description"><BR>
+Servants are usually instantiated on the heap, i.e. using the
+<TT>new</TT> operator. However, they can also be created on the stack as
+automatic variables. If you do that, it is vital to make sure that the
+servant has been deactivated, and thus released by the POA, before the
+variable goes out of scope and is destroyed.</DL>
 <A NAME="toc10"></A>
-<H2><A NAME="htoc16">2.7</A>&nbsp;&nbsp;Writing the client</H2>
+<H2 CLASS="section"><A NAME="htoc16">2.7</A>&nbsp;&nbsp;Writing the client</H2>
 Here is an example of how an <TT>Echo_ptr</TT> object reference is
 used.<BR>
 <BR>
-
-<PRE>
- 1  void
- 2  hello(CORBA::Object_ptr obj)
- 3  {
- 4    Echo_var e = Echo::_narrow(obj);
- 5
- 6    if (CORBA::is_nil(e)) {
- 7      cerr &lt;&lt; "cannot invoke on a nil object reference."
- 8           &lt;&lt; endl;
- 9      return;
-10    }
-11
-12    CORBA::String_var src = (const char*) "Hello!";
-13    CORBA::String_var dest;
-14
-15    dest = e-&gt;echoString(src);
-16
-17    cerr &lt;&lt; "I said,\"" &lt;&lt; src &lt;&lt; "\"."
-18         &lt;&lt; " The Object said,\"" &lt;&lt; dest &lt;&lt;"\"" &lt;&lt; endl;
-19  }
-</PRE>
+<DIV CLASS="lstlisting"><TT> 1  <B>void</B></TT><TT>
+</TT><TT> 2  hello(CORBA::Object_ptr obj)</TT><TT>
+</TT><TT> 3  {</TT><TT>
+</TT><TT> 4    Echo_var e = Echo::_narrow(obj);</TT><TT>
+</TT><TT> 5</TT><TT>
+</TT><TT> 6    <B>if</B> (CORBA::is_nil(e)) {</TT><TT>
+</TT><TT> 7      cerr &lt;&lt; "cannot invoke on a nil object reference."</TT><TT>
+</TT><TT> 8           &lt;&lt; endl;</TT><TT>
+</TT><TT> 9      <B>return</B>;</TT><TT>
+</TT><TT>10    }</TT><TT>
+</TT><TT>11</TT><TT>
+</TT><TT>12    CORBA::String_var src = (<B>const</B> <B>char</B>*) "Hello!";</TT><TT>
+</TT><TT>13    CORBA::String_var dest;</TT><TT>
+</TT><TT>14</TT><TT>
+</TT><TT>15    dest = e-&gt;echoString(src);</TT><TT>
+</TT><TT>16</TT><TT>
+</TT><TT>17    cerr &lt;&lt; "I said,\"" &lt;&lt; src &lt;&lt; "\"."</TT><TT>
+</TT><TT>18         &lt;&lt; " The Object said,\"" &lt;&lt; dest &lt;&lt;"\"" &lt;&lt; endl;</TT><TT>
+</TT><TT>19  }</TT></DIV><BR>
+<BR>
 Briefly, the <TT>hello()</TT> function accepts a generic object reference.
 The object reference (<TT>obj</TT>) is narrowed to <TT>Echo_ptr</TT>. If
 the object reference returned by <TT>Echo::_narrow()</TT> is not nil, the
@@ -448,11 +449,11 @@
 automatically when the variable goes out of scope (as the function
 returns). Line 15 shows how <TT>CORBA::String_var</TT> variables are
 used. They can be used in place of a string (for which the mapping is
-<TT>char*</TT>)<SUP><A NAME="text6" HREF="#note6"><FONT SIZE=2>4</FONT></A></SUP>. As used in line 12, assigning a constant string
+<TT>char*</TT>)<SUP><A NAME="text7" HREF="#note7">5</A></SUP>. As used in line 12, assigning a constant string
 (<TT>const char*</TT>) to a <TT>CORBA::String_var</TT> causes the string
 to be copied. On the other hand, assigning a <TT>char*</TT> to a
 <TT>CORBA::String_var</TT>, as used in line 15, causes the latter to
-assume the ownership of the string<SUP><A NAME="text7" HREF="#note7"><FONT SIZE=2>5</FONT></A></SUP>.<BR>
+assume the ownership of the string<SUP><A NAME="text8" HREF="#note8">6</A></SUP>.<BR>
 <BR>
 Under the C++ mapping, <TT>T_var</TT> types are provided for all the
 non-basic data types. It is obvious that one should use automatic
@@ -462,7 +463,7 @@
 heap storage.<BR>
 <BR>
 <A NAME="toc11"></A>
-<H2><A NAME="htoc17">2.8</A>&nbsp;&nbsp;Example 1 --- Colocated Client and Implementation</H2>
+<H2 CLASS="section"><A NAME="htoc17">2.8</A>&nbsp;&nbsp;Example 1 &mdash; Colocated Client and Implementation</H2>
 <A NAME="objeg1"></A>
 Having introduced the client and the object implementation, we can now
 describe how to link up the two via the ORB and POA. In this section,
@@ -473,43 +474,41 @@
 <BR>
 The code for this example is reproduced below:<BR>
 <BR>
-
-<PRE>
- 1  int
- 2  main(int argc, char **argv)
- 3  {
- 4    CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv,"omniORB4");
- 5
- 6    CORBA::Object_var       obj = orb-&gt;resolve_initial_references("RootPOA");
- 7    PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
- 8
- 9    Echo_i *myecho = new Echo_i();
-10    PortableServer::ObjectId_var myechoid = poa-&gt;activate_object(myecho);
-11
-12    Echo_var myechoref = myecho-&gt;_this();
-13    myecho-&gt;_remove_ref();
-14
-15    PortableServer::POAManager_var pman = poa-&gt;the_POAManager();
-16    pman-&gt;activate();
-17
-18    hello(myechoref);
-19
-20    orb-&gt;destroy();
-21    return 0;
-22  }
-</PRE>
+<DIV CLASS="lstlisting"><TT> 1  <B>int</B></TT><TT>
+</TT><TT> 2  main(<B>int</B> argc, <B>char</B> **argv)</TT><TT>
+</TT><TT> 3  {</TT><TT>
+</TT><TT> 4    CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv,"omniORB4");</TT><TT>
+</TT><TT> 5</TT><TT>
+</TT><TT> 6    CORBA::Object_var       obj = orb-&gt;resolve_initial_references("RootPOA");</TT><TT>
+</TT><TT> 7    PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);</TT><TT>
+</TT><TT> 8</TT><TT>
+</TT><TT> 9    Echo_i *myecho = <B>new</B> Echo_i();</TT><TT>
+</TT><TT>10    PortableServer::ObjectId_var myechoid = poa-&gt;activate_object(myecho);</TT><TT>
+</TT><TT>11</TT><TT>
+</TT><TT>12    Echo_var myechoref = myecho-&gt;_this();</TT><TT>
+</TT><TT>13    myecho-&gt;_remove_ref();</TT><TT>
+</TT><TT>14</TT><TT>
+</TT><TT>15    PortableServer::POAManager_var pman = poa-&gt;the_POAManager();</TT><TT>
+</TT><TT>16    pman-&gt;activate();</TT><TT>
+</TT><TT>17</TT><TT>
+</TT><TT>18    hello(myechoref);</TT><TT>
+</TT><TT>19</TT><TT>
+</TT><TT>20    orb-&gt;destroy();</TT><TT>
+</TT><TT>21    <B>return</B> 0;</TT><TT>
+</TT><TT>22  }</TT></DIV><BR>
+<BR>
 The example illustrates several important interactions among the ORB,
 the POA, the servant, and the client. Here are the details:<BR>
 <BR>
 
-<H3><A NAME="htoc18">2.8.1</A>&nbsp;&nbsp;ORB initialisation</H3>
-<DL COMPACT=compact><DT><B>Line 4</B><DD><BR>
+<H3 CLASS="subsection"><A NAME="htoc18">2.8.1</A>&nbsp;&nbsp;ORB initialisation</H3>
+<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><B>Line 4</B><DD CLASS="dd-description"><BR>
 The ORB is initialised by calling the <TT>CORBA::ORB_init()</TT>
 function. The function uses the optional 3rd argument to determine
 which ORB should be returned. Unless you are using omniORB specific
 features, it is usually best to leave it out, and get the default
-ORB. To explicitly ask for omniORB 4.0, this argument must be
-`omniORB4'<SUP><A NAME="text8" HREF="#note8"><FONT SIZE=2>6</FONT></A></SUP>.<BR>
+ORB. To explicitly ask for omniORB 4.x, this argument must be
+`omniORB4'<SUP><A NAME="text9" HREF="#note9">7</A></SUP>.<BR>
 <BR>
 <TT>CORBA::ORB_init()</TT> takes the list of command line arguments and
 processes any that start `<TT>-ORB</TT>'. It removes these arguments
@@ -519,8 +518,8 @@
 arguments, or an invalid configuration file, the
 <TT>CORBA::INITIALIZE</TT> system exception is raised.</DL>
 
-<H3><A NAME="htoc19">2.8.2</A>&nbsp;&nbsp;Obtaining the Root POA</H3>
-<DL COMPACT=compact><DT><B>Lines 6--7</B><DD><BR>
+<H3 CLASS="subsection"><A NAME="htoc19">2.8.2</A>&nbsp;&nbsp;Obtaining the Root POA</H3>
+<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><B>Lines 6&ndash;7</B><DD CLASS="dd-description"><BR>
 To activate our servant object and make it available to clients, we
 must register it with a POA. In this example, we use the <I>Root
 POA</I>, rather than creating any child POAs. The Root POA is found with
@@ -531,22 +530,22 @@
 A POA's behaviour is governed by its <I>policies</I>. The Root POA has
 suitable policies for many simple servers, and closely matches the
 `policies' used by omniORB 2's BOA. See Chapter 11 of the CORBA 2.6
-specification[<A HREF="omniORB013.html#corba26-spec"><CITE>OMG01</CITE></A>] for details of all the POA policies
+specification[<A HREF="omniORB014.html#corba26-spec"><CITE>OMG01</CITE></A>] for details of all the POA policies
 which are available.</DL>
 
-<H3><A NAME="htoc20">2.8.3</A>&nbsp;&nbsp;Object initialisation</H3>
-<DL COMPACT=compact><DT><B>Line 9</B><DD><BR>
+<H3 CLASS="subsection"><A NAME="htoc20">2.8.3</A>&nbsp;&nbsp;Object initialisation</H3>
+<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><B>Line 9</B><DD CLASS="dd-description"><BR>
 An instance of the Echo servant is initialised using the <TT>new</TT>
 operator.<BR>
 <BR>
-<DT><B>Line 10</B><DD><BR>
+<DT CLASS="dt-description"><B>Line 10</B><DD CLASS="dd-description"><BR>
 The servant object is activated in the Root POA using
 <TT>poa-&gt;activate_object()</TT>, which returns an object identifier
 (of type <TT>PortableServer::ObjectId*</TT>). The object id must
 be passed back to various POA operations. The caller is responsible
 for freeing the object id, so it is assigned to a <TT>_var</TT> type.<BR>
 <BR>
-<DT><B>Line 12</B><DD><BR>
+<DT CLASS="dt-description"><B>Line 12</B><DD CLASS="dd-description"><BR>
 The object reference is obtained from the servant object by calling
 <TT>_this()</TT>. Like all object references, the return value of
 <TT>_this()</TT> must be released by <TT>CORBA::release()</TT> when it is no
@@ -567,7 +566,7 @@
 to any object references that are passed around within the same
 address space or received from other address spaces via remote calls.<BR>
 <BR>
-<DT><B>Line 13</B><DD><BR>
+<DT CLASS="dt-description"><B>Line 13</B><DD CLASS="dd-description"><BR>
 The server code releases the reference it holds to the servant
 object. The only reference to that object is now held by the POA (it
 gained the reference on the call to <TT>activate_object()</TT>), so when
@@ -575,8 +574,8 @@
 object will be deleted automatically. After this point, the code must
 no longer use the <TT>myecho</TT> pointer.</DL>
 
-<H3><A NAME="htoc21">2.8.4</A>&nbsp;&nbsp;Activating the POA</H3>
-<DL COMPACT=compact><DT><B>Lines 15--16</B><DD><BR>
+<H3 CLASS="subsection"><A NAME="htoc21">2.8.4</A>&nbsp;&nbsp;Activating the POA</H3>
+<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><B>Lines 15&ndash;16</B><DD CLASS="dd-description"><BR>
 POAs are initially in the <I>holding</I> state, meaning that incoming
 requests are blocked. Lines 15 and 16 acquire a reference to the POA's
 POA manager, and use it to put the POA into the <I>active</I> state.
@@ -584,14 +583,14 @@
 is one of the most common programming mistakes. If your program
 appears deadlocked, make sure you activated the POA!</B></DL>
 
-<H3><A NAME="htoc22">2.8.5</A>&nbsp;&nbsp;Performing a call</H3>
-<DL COMPACT=compact><DT><B>Line 18</B><DD><BR>
+<H3 CLASS="subsection"><A NAME="htoc22">2.8.5</A>&nbsp;&nbsp;Performing a call</H3>
+<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><B>Line 18</B><DD CLASS="dd-description"><BR>
 At long last, we can call <TT>hello()</TT> with this object reference. The
 argument is widened implicitly to the generic object reference
 <TT>CORBA::Object_ptr</TT>.</DL>
 
-<H3><A NAME="htoc23">2.8.6</A>&nbsp;&nbsp;ORB destruction</H3>
-<DL COMPACT=compact><DT><B>Line 20</B><DD><BR>
+<H3 CLASS="subsection"><A NAME="htoc23">2.8.6</A>&nbsp;&nbsp;ORB destruction</H3>
+<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description"><B>Line 20</B><DD CLASS="dd-description"><BR>
 Shutdown the ORB permanently. This call causes the ORB to release all
 its resources, e.g. internal threads, and also to deactivate any
 servant objects which are currently active. When it deactivates the
@@ -602,7 +601,7 @@
 Windows NT that is to be used from ActiveX. If this call is absent,
 the application will hang when the CORBA DLL is unloaded.</DL>
 <A NAME="toc12"></A>
-<H2><A NAME="htoc24">2.9</A>&nbsp;&nbsp;Example 2 --- Different Address Spaces</H2>
+<H2 CLASS="section"><A NAME="htoc24">2.9</A>&nbsp;&nbsp;Example 2 &mdash; Different Address Spaces</H2>
 In this example, the client and the object implementation reside in
 two different address spaces. The code of this example is almost the
 same as the previous example. The only difference is the extra work
@@ -618,38 +617,36 @@
 passing the object reference using the CORBA Naming Service.<BR>
 <BR>
 
-<H3><A NAME="htoc25">2.9.1</A>&nbsp;&nbsp;Object Implementation: Generating a Stringified Object Reference</H3>
+<H3 CLASS="subsection"><A NAME="htoc25">2.9.1</A>&nbsp;&nbsp;Object Implementation: Making a Stringified Object Reference</H3>
 The <TT>main()</TT> function of the server side is reproduced below. The
 full listing (<TT>eg2_impl.cc</TT>) can be found at the end of this
 chapter.<BR>
 <BR>
-
-<PRE>
- 1  int main(int argc, char** argv)
- 2  {
- 3    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
- 4
- 5    CORBA::Object_var       obj = orb-&gt;resolve_initial_references("RootPOA");
- 6    PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
- 7
- 8    Echo_i* myecho = new Echo_i();
- 9
-10    PortableServer::ObjectId_var myechoid = poa-&gt;activate_object(myecho);
-11
-12    obj = myecho-&gt;_this();
-13    CORBA::String_var sior(orb-&gt;object_to_string(obj));
-14    cerr &lt;&lt; "'" &lt;&lt; (char*)sior &lt;&lt; "'" &lt;&lt; endl;
-15
-16    myecho-&gt;_remove_ref();
-17
-18    PortableServer::POAManager_var pman = poa-&gt;the_POAManager();
-19    pman-&gt;activate();
-20
-21    orb-&gt;run();
-22    orb-&gt;destroy();
-23    return 0;
-24  }
-</PRE>
+<DIV CLASS="lstlisting"><TT> 1  <B>int</B> main(<B>int</B> argc, <B>char</B>** argv)</TT><TT>
+</TT><TT> 2  {</TT><TT>
+</TT><TT> 3    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);</TT><TT>
+</TT><TT> 4</TT><TT>
+</TT><TT> 5    CORBA::Object_var       obj = orb-&gt;resolve_initial_references("RootPOA");</TT><TT>
+</TT><TT> 6    PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);</TT><TT>
+</TT><TT> 7</TT><TT>
+</TT><TT> 8    Echo_i* myecho = <B>new</B> Echo_i();</TT><TT>
+</TT><TT> 9</TT><TT>
+</TT><TT>10    PortableServer::ObjectId_var myechoid = poa-&gt;activate_object(myecho);</TT><TT>
+</TT><TT>11</TT><TT>
+</TT><TT>12    obj = myecho-&gt;_this();</TT><TT>
+</TT><TT>13    CORBA::String_var sior(orb-&gt;object_to_string(obj));</TT><TT>
+</TT><TT>14    cerr &lt;&lt; "'" &lt;&lt; (<B>char</B>*)sior &lt;&lt; "'" &lt;&lt; endl;</TT><TT>
+</TT><TT>15</TT><TT>
+</TT><TT>16    myecho-&gt;_remove_ref();</TT><TT>
+</TT><TT>17</TT><TT>
+</TT><TT>18    PortableServer::POAManager_var pman = poa-&gt;the_POAManager();</TT><TT>
+</TT><TT>19    pman-&gt;activate();</TT><TT>
+</TT><TT>20</TT><TT>
+</TT><TT>21    orb-&gt;run();</TT><TT>
+</TT><TT>22    orb-&gt;destroy();</TT><TT>
+</TT><TT>23    <B>return</B> 0;</TT><TT>
+</TT><TT>24  }</TT></DIV><BR>
+<BR>
 The stringified object reference is obtained by calling the ORB's
 <TT>object_to_string()</TT> function (line 13). This results in a
 string starting with the signature `IOR:' and followed by some
@@ -660,36 +657,36 @@
 address space. From the IOR, an object reference can be constructed.<BR>
 <BR>
 
-<H3><A NAME="htoc26">2.9.2</A>&nbsp;&nbsp;Client: Using a Stringified Object Reference</H3>
+<H3 CLASS="subsection"><A NAME="htoc26">2.9.2</A>&nbsp;&nbsp;Client: Using a Stringified Object Reference</H3>
 <A NAME="clnt2"></A>
 The stringified object reference is passed to the client as a
 command-line argument. The client uses the ORB's
 <TT>string_to_object()</TT> function to convert the string into a generic
 object reference (<TT>CORBA::Object_ptr</TT>). The relevant section of
 the code is reproduced below. The full listing (<TT>eg2_clt.cc</TT>) can
-be found at the end of this chapter.
-<PRE>
-try {
-  CORBA::Object_var obj = orb-&gt;string_to_object(argv[1]);
-  hello(obj);
-}
-catch(CORBA::COMM_FAILURE&amp; ex) {
-  ... // code to handle communication failure
-}
-</PRE>
-
-<H3><A NAME="htoc27">2.9.3</A>&nbsp;&nbsp;Catching System Exceptions</H3>
+be found at the end of this chapter.<BR>
+<BR>
+<DIV CLASS="lstlisting"><TT><B>try</B> {</TT><TT>
+</TT><TT>  CORBA::Object_var obj = orb-&gt;string_to_object(argv[1]);</TT><TT>
+</TT><TT>  hello(obj);</TT><TT>
+</TT><TT>}</TT><TT>
+</TT><TT><B>catch</B>(CORBA::TRANSIENT&amp;) {</TT><TT>
+</TT><TT>  ... <I>// code to handle transient exception...</I></TT><TT>
+</TT><TT>}</TT></DIV><BR>
+<BR>
+
+<H3 CLASS="subsection"><A NAME="htoc27">2.9.3</A>&nbsp;&nbsp;Catching System Exceptions</H3>
 When omniORB detects an error condition, it may raise a system
 exception. The CORBA specification defines a series of exceptions
 covering most of the error conditions that an ORB may encounter. The
 client may choose to catch these exceptions and recover from the error
-condition<SUP><A NAME="text9" HREF="#note9"><FONT SIZE=2>7</FONT></A></SUP>. For instance, the code fragment, shown in
-section&nbsp;<A HREF="#clnt2">2.9.217Client: Using a Stringified Object Referencesubsection.2.9.2</A>, catches the <TT>COMM_FAILURE</TT> system exception
-which indicates that communication with the object implementation in
-another address space has failed.<BR>
+condition<SUP><A NAME="text10" HREF="#note10">8</A></SUP>. For instance, the code fragment, shown in
+section&nbsp;<A HREF="#clnt2">2.9.2</A>, catches the <TT>TRANSIENT</TT> system exception
+which indicates that the object could not be contacted at the time of
+the call, usually meaning the server is not running.<BR>
 <BR>
 All system exceptions inherit from <TT>CORBA::SystemException</TT>. With
-compilers that properly support RTTI<SUP><A NAME="text10" HREF="#note10"><FONT SIZE=2>8</FONT></A></SUP>, a single catch of <TT>CORBA::SystemException</TT> will
+compilers that properly support RTTI<SUP><A NAME="text11" HREF="#note11">9</A></SUP>, a single catch of <TT>CORBA::SystemException</TT> will
 catch all the different system exceptions thrown by omniORB.<BR>
 <BR>
 When omniORB detects an internal error such as corrupt data or invalid
@@ -703,7 +700,7 @@
 application code, but they may be caused by bugs in omniORB.<BR>
 <BR>
 
-<H3><A NAME="htoc28">2.9.4</A>&nbsp;&nbsp;Lifetime of a CORBA object</H3>
+<H3 CLASS="subsection"><A NAME="htoc28">2.9.4</A>&nbsp;&nbsp;Lifetime of a CORBA object</H3>
 CORBA objects are either <I>transient</I> or <I>persistent</I>. The
 majority are transient, meaning that the lifetime of the CORBA object
 (as contacted through an object reference) is the same as the lifetime
@@ -711,7 +708,7 @@
 destruction of their servant object, the POA they were created in, and
 even their process. Persistent objects are, of course, only
 contactable when their associated servants are active, or can be
-activated by their POA with a servant manager<SUP><A NAME="text11" HREF="#note11"><FONT SIZE=2>9</FONT></A></SUP>. A reference to
+activated by their POA with a servant manager<SUP><A NAME="text12" HREF="#note12">10</A></SUP>. A reference to
 a persistent object can be published, and will remain valid even if
 the server process is restarted.<BR>
 <BR>
@@ -724,14 +721,14 @@
 names. Clients can bind to the object implementations at run time by
 asking the naming service to resolve the path names to the object
 references. CORBA defines a standard naming service, which is a
-component of the Common Object Services (COS)&nbsp;[<A HREF="omniORB013.html#corbaservices"><CITE>OMG98</CITE></A>],
+component of the Common Object Services (COS)&nbsp;[<A HREF="omniORB014.html#corbaservices"><CITE>OMG98</CITE></A>],
 that can be used for this purpose. The next section describes an
 example of how to use the COS Naming Service.<BR>
 <BR>
 <A NAME="toc13"></A>
-<H2><A NAME="htoc29">2.10</A>&nbsp;&nbsp;Example 3 --- Using the Naming Service</H2>
+<H2 CLASS="section"><A NAME="htoc29">2.10</A>&nbsp;&nbsp;Example 3 &mdash; Using the Naming Service</H2>
 In this example, the object implementation uses the Naming
-Service&nbsp;[<A HREF="omniORB013.html#corbaservices"><CITE>OMG98</CITE></A>] to pass on the object reference to the
+Service&nbsp;[<A HREF="omniORB014.html#corbaservices"><CITE>OMG98</CITE></A>] to pass on the object reference to the
 client. This method is far more practical than using stringified
 object references. The full listing of the object implementation
 (<TT>eg3_impl.cc</TT>) and the client (<TT>eg3_clt.cc</TT>) can be found
@@ -747,7 +744,7 @@
 <BR>
 Sequences of name components can be represented as a flat string,
 using `.' to separate the id and kind fields, and `/' to separate name
-components from each other<SUP><A NAME="text12" HREF="#note12"><FONT SIZE=2>10</FONT></A></SUP>. In our example, the Echo object
+components from each other<SUP><A NAME="text13" HREF="#note13">11</A></SUP>. In our example, the Echo object
 reference is bound to the stringified name
 `<TT>test.my_context/Echo.Object</TT>'.<BR>
 <BR>
@@ -760,40 +757,40 @@
 arbitrary choice as there is no standardised set of kind values.<BR>
 <BR>
 
-<H3><A NAME="htoc30">2.10.1</A>&nbsp;&nbsp;Obtaining the Root Context Object Reference</H3>
+<H3 CLASS="subsection"><A NAME="htoc30">2.10.1</A>&nbsp;&nbsp;Obtaining the Root Context Object Reference</H3>
 <A NAME="resolveinit"></A>
 The initial contact with the Naming Service can be established via the
 <I>root</I> context. The object reference to the root context is
 provided by the ORB and can be obtained by calling
 <TT>resolve_initial_references()</TT>. The following code fragment shows
-how it is used:
-<PRE>
-CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv);
-
-CORBA::Object_var initServ;
-initServ = orb-&gt;resolve_initial_references("NameService");
-
-CosNaming::NamingContext_var rootContext;
-rootContext = CosNaming::NamingContext::_narrow(initServ);
-</PRE>
+how it is used:<BR>
+<BR>
+<DIV CLASS="lstlisting"><TT>CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv);</TT><TT>
+</TT><TT>
+</TT><TT>CORBA::Object_var initServ;</TT><TT>
+</TT><TT>initServ = orb-&gt;resolve_initial_references("NameService");</TT><TT>
+</TT><TT>
+</TT><TT>CosNaming::NamingContext_var rootContext;</TT><TT>
+</TT><TT>rootContext = CosNaming::NamingContext::_narrow(initServ);</TT></DIV><BR>
+<BR>
 Remember, omniORB constructs its internal list of initial references
 at initialisation time using the information provided in the
-configuration file <TT>omniORB.cfg</TT>, or given on the command
+configuration file <TT>omniORB4.cfg</TT>, or given on the command
 line. If this file is not present, the internal list will be empty and
 <TT>resolve_initial_references()</TT> will raise a
 <TT>CORBA::ORB::InvalidName</TT> exception.<BR>
 <BR>
 
-<H3><A NAME="htoc31">2.10.2</A>&nbsp;&nbsp;The Naming Service Interface</H3>
+<H3 CLASS="subsection"><A NAME="htoc31">2.10.2</A>&nbsp;&nbsp;The Naming Service Interface</H3>
 It is beyond the scope of this chapter to describe in detail the
 Naming Service interface. You should consult the CORBA services
-specification&nbsp;[<A HREF="omniORB013.html#corbaservices"><CITE>OMG98</CITE></A>] (chapter 3). The code listed in
+specification&nbsp;[<A HREF="omniORB014.html#corbaservices"><CITE>OMG98</CITE></A>] (chapter 3). The code listed in
 <TT>eg3_impl.cc</TT> and <TT>eg3_clt.cc</TT> are good examples of how the
 service can be used. Please spend time to study the examples
 carefully.<BR>
 <BR>
 <A NAME="toc14"></A>
-<H2><A NAME="htoc32">2.11</A>&nbsp;&nbsp;Example 4 --- Using tie implementation templates</H2>
+<H2 CLASS="section"><A NAME="htoc32">2.11</A>&nbsp;&nbsp;Example 4 &mdash; Using tie implementation templates</H2>
 omniORB supports <I>tie</I> implementation templates as an alternative
 way of providing servant classes. If you use the <TT>-Wbtp</TT> option
 to omniidl, it generates an extra template class for each interface.
@@ -811,15 +808,15 @@
 <BR>
 Secondly, the instantiation of a CORBA object now involves creating an
 instance of the implementation class <EM>and</EM> an instance of the
-template. Here is the relevant code fragment:
-<PRE>
-class Echo_i { ... };
-
-Echo_i *myimpl = new Echo_i();
-POA_Echo_tie&lt;Echo_i&gt; myecho(myimpl);
-
-PortableServer::ObjectId_var myechoid = poa-&gt;activate_object(&amp;myecho);
-</PRE>
+template. Here is the relevant code fragment:<BR>
+<BR>
+<DIV CLASS="lstlisting"><TT><B>class</B> Echo_i { ... };</TT><TT>
+</TT><TT>
+</TT><TT>Echo_i *myimpl = <B>new</B> Echo_i();</TT><TT>
+</TT><TT>POA_Echo_tie&lt;Echo_i&gt; myecho(myimpl);</TT><TT>
+</TT><TT>
+</TT><TT>PortableServer::ObjectId_var myechoid = poa-&gt;activate_object(&amp;myecho);</TT></DIV><BR>
+<BR>
 For interface <TT>Echo</TT>, the name of its tie implementation template
 is <TT>POA_Echo_tie</TT>. The template parameter is the servant
 class that contains an implementation of each of the operations
@@ -831,831 +828,869 @@
 see the CORBA C++ mapping specification.<BR>
 <BR>
 <A NAME="toc15"></A>
-<H2><A NAME="htoc33">2.12</A>&nbsp;&nbsp;Source Listings</H2>
-
-<H3><A NAME="htoc34">2.12.1</A>&nbsp;&nbsp;eg1.cc</H3>
-<PRE>
-// eg1.cc - This is the source code of example 1 used in Chapter 2
-//          "The Basics" of the omniORB user guide.
-//
-//          In this example, both the object implementation and the
-//          client are in the same process.
-//
-// Usage: eg1
-//
-
-#include &lt;iostream.h&gt;
-#include &lt;echo.hh&gt;
-
-
-// This is the object implementation.
-
-class Echo_i : public POA_Echo,
-        public PortableServer::RefCountServantBase
-{
-public:
-  inline Echo_i() {}
-  virtual ~Echo_i() {}
-  virtual char* echoString(const char* mesg);
-};
-
-
-char* Echo_i::echoString(const char* mesg)
-{
-  return CORBA::string_dup(mesg);
-}
-
-//////////////////////////////////////////////////////////////////////
-
-// This function acts as a client to the object.
-
-static void hello(Echo_ptr e)
-{
-  if( CORBA::is_nil(e) ) {
-    cerr &lt;&lt; "hello: The object reference is nil!\n" &lt;&lt; endl;
-    return;
-  }
-
-  CORBA::String_var src = (const char*) "Hello!";
-  // String literals are (char*) rather than (const char*) on some
-  // old compilers.  Thus it is essential to cast to (const char*)
-  // here to ensure that the string is copied, so that the
-  // CORBA::String_var does not attempt to 'delete' the string
-  // literal.
-
-  CORBA::String_var dest = e-&gt;echoString(src);
-
-  cerr &lt;&lt; "I said, \"" &lt;&lt; (char*)src &lt;&lt; "\"." &lt;&lt; endl
-       &lt;&lt; "The Echo object replied, \"" &lt;&lt; (char*)dest &lt;&lt;"\"." &lt;&lt; endl;
-}
-
-//////////////////////////////////////////////////////////////////////
-
-int main(int argc, char** argv)
-{
-
-
-  try {
-    // Initialise the ORB.
-    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
-
-    // Obtain a reference to the root POA.
-    CORBA::Object_var obj = orb-&gt;resolve_initial_references("RootPOA");
-    PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
-
-      // We allocate the object on the heap.  Since this is a reference
-      // counted object, it will be deleted by the POA when it is no
-      // longer needed.
-    Echo_i* myecho = new Echo_i();
-
-    // Activate the object.  This tells the POA that this object is
-    // ready to accept requests.
-    PortableServer::ObjectId_var myechoid = poa-&gt;activate_object(myecho);
-
-      // Obtain a reference to the object.
-    Echo_var myechoref = myecho-&gt;_this();
-
-    // Decrement the reference count of the object implementation, so
-    // that it will be properly cleaned up when the POA has determined
-    // that it is no longer needed.
-    myecho-&gt;_remove_ref();
-
-    // Obtain a POAManager, and tell the POA to start accepting
-    // requests on its objects.
-    PortableServer::POAManager_var pman = poa-&gt;the_POAManager();
-    pman-&gt;activate();
-
-    // Do the client-side call.
-    hello(myechoref);
-
-    // Clean up all the resources.
-    orb-&gt;destroy();
-  }
-  catch(CORBA::COMM_FAILURE&amp; ex) {
-    cerr &lt;&lt; "Caught system exception COMM_FAILURE -- unable to contact the "
-         &lt;&lt; "object." &lt;&lt; endl;
-  }
-  catch(CORBA::SystemException&amp;) {
-    cerr &lt;&lt; "Caught CORBA::SystemException." &lt;&lt; endl;
-  }
-  catch(CORBA::Exception&amp;) {
-    cerr &lt;&lt; "Caught CORBA::Exception." &lt;&lt; endl;
-  }
-  catch(omniORB::fatalException&amp; fe) {
-    cerr &lt;&lt; "Caught omniORB::fatalException:" &lt;&lt; endl;
-    cerr &lt;&lt; "  file: " &lt;&lt; fe.file() &lt;&lt; endl;
-    cerr &lt;&lt; "  line: " &lt;&lt; fe.line() &lt;&lt; endl;
-    cerr &lt;&lt; "  mesg: " &lt;&lt; fe.errmsg() &lt;&lt; endl;
-  }
-  catch(...) {
-    cerr &lt;&lt; "Caught unknown exception." &lt;&lt; endl;
-  }
-
-  return 0;
-}
-</PRE>
-
-<H3><A NAME="htoc35">2.12.2</A>&nbsp;&nbsp;eg2_impl.cc</H3>
-<PRE>
-// eg2_impl.cc - This is the source code of example 2 used in Chapter 2
-//               "The Basics" of the omniORB user guide.
-//
-//               This is the object implementation.
-//
-// Usage: eg2_impl
-//
-//        On startup, the object reference is printed to cerr as a
-//        stringified IOR. This string should be used as the argument to 
-//        eg2_clt.
-//
-
-#include &lt;iostream.h&gt;
-#include &lt;echo.hh&gt;
-
-
-class Echo_i : public POA_Echo,
-        public PortableServer::RefCountServantBase
-{
-public:
-  inline Echo_i() {}
-  virtual ~Echo_i() {}
-  virtual char* echoString(const char* mesg);
-};
-
-
-char* Echo_i::echoString(const char* mesg)
-{
-  cerr &lt;&lt; "Upcall " &lt;&lt; mesg &lt;&lt; endl;
-  return CORBA::string_dup(mesg);
-}
-
-//////////////////////////////////////////////////////////////////////
-
-int main(int argc, char** argv)
-{
-  try {
-    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
-
-    CORBA::Object_var obj = orb-&gt;resolve_initial_references("RootPOA");
-    PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
-
-    Echo_i* myecho = new Echo_i();
-      
-    PortableServer::ObjectId_var myechoid = poa-&gt;activate_object(myecho);
-
-    // Obtain a reference to the object, and print it out as a
-    // stringified IOR.
-    obj = myecho-&gt;_this();
-    CORBA::String_var sior(orb-&gt;object_to_string(obj));
-    cerr &lt;&lt; "'" &lt;&lt; (char*)sior &lt;&lt; "'" &lt;&lt; endl;
-
-    myecho-&gt;_remove_ref();
-
-    PortableServer::POAManager_var pman = poa-&gt;the_POAManager();
-    pman-&gt;activate();
-
-    orb-&gt;run();
-  }
-  catch(CORBA::SystemException&amp;) {
-    cerr &lt;&lt; "Caught CORBA::SystemException." &lt;&lt; endl;
-  }
-  catch(CORBA::Exception&amp;) {
-    cerr &lt;&lt; "Caught CORBA::Exception." &lt;&lt; endl;
-  }
-  catch(omniORB::fatalException&amp; fe) {
-    cerr &lt;&lt; "Caught omniORB::fatalException:" &lt;&lt; endl;
-    cerr &lt;&lt; "  file: " &lt;&lt; fe.file() &lt;&lt; endl;
-    cerr &lt;&lt; "  line: " &lt;&lt; fe.line() &lt;&lt; endl;
-    cerr &lt;&lt; "  mesg: " &lt;&lt; fe.errmsg() &lt;&lt; endl;
-  }
-  catch(...) {
-    cerr &lt;&lt; "Caught unknown exception." &lt;&lt; endl;
-  }
-
-  return 0;
-}
-</PRE>
-
-<H3><A NAME="htoc36">2.12.3</A>&nbsp;&nbsp;eg2_clt.cc</H3>
-<PRE>
-// eg2_clt.cc - This is the source code of example 2 used in Chapter 2
-//              "The Basics" of the omniORB user guide.
-//
-//              This is the client. The object reference is given as a
-//              stringified IOR on the command line.
-//
-// Usage: eg2_clt &lt;object reference&gt;
-//
-
-#include &lt;iostream.h&gt;
-#include &lt;echo.hh&gt;
-
-
-static void hello(Echo_ptr e)
-{
-  CORBA::String_var src = (const char*) "Hello!";
-
-  CORBA::String_var dest = e-&gt;echoString(src);
-
-  cerr &lt;&lt; "I said, \"" &lt;&lt; (char*)src &lt;&lt; "\"." &lt;&lt; endl
-       &lt;&lt; "The Echo object replied, \"" &lt;&lt; (char*)dest &lt;&lt;"\"." &lt;&lt; endl;
-}
-
-//////////////////////////////////////////////////////////////////////
-
-int main(int argc, char** argv)
-{
-
-
-  try {
-    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
-
-    if( argc != 2 ) {
-      cerr &lt;&lt; "usage:  eg2_clt &lt;object reference&gt;" &lt;&lt; endl;
-      return 1;
-    }
-
-    CORBA::Object_var obj = orb-&gt;string_to_object(argv[1]);
-    Echo_var echoref = Echo::_narrow(obj);
-    if( CORBA::is_nil(echoref) ) {
-      cerr &lt;&lt; "Can't narrow reference to type Echo (or it was nil)." &lt;&lt; endl;
-      return 1;
-    }
-    for (CORBA::ULong count=0; count&lt;10; count++) 
-      hello(echoref);
-
-    orb-&gt;destroy();
-  }
-  catch(CORBA::COMM_FAILURE&amp; ex) {
-    cerr &lt;&lt; "Caught system exception COMM_FAILURE -- unable to contact the "
-         &lt;&lt; "object." &lt;&lt; endl;
-  }
-  catch(CORBA::SystemException&amp;) {
-    cerr &lt;&lt; "Caught a CORBA::SystemException." &lt;&lt; endl;
-  }
-  catch(CORBA::Exception&amp;) {
-    cerr &lt;&lt; "Caught CORBA::Exception." &lt;&lt; endl;
-  }
-  catch(omniORB::fatalException&amp; fe) {
-    cerr &lt;&lt; "Caught omniORB::fatalException:" &lt;&lt; endl;
-    cerr &lt;&lt; "  file: " &lt;&lt; fe.file() &lt;&lt; endl;
-    cerr &lt;&lt; "  line: " &lt;&lt; fe.line() &lt;&lt; endl;
-    cerr &lt;&lt; "  mesg: " &lt;&lt; fe.errmsg() &lt;&lt; endl;
-  }
-  catch(...) {
-    cerr &lt;&lt; "Caught unknown exception." &lt;&lt; endl;
-  }
-  return 0;
-}
-</PRE>
-
-<H3><A NAME="htoc37">2.12.4</A>&nbsp;&nbsp;eg3_impl.cc</H3>
-<PRE>
-// eg3_impl.cc - This is the source code of example 3 used in Chapter 2
-//               "The Basics" of the omniORB user guide.
-//
-//               This is the object implementation.
-//
-// Usage: eg3_impl
-//
-//        On startup, the object reference is registered with the
-//        COS naming service. The client uses the naming service to
-//        locate this object.
-//
-//        The name which the object is bound to is as follows:
-//              root  [context]
-//               |
-//              test  [context] kind [my_context]
-//               |
-//              Echo  [object]  kind [Object]
-//
-
-#include &lt;iostream.h&gt;
-#include &lt;echo.hh&gt;
-
-
-static CORBA::Boolean bindObjectToName(CORBA::ORB_ptr, CORBA::Object_ptr);
-
-
-class Echo_i : public POA_Echo,
-        public PortableServer::RefCountServantBase
-{
-public:
-  inline Echo_i() {}
-  virtual ~Echo_i() {}
-  virtual char* echoString(const char* mesg);
-};
-
-
-char* Echo_i::echoString(const char* mesg)
-{
-  return CORBA::string_dup(mesg);
-}
-
-//////////////////////////////////////////////////////////////////////
-
-int
-main(int argc, char **argv)
-{
-  try {
-    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
-
-    CORBA::Object_var obj = orb-&gt;resolve_initial_references("RootPOA");
-    PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
-
-    Echo_i* myecho = new Echo_i();
-
-    PortableServer::ObjectId_var myechoid = poa-&gt;activate_object(myecho);
-
-    // Obtain a reference to the object, and register it in
-    // the naming service.
-    obj = myecho-&gt;_this();
-
-    CORBA::String_var x;
-    x = orb-&gt;object_to_string(obj);
-    cerr &lt;&lt; x &lt;&lt; "\n";
-
-    if( !bindObjectToName(orb, obj) )
-      return 1;
-
-    myecho-&gt;_remove_ref();
-
-    PortableServer::POAManager_var pman = poa-&gt;the_POAManager();
-    pman-&gt;activate();
-
-    orb-&gt;run();
-  }
-  catch(CORBA::SystemException&amp;) {
-    cerr &lt;&lt; "Caught CORBA::SystemException." &lt;&lt; endl;
-  }
-  catch(CORBA::Exception&amp;) {
-    cerr &lt;&lt; "Caught CORBA::Exception." &lt;&lt; endl;
-  }
-  catch(omniORB::fatalException&amp; fe) {
-    cerr &lt;&lt; "Caught omniORB::fatalException:" &lt;&lt; endl;
-    cerr &lt;&lt; "  file: " &lt;&lt; fe.file() &lt;&lt; endl;
-    cerr &lt;&lt; "  line: " &lt;&lt; fe.line() &lt;&lt; endl;
-    cerr &lt;&lt; "  mesg: " &lt;&lt; fe.errmsg() &lt;&lt; endl;
-  }
-  catch(...) {
-    cerr &lt;&lt; "Caught unknown exception." &lt;&lt; endl;
-  }
-
-  return 0;
-}
-
-//////////////////////////////////////////////////////////////////////
-
-static CORBA::Boolean
-bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref)
-{
-  CosNaming::NamingContext_var rootContext;
-
-  try {
-    // Obtain a reference to the root context of the Name service:
-    CORBA::Object_var obj;
-    obj = orb-&gt;resolve_initial_references("NameService");
-
-    // Narrow the reference returned.
-    rootContext = CosNaming::NamingContext::_narrow(obj);
-    if( CORBA::is_nil(rootContext) ) {
-      cerr &lt;&lt; "Failed to narrow the root naming context." &lt;&lt; endl;
-      return 0;
-    }
-  }
-  catch(CORBA::ORB::InvalidName&amp; ex) {
-    // This should not happen!
-    cerr &lt;&lt; "Service required is invalid [does not exist]." &lt;&lt; endl;
-    return 0;
-  }
-
-  try {
-    // Bind a context called "test" to the root context:
-
-    CosNaming::Name contextName;
-    contextName.length(1);
-    contextName[0].id   = (const char*) "test";       // string copied
-    contextName[0].kind = (const char*) "my_context"; // string copied
-    // Note on kind: The kind field is used to indicate the type
-    // of the object. This is to avoid conventions such as that used
-    // by files (name.type -- e.g. test.ps = postscript etc.)
-
-    CosNaming::NamingContext_var testContext;
-    try {
-      // Bind the context to root.
-      testContext = rootContext-&gt;bind_new_context(contextName);
-    }
-    catch(CosNaming::NamingContext::AlreadyBound&amp; ex) {
-      // If the context already exists, this exception will be raised.
-      // In this case, just resolve the name and assign testContext
-      // to the object returned:
-      CORBA::Object_var obj;
-      obj = rootContext-&gt;resolve(contextName);
-      testContext = CosNaming::NamingContext::_narrow(obj);
-      if( CORBA::is_nil(testContext) ) {
-        cerr &lt;&lt; "Failed to narrow naming context." &lt;&lt; endl;
-        return 0;
-      }
-    }
-
-    // Bind objref with name Echo to the testContext:
-    CosNaming::Name objectName;
-    objectName.length(1);
-    objectName[0].id   = (const char*) "Echo";   // string copied
-    objectName[0].kind = (const char*) "Object"; // string copied
-
-    try {
-      testContext-&gt;bind(objectName, objref);
-    }
-    catch(CosNaming::NamingContext::AlreadyBound&amp; ex) {
-      testContext-&gt;rebind(objectName, objref);
-    }
-    // Note: Using rebind() will overwrite any Object previously bound
-    //       to /test/Echo with obj.
-    //       Alternatively, bind() can be used, which will raise a
-    //       CosNaming::NamingContext::AlreadyBound exception if the name
-    //       supplied is already bound to an object.
-
-    // Amendment: When using OrbixNames, it is necessary to first try bind
-    // and then rebind, as rebind on it's own will throw a NotFoundexception if
-    // the Name has not already been bound. [This is incorrect behaviour -
-    // it should just bind].
-  }
-  catch(CORBA::COMM_FAILURE&amp; ex) {
-    cerr &lt;&lt; "Caught system exception COMM_FAILURE -- unable to contact the "
-         &lt;&lt; "naming service." &lt;&lt; endl;
-    return 0;
-  }
-  catch(CORBA::SystemException&amp;) {
-    cerr &lt;&lt; "Caught a CORBA::SystemException while using the naming service."
-  &lt;&lt; endl;
-    return 0;
-  }
-
-  return 1;
-}
-</PRE>
-
-<H3><A NAME="htoc38">2.12.5</A>&nbsp;&nbsp;eg3_clt.cc</H3>
-<PRE>
-// eg3_clt.cc - This is the source code of example 3 used in Chapter 2
-//              "The Basics" of the omniORB user guide.
-//
-//              This is the client. It uses the COSS naming service
-//              to obtain the object reference.
-//
-// Usage: eg3_clt
-//
-//
-//        On startup, the client lookup the object reference from the
-//        COS naming service.
-//
-//        The name which the object is bound to is as follows:
-//              root  [context]
-//               |
-//              text  [context] kind [my_context]
-//               |
-//              Echo  [object]  kind [Object]
-//
-
-#include &lt;iostream.h&gt;
-#include &lt;echo.hh&gt;
-
-static CORBA::Object_ptr getObjectReference(CORBA::ORB_ptr orb);
-
-static void hello(Echo_ptr e)
-{
-  if( CORBA::is_nil(e) ) {
-    cerr &lt;&lt; "hello: The object reference is nil!\n" &lt;&lt; endl;
-    return;
-  }
-
-  CORBA::String_var src = (const char*) "Hello!";
-
-  CORBA::String_var dest = e-&gt;echoString(src);
-
-  cerr &lt;&lt; "I said, \"" &lt;&lt; (char*)src &lt;&lt; "\"." &lt;&lt; endl
-       &lt;&lt; "The Echo object replied, \"" &lt;&lt; (char*)dest &lt;&lt;"\"." &lt;&lt; endl;
-}
-
-//////////////////////////////////////////////////////////////////////
-
-int
-main (int argc, char **argv) 
-{
-  try {
-    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
-
-    CORBA::Object_var obj = getObjectReference(orb);
-
-    Echo_var echoref = Echo::_narrow(obj);
-
-    for (CORBA::ULong count=0; count &lt; 10; count++)
-      hello(echoref);
-
-    orb-&gt;destroy();
-  }
-  catch(CORBA::COMM_FAILURE&amp; ex) {
-    cerr &lt;&lt; "Caught system exception COMM_FAILURE -- unable to contact the "
-         &lt;&lt; "object." &lt;&lt; endl;
-  }
-  catch(CORBA::SystemException&amp;) {
-    cerr &lt;&lt; "Caught CORBA::SystemException." &lt;&lt; endl;
-  }
-  catch(CORBA::Exception&amp;) {
-    cerr &lt;&lt; "Caught CORBA::Exception." &lt;&lt; endl;
-  }
-  catch(omniORB::fatalException&amp; fe) {
-    cerr &lt;&lt; "Caught omniORB::fatalException:" &lt;&lt; endl;
-    cerr &lt;&lt; "  file: " &lt;&lt; fe.file() &lt;&lt; endl;
-    cerr &lt;&lt; "  line: " &lt;&lt; fe.line() &lt;&lt; endl;
-    cerr &lt;&lt; "  mesg: " &lt;&lt; fe.errmsg() &lt;&lt; endl;
-  }
-  catch(...) {
-    cerr &lt;&lt; "Caught unknown exception." &lt;&lt; endl;
-  }
-
-  return 0;
-}
-
-//////////////////////////////////////////////////////////////////////
-
-static CORBA::Object_ptr
-getObjectReference(CORBA::ORB_ptr orb)
-{
-  CosNaming::NamingContext_var rootContext;
-  
-  try {
-    // Obtain a reference to the root context of the Name service:
-    CORBA::Object_var obj;
-    obj = orb-&gt;resolve_initial_references("NameService");
-
-    // Narrow the reference returned.
-    rootContext = CosNaming::NamingContext::_narrow(obj);
-    if( CORBA::is_nil(rootContext) ) {
-      cerr &lt;&lt; "Failed to narrow the root naming context." &lt;&lt; endl;
-      return CORBA::Object::_nil();
-    }
-  }
-  catch(CORBA::ORB::InvalidName&amp; ex) {
-    // This should not happen!
-    cerr &lt;&lt; "Service required is invalid [does not exist]." &lt;&lt; endl;
-    return CORBA::Object::_nil();
-  }
-
-  // Create a name object, containing the name test/context:
-  CosNaming::Name name;
-  name.length(2);
-
-  name[0].id   = (const char*) "test";       // string copied
-  name[0].kind = (const char*) "my_context"; // string copied
-  name[1].id   = (const char*) "Echo";
-  name[1].kind = (const char*) "Object";
-  // Note on kind: The kind field is used to indicate the type
-  // of the object. This is to avoid conventions such as that used
-  // by files (name.type -- e.g. test.ps = postscript etc.)
-
-  try {
-    // Resolve the name to an object reference.
-    return rootContext-&gt;resolve(name);
-  }
-  catch(CosNaming::NamingContext::NotFound&amp; ex) {
-    // This exception is thrown if any of the components of the
-    // path [contexts or the object] aren't found:
-    cerr &lt;&lt; "Context not found." &lt;&lt; endl;
-  }
-  catch(CORBA::COMM_FAILURE&amp; ex) {
-    cerr &lt;&lt; "Caught system exception COMM_FAILURE -- unable to contact the "
-         &lt;&lt; "naming service." &lt;&lt; endl;
-  }
-  catch(CORBA::SystemException&amp;) {
-    cerr &lt;&lt; "Caught a CORBA::SystemException while using the naming service."
-  &lt;&lt; endl;
-  }
-
-  return CORBA::Object::_nil();
-}
-</PRE>
-
-<H3><A NAME="htoc39">2.12.6</A>&nbsp;&nbsp;eg3_tieimpl.cc</H3>
-<PRE>
-// eg3_tieimpl.cc - This example is similar to eg3_impl.cc except that
-//                  the tie implementation skeleton is used.
-//
-//               This is the object implementation.
-//
-// Usage: eg3_tieimpl
-//
-//        On startup, the object reference is registered with the 
-//        COS naming service. The client uses the naming service to
-//        locate this object.
-//
-//        The name which the object is bound to is as follows:
-//              root  [context]
-//               |
-//              test  [context] kind [my_context]
-//               |
-//              Echo  [object]  kind [Object]
-//
-
-#include &lt;iostream.h&gt;
-#include &lt;echo.hh&gt;
-
-
-static CORBA::Boolean bindObjectToName(CORBA::ORB_ptr,CORBA::Object_ptr);
-
-
-// This is the object implementation.  Notice that it does not
-// inherit from any stub class.
-
-class Echo_i {
-public:
-  inline Echo_i() {}
-  inline ~Echo_i() {}
-  virtual char* echoString(const char* mesg);
-};
-
-
-char* Echo_i::echoString(const char* mesg)
-{
-  return CORBA::string_dup(mesg);
-}
-
-//////////////////////////////////////////////////////////////////////
-
-int main(int argc, char** argv)
-{
-  try {
-    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
-
-    CORBA::Object_var obj = orb-&gt;resolve_initial_references("RootPOA");
-    PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
-
-    // Note that the &lt;myecho&gt; object is constructed on the stack here.
-    // This is because tie implementations do not inherit from the
-    // PortableServer::RefCountServantBase mixin class -- and so are
-    // not automatically deleted by the POA.
-    // However, it will delete its implementation (myimpl) when it
-    // it itself destroyed (when it goes out of scope).  It is
-    // essential however to ensure that such objects are not deleted
-    // whilst still activated.
-    Echo_i* myimpl = new Echo_i();
-    POA_Echo_tie&lt;Echo_i&gt; myecho(myimpl);
-
-    PortableServer::ObjectId_var myechoid = poa-&gt;activate_object(&amp;myecho);
-
-    // Obtain a reference to the object, and register it in
-    // the naming service.
-    obj = myecho._this();
-    if( !bindObjectToName(orb, obj) )
-      return 1;
-
-    PortableServer::POAManager_var pman = poa-&gt;the_POAManager();
-    pman-&gt;activate();
-
-    orb-&gt;run();
-  }
-  catch(CORBA::SystemException&amp;) {
-    cerr &lt;&lt; "Caught CORBA::SystemException." &lt;&lt; endl;
-  }
-  catch(CORBA::Exception&amp;) {
-    cerr &lt;&lt; "Caught CORBA::Exception." &lt;&lt; endl;
-  }
-  catch(omniORB::fatalException&amp; fe) {
-    cerr &lt;&lt; "Caught omniORB::fatalException:" &lt;&lt; endl;
-    cerr &lt;&lt; "  file: " &lt;&lt; fe.file() &lt;&lt; endl;
-    cerr &lt;&lt; "  line: " &lt;&lt; fe.line() &lt;&lt; endl;
-    cerr &lt;&lt; "  mesg: " &lt;&lt; fe.errmsg() &lt;&lt; endl;
-  }
-  catch(...) {
-    cerr &lt;&lt; "Caught unknown exception." &lt;&lt; endl;
-  }
-
-  return 0;
-}
-
-//////////////////////////////////////////////////////////////////////
-
-static CORBA::Boolean
-bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref)
-{
-  CosNaming::NamingContext_var rootContext;
-
-  try {
-    // Obtain a reference to the root context of the Name service:
-    CORBA::Object_var obj;
-    obj = orb-&gt;resolve_initial_references("NameService");
-
-    // Narrow the reference returned.
-    rootContext = CosNaming::NamingContext::_narrow(obj);
-    if( CORBA::is_nil(rootContext) ) {
-      cerr &lt;&lt; "Failed to narrow the root naming context." &lt;&lt; endl;
-      return 0;
-    }
-  }
-  catch(CORBA::ORB::InvalidName&amp; ex) {
-    // This should not happen!
-    cerr &lt;&lt; "Service required is invalid [does not exist]." &lt;&lt; endl;
-    return 0;
-  }
-
-  try {
-    // Bind a context called "test" to the root context:
-
-    CosNaming::Name contextName;
-    contextName.length(1);
-    contextName[0].id   = (const char*) "test";       // string copied
-    contextName[0].kind = (const char*) "my_context"; // string copied
-    // Note on kind: The kind field is used to indicate the type
-    // of the object. This is to avoid conventions such as that used
-    // by files (name.type -- e.g. test.ps = postscript etc.)
-
-    CosNaming::NamingContext_var testContext;
-    try {
-      // Bind the context to root.
-      testContext = rootContext-&gt;bind_new_context(contextName);
-    }
-    catch(CosNaming::NamingContext::AlreadyBound&amp; ex) {
-      // If the context already exists, this exception will be raised.
-      // In this case, just resolve the name and assign testContext
-      // to the object returned:
-      CORBA::Object_var obj;
-      obj = rootContext-&gt;resolve(contextName);
-      testContext = CosNaming::NamingContext::_narrow(obj);
-      if( CORBA::is_nil(testContext) ) {
-        cerr &lt;&lt; "Failed to narrow naming context." &lt;&lt; endl;
-        return 0;
-      }
-    }
-
-    // Bind objref with name Echo to the testContext:
-    CosNaming::Name objectName;
-    objectName.length(1);
-    objectName[0].id   = (const char*) "Echo";   // string copied
-    objectName[0].kind = (const char*) "Object"; // string copied
-
-    try {
-      testContext-&gt;bind(objectName, objref);
-    }
-    catch(CosNaming::NamingContext::AlreadyBound&amp; ex) {
-      testContext-&gt;rebind(objectName, objref);
-    }
-    // Note: Using rebind() will overwrite any Object previously bound
-    //       to /test/Echo with obj.
-    //       Alternatively, bind() can be used, which will raise a
-    //       CosNaming::NamingContext::AlreadyBound exception if the name
-    //       supplied is already bound to an object.
-
-    // Amendment: When using OrbixNames, it is necessary to first try bind
-    // and then rebind, as rebind on it's own will throw a NotFoundexception if
-    // the Name has not already been bound. [This is incorrect behaviour -
-    // it should just bind].
-  }
-  catch(CORBA::COMM_FAILURE&amp; ex) {
-    cerr &lt;&lt; "Caught system exception COMM_FAILURE -- unable to contact the "
-         &lt;&lt; "naming service." &lt;&lt; endl;
-    return 0;
-  }
-  catch(CORBA::SystemException&amp;) {
-    cerr &lt;&lt; "Caught a CORBA::SystemException while using the naming service."
-  &lt;&lt; endl;
-    return 0;
-  }
-
-  return 1;
-}
-</PRE>
-<HR WIDTH="50%" SIZE=1><DL><DT><A NAME="note3" HREF="#text3"><FONT SIZE=5>1</FONT></A><DD>The stub
+<H2 CLASS="section"><A NAME="htoc33">2.12</A>&nbsp;&nbsp;Source Listings</H2>
+
+<H3 CLASS="subsection"><A NAME="htoc34">2.12.1</A>&nbsp;&nbsp;eg1.cc</H3><BR>
+<BR>
+<DIV CLASS="lstlisting"><TT><I>// eg1.cc - This is the source code of example 1 used in Chapter 2</I></TT><TT>
+</TT><TT><I>//          "The Basics" of the omniORB user guide.</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>//          In this example, both the object implementation and the</I></TT><TT>
+</TT><TT><I>//          client are in the same process.</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>// Usage: eg1</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT>
+</TT><TT><B>#include</B> &lt;echo.hh&gt;</TT><TT>
+</TT><TT>
+</TT><TT><B>#ifdef</B> HAVE_STD</TT><TT>
+</TT><TT><B>#  include</B> &lt;iostream&gt;</TT><TT>
+</TT><TT>   <B>using</B> <B>namespace</B> std;</TT><TT>
+</TT><TT><B>#else</B></TT><TT>
+</TT><TT><B>#  include</B> &lt;iostream.h&gt;</TT><TT>
+</TT><TT><B>#endif</B></TT><TT>
+</TT><TT>
+</TT><TT><I>// This is the object implementation.</I></TT><TT>
+</TT><TT>
+</TT><TT><B>class</B> Echo_i : <B>public</B> POA_Echo</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT><B>public</B>:</TT><TT>
+</TT><TT>  <B>inline</B> Echo_i() {}</TT><TT>
+</TT><TT>  <B>virtual</B> ~Echo_i() {}</TT><TT>
+</TT><TT>  <B>virtual</B> <B>char</B>* echoString(<B>const</B> <B>char</B>* mesg);</TT><TT>
+</TT><TT>};</TT><TT>
+</TT><TT>
+</TT><TT>
+</TT><TT><B>char</B>* Echo_i::echoString(<B>const</B> <B>char</B>* mesg)</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT>  <B>return</B> CORBA::string_dup(mesg);</TT><TT>
+</TT><TT>}</TT><TT>
+</TT><TT>
+</TT><TT>
+</TT><TT><I>//////////////////////////////////////////////////////////////////////</I></TT><TT>
+</TT><TT>
+</TT><TT><I>// This function acts as a client to the object.</I></TT><TT>
+</TT><TT>
+</TT><TT><B>static</B> <B>void</B> hello(Echo_ptr e)</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT>  <B>if</B>( CORBA::is_nil(e) ) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "hello: The object reference is nil!\n" &lt;&lt; endl;</TT><TT>
+</TT><TT>    <B>return</B>;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>
+</TT><TT>  CORBA::String_var src = (<B>const</B> <B>char</B>*) "Hello!";</TT><TT>
+</TT><TT>  <I>// String literals are (char*) rather than (const char*) on some</I></TT><TT>
+</TT><TT>  <I>// old compilers.  Thus it is essential to cast to (const char*)</I></TT><TT>
+</TT><TT>  <I>// here to ensure that the string is copied, so that the</I></TT><TT>
+</TT><TT>  <I>// CORBA::String_var does not attempt to 'delete' the string</I></TT><TT>
+</TT><TT>  <I>// literal.</I></TT><TT>
+</TT><TT>
+</TT><TT>  CORBA::String_var dest = e-&gt;echoString(src);</TT><TT>
+</TT><TT>
+</TT><TT>  cout &lt;&lt; "I said, \"" &lt;&lt; (<B>char</B>*)src &lt;&lt; "\"." &lt;&lt; endl</TT><TT>
+</TT><TT>       &lt;&lt; "The Echo object replied, \"" &lt;&lt; (<B>char</B>*)dest &lt;&lt;"\"." &lt;&lt; endl;</TT><TT>
+</TT><TT>}</TT><TT>
+</TT><TT>
+</TT><TT><I>//////////////////////////////////////////////////////////////////////</I></TT><TT>
+</TT><TT>
+</TT><TT><B>int</B> main(<B>int</B> argc, <B>char</B>** argv)</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT>
+</TT><TT>
+</TT><TT>  <B>try</B> {</TT><TT>
+</TT><TT>    <I>// Initialise the ORB.</I></TT><TT>
+</TT><TT>    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);</TT><TT>
+</TT><TT>
+</TT><TT>    <I>// Obtain a reference to the root POA.</I></TT><TT>
+</TT><TT>    CORBA::Object_var obj = orb-&gt;resolve_initial_references("RootPOA");</TT><TT>
+</TT><TT>    PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);</TT><TT>
+</TT><TT>
+</TT><TT>      <I>// We allocate the object on the heap.  Since this is a reference</I></TT><TT>
+</TT><TT>      <I>// counted object, it will be deleted by the POA when it is no</I></TT><TT>
+</TT><TT>      <I>// longer needed.</I></TT><TT>
+</TT><TT>    Echo_i* myecho = <B>new</B> Echo_i();</TT><TT>
+</TT><TT>
+</TT><TT>    <I>// Activate the object.  This tells the POA that this object is</I></TT><TT>
+</TT><TT>    <I>// ready to accept requests.</I></TT><TT>
+</TT><TT>    PortableServer::ObjectId_var myechoid = poa-&gt;activate_object(myecho);</TT><TT>
+</TT><TT>
+</TT><TT>      <I>// Obtain a reference to the object.</I></TT><TT>
+</TT><TT>    Echo_var myechoref = myecho-&gt;_this();</TT><TT>
+</TT><TT>
+</TT><TT>    <I>// Decrement the reference count of the object implementation, so</I></TT><TT>
+</TT><TT>    <I>// that it will be properly cleaned up when the POA has determined</I></TT><TT>
+</TT><TT>    <I>// that it is no longer needed.</I></TT><TT>
+</TT><TT>    myecho-&gt;_remove_ref();</TT><TT>
+</TT><TT>
+</TT><TT>    <I>// Obtain a POAManager, and tell the POA to start accepting</I></TT><TT>
+</TT><TT>    <I>// requests on its objects.</I></TT><TT>
+</TT><TT>    PortableServer::POAManager_var pman = poa-&gt;the_POAManager();</TT><TT>
+</TT><TT>    pman-&gt;activate();</TT><TT>
+</TT><TT>
+</TT><TT>    <I>// Do the client-side call.</I></TT><TT>
+</TT><TT>    hello(myechoref);</TT><TT>
+</TT><TT>
+</TT><TT>    <I>// Clean up all the resources.</I></TT><TT>
+</TT><TT>    orb-&gt;destroy();</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::SystemException&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught CORBA::" &lt;&lt; ex._name() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::Exception&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught CORBA::Exception: " &lt;&lt; ex._name() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(omniORB::fatalException&amp; fe) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught omniORB::fatalException:" &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  file: " &lt;&lt; fe.file() &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  line: " &lt;&lt; fe.line() &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  mesg: " &lt;&lt; fe.errmsg() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>return</B> 0;</TT><TT>
+</TT><TT>}</TT></DIV><BR>
+<BR>
+
+<H3 CLASS="subsection"><A NAME="htoc35">2.12.2</A>&nbsp;&nbsp;eg2_impl.cc</H3><BR>
+<BR>
+<DIV CLASS="lstlisting"><TT><I>// eg2_impl.cc - This is the source code of example 2 used in Chapter 2</I></TT><TT>
+</TT><TT><I>//               "The Basics" of the omniORB user guide.</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>//               This is the object implementation.</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>// Usage: eg2_impl</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>//        On startup, the object reference is printed to cerr as a</I></TT><TT>
+</TT><TT><I>//        stringified IOR. This string should be used as the argument to </I></TT><TT>
+</TT><TT><I>//        eg2_clt.</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT>
+</TT><TT><B>#include</B> &lt;echo.hh&gt;</TT><TT>
+</TT><TT>
+</TT><TT><B>#ifdef</B> HAVE_STD</TT><TT>
+</TT><TT><B>#  include</B> &lt;iostream&gt;</TT><TT>
+</TT><TT>   <B>using</B> <B>namespace</B> std;</TT><TT>
+</TT><TT><B>#else</B></TT><TT>
+</TT><TT><B>#  include</B> &lt;iostream.h&gt;</TT><TT>
+</TT><TT><B>#endif</B></TT><TT>
+</TT><TT>
+</TT><TT><B>class</B> Echo_i : <B>public</B> POA_Echo</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT><B>public</B>:</TT><TT>
+</TT><TT>  <B>inline</B> Echo_i() {}</TT><TT>
+</TT><TT>  <B>virtual</B> ~Echo_i() {}</TT><TT>
+</TT><TT>  <B>virtual</B> <B>char</B>* echoString(<B>const</B> <B>char</B>* mesg);</TT><TT>
+</TT><TT>};</TT><TT>
+</TT><TT>
+</TT><TT>
+</TT><TT><B>char</B>* Echo_i::echoString(<B>const</B> <B>char</B>* mesg)</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT>  cout &lt;&lt; "Upcall " &lt;&lt; mesg &lt;&lt; endl;</TT><TT>
+</TT><TT>  <B>return</B> CORBA::string_dup(mesg);</TT><TT>
+</TT><TT>}</TT><TT>
+</TT><TT>
+</TT><TT><I>//////////////////////////////////////////////////////////////////////</I></TT><TT>
+</TT><TT>
+</TT><TT><B>int</B> main(<B>int</B> argc, <B>char</B>** argv)</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT>  <B>try</B> {</TT><TT>
+</TT><TT>    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);</TT><TT>
+</TT><TT>
+</TT><TT>    CORBA::Object_var obj = orb-&gt;resolve_initial_references("RootPOA");</TT><TT>
+</TT><TT>    PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);</TT><TT>
+</TT><TT>
+</TT><TT>    Echo_i* myecho = <B>new</B> Echo_i();</TT><TT>
+</TT><TT>
+</TT><TT>    PortableServer::ObjectId_var myechoid = poa-&gt;activate_object(myecho);</TT><TT>
+</TT><TT>
+</TT><TT>    <I>// Obtain a reference to the object, and print it out as a</I></TT><TT>
+</TT><TT>    <I>// stringified IOR.</I></TT><TT>
+</TT><TT>    obj = myecho-&gt;_this();</TT><TT>
+</TT><TT>    CORBA::String_var sior(orb-&gt;object_to_string(obj));</TT><TT>
+</TT><TT>    cout &lt;&lt; (<B>char</B>*)sior &lt;&lt; endl;</TT><TT>
+</TT><TT>
+</TT><TT>    myecho-&gt;_remove_ref();</TT><TT>
+</TT><TT>
+</TT><TT>    PortableServer::POAManager_var pman = poa-&gt;the_POAManager();</TT><TT>
+</TT><TT>    pman-&gt;activate();</TT><TT>
+</TT><TT>
+</TT><TT>    orb-&gt;run();</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::SystemException&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught CORBA::" &lt;&lt; ex._name() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::Exception&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught CORBA::Exception: " &lt;&lt; ex._name() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(omniORB::fatalException&amp; fe) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught omniORB::fatalException:" &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  file: " &lt;&lt; fe.file() &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  line: " &lt;&lt; fe.line() &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  mesg: " &lt;&lt; fe.errmsg() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>return</B> 0;</TT><TT>
+</TT><TT>}</TT></DIV><BR>
+<BR>
+
+<H3 CLASS="subsection"><A NAME="htoc36">2.12.3</A>&nbsp;&nbsp;eg2_clt.cc</H3><BR>
+<BR>
+<DIV CLASS="lstlisting"><TT><I>// eg2_clt.cc - This is the source code of example 2 used in Chapter 2</I></TT><TT>
+</TT><TT><I>//              "The Basics" of the omniORB user guide.</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>//              This is the client. The object reference is given as a</I></TT><TT>
+</TT><TT><I>//              stringified IOR on the command line.</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>// Usage: eg2_clt &lt;object reference&gt;</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT>
+</TT><TT><B>#include</B> &lt;echo.hh&gt;</TT><TT>
+</TT><TT>
+</TT><TT><B>#ifdef</B> HAVE_STD</TT><TT>
+</TT><TT><B>#  include</B> &lt;iostream&gt;</TT><TT>
+</TT><TT><B>#  include</B> &lt;fstream&gt;</TT><TT>
+</TT><TT>   <B>using</B> <B>namespace</B> std;</TT><TT>
+</TT><TT><B>#else</B></TT><TT>
+</TT><TT><B>#  include</B> &lt;iostream.h&gt;</TT><TT>
+</TT><TT><B>#endif</B></TT><TT>
+</TT><TT>
+</TT><TT>
+</TT><TT><B>static</B> <B>void</B> hello(Echo_ptr e)</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT>  CORBA::String_var src = (<B>const</B> <B>char</B>*) "Hello!";</TT><TT>
+</TT><TT>
+</TT><TT>  CORBA::String_var dest = e-&gt;echoString(src);</TT><TT>
+</TT><TT>
+</TT><TT>  cout &lt;&lt; "I said, \"" &lt;&lt; (<B>char</B>*)src &lt;&lt; "\"." &lt;&lt; endl</TT><TT>
+</TT><TT>       &lt;&lt; "The Echo object replied, \"" &lt;&lt; (<B>char</B>*)dest &lt;&lt;"\"." &lt;&lt; endl;</TT><TT>
+</TT><TT>}</TT><TT>
+</TT><TT>
+</TT><TT><I>//////////////////////////////////////////////////////////////////////</I></TT><TT>
+</TT><TT>
+</TT><TT><B>int</B> main(<B>int</B> argc, <B>char</B>** argv)</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT>
+</TT><TT>
+</TT><TT>  <B>try</B> {</TT><TT>
+</TT><TT>    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);</TT><TT>
+</TT><TT>
+</TT><TT>    <B>if</B>( argc != 2 ) {</TT><TT>
+</TT><TT>      cerr &lt;&lt; "usage:  eg2_clt &lt;object reference&gt;" &lt;&lt; endl;</TT><TT>
+</TT><TT>      <B>return</B> 1;</TT><TT>
+</TT><TT>    }</TT><TT>
+</TT><TT>
+</TT><TT>    CORBA::Object_var obj = orb-&gt;string_to_object(argv[1]);</TT><TT>
+</TT><TT>    Echo_var echoref = Echo::_narrow(obj);</TT><TT>
+</TT><TT>    <B>if</B>( CORBA::is_nil(echoref) ) {</TT><TT>
+</TT><TT>      cerr &lt;&lt; "Can't narrow reference to type Echo (or it was nil)." &lt;&lt; endl;</TT><TT>
+</TT><TT>      <B>return</B> 1;</TT><TT>
+</TT><TT>    }</TT><TT>
+</TT><TT>    <B>for</B> (CORBA::ULong count=0; count&lt;10; count++)</TT><TT>
+</TT><TT>      hello(echoref);</TT><TT>
+</TT><TT>
+</TT><TT>    orb-&gt;destroy();</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::TRANSIENT&amp;) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught system exception TRANSIENT -- unable to contact the "</TT><TT>
+</TT><TT>         &lt;&lt; "server." &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::SystemException&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught a CORBA::" &lt;&lt; ex._name() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::Exception&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught CORBA::Exception: " &lt;&lt; ex._name() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(omniORB::fatalException&amp; fe) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught omniORB::fatalException:" &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  file: " &lt;&lt; fe.file() &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  line: " &lt;&lt; fe.line() &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  mesg: " &lt;&lt; fe.errmsg() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>return</B> 0;</TT><TT>
+</TT><TT>}</TT></DIV><BR>
+<BR>
+
+<H3 CLASS="subsection"><A NAME="htoc37">2.12.4</A>&nbsp;&nbsp;eg3_impl.cc</H3><BR>
+<BR>
+<DIV CLASS="lstlisting"><TT><I>// eg3_impl.cc - This is the source code of example 3 used in Chapter 2</I></TT><TT>
+</TT><TT><I>//               "The Basics" of the omniORB user guide.</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>//               This is the object implementation.</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>// Usage: eg3_impl</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>//        On startup, the object reference is registered with the</I></TT><TT>
+</TT><TT><I>//        COS naming service. The client uses the naming service to</I></TT><TT>
+</TT><TT><I>//        locate this object.</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>//        The name which the object is bound to is as follows:</I></TT><TT>
+</TT><TT><I>//              root  [context]</I></TT><TT>
+</TT><TT><I>//               |</I></TT><TT>
+</TT><TT><I>//              test  [context] kind [my_context]</I></TT><TT>
+</TT><TT><I>//               |</I></TT><TT>
+</TT><TT><I>//              Echo  [object]  kind [Object]</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT>
+</TT><TT><B>#include</B> &lt;echo.hh&gt;</TT><TT>
+</TT><TT>
+</TT><TT><B>#ifdef</B> HAVE_STD</TT><TT>
+</TT><TT><B>#  include</B> &lt;iostream&gt;</TT><TT>
+</TT><TT>   <B>using</B> <B>namespace</B> std;</TT><TT>
+</TT><TT><B>#else</B></TT><TT>
+</TT><TT><B>#  include</B> &lt;iostream.h&gt;</TT><TT>
+</TT><TT><B>#endif</B></TT><TT>
+</TT><TT>
+</TT><TT><B>static</B> CORBA::Boolean bindObjectToName(CORBA::ORB_ptr, CORBA::Object_ptr);</TT><TT>
+</TT><TT>
+</TT><TT>
+</TT><TT><B>class</B> Echo_i : <B>public</B> POA_Echo</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT><B>public</B>:</TT><TT>
+</TT><TT>  <B>inline</B> Echo_i() {}</TT><TT>
+</TT><TT>  <B>virtual</B> ~Echo_i() {}</TT><TT>
+</TT><TT>  <B>virtual</B> <B>char</B>* echoString(<B>const</B> <B>char</B>* mesg);</TT><TT>
+</TT><TT>};</TT><TT>
+</TT><TT>
+</TT><TT>
+</TT><TT><B>char</B>* Echo_i::echoString(<B>const</B> <B>char</B>* mesg)</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT>  <B>return</B> CORBA::string_dup(mesg);</TT><TT>
+</TT><TT>}</TT><TT>
+</TT><TT>
+</TT><TT><I>//////////////////////////////////////////////////////////////////////</I></TT><TT>
+</TT><TT>
+</TT><TT><B>int</B></TT><TT>
+</TT><TT>main(<B>int</B> argc, <B>char</B> **argv)</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT>  <B>try</B> {</TT><TT>
+</TT><TT>    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);</TT><TT>
+</TT><TT>
+</TT><TT>    CORBA::Object_var obj = orb-&gt;resolve_initial_references("RootPOA");</TT><TT>
+</TT><TT>    PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);</TT><TT>
+</TT><TT>
+</TT><TT>    Echo_i* myecho = <B>new</B> Echo_i();</TT><TT>
+</TT><TT>
+</TT><TT>    PortableServer::ObjectId_var myechoid = poa-&gt;activate_object(myecho);</TT><TT>
+</TT><TT>
+</TT><TT>    <I>// Obtain a reference to the object, and register it in</I></TT><TT>
+</TT><TT>    <I>// the naming service.</I></TT><TT>
+</TT><TT>    obj = myecho-&gt;_this();</TT><TT>
+</TT><TT>
+</TT><TT>    CORBA::String_var x;</TT><TT>
+</TT><TT>    x = orb-&gt;object_to_string(obj);</TT><TT>
+</TT><TT>    cout &lt;&lt; x &lt;&lt; endl;</TT><TT>
+</TT><TT>
+</TT><TT>    <B>if</B>( !bindObjectToName(orb, obj) )</TT><TT>
+</TT><TT>      <B>return</B> 1;</TT><TT>
+</TT><TT>
+</TT><TT>    myecho-&gt;_remove_ref();</TT><TT>
+</TT><TT>
+</TT><TT>    PortableServer::POAManager_var pman = poa-&gt;the_POAManager();</TT><TT>
+</TT><TT>    pman-&gt;activate();</TT><TT>
+</TT><TT>
+</TT><TT>    orb-&gt;run();</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::SystemException&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught CORBA::" &lt;&lt; ex._name() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::Exception&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught CORBA::Exception: " &lt;&lt; ex._name() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(omniORB::fatalException&amp; fe) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught omniORB::fatalException:" &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  file: " &lt;&lt; fe.file() &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  line: " &lt;&lt; fe.line() &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  mesg: " &lt;&lt; fe.errmsg() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>return</B> 0;</TT><TT>
+</TT><TT>}</TT><TT>
+</TT><TT>
+</TT><TT><I>//////////////////////////////////////////////////////////////////////</I></TT><TT>
+</TT><TT>
+</TT><TT><B>static</B> CORBA::Boolean</TT><TT>
+</TT><TT>bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref)</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT>  CosNaming::NamingContext_var rootContext;</TT><TT>
+</TT><TT>
+</TT><TT>  <B>try</B> {</TT><TT>
+</TT><TT>    <I>// Obtain a reference to the root context of the Name service:</I></TT><TT>
+</TT><TT>    CORBA::Object_var obj;</TT><TT>
+</TT><TT>    obj = orb-&gt;resolve_initial_references("NameService");</TT><TT>
+</TT><TT>
+</TT><TT>    <I>// Narrow the reference returned.</I></TT><TT>
+</TT><TT>    rootContext = CosNaming::NamingContext::_narrow(obj);</TT><TT>
+</TT><TT>    <B>if</B>( CORBA::is_nil(rootContext) ) {</TT><TT>
+</TT><TT>      cerr &lt;&lt; "Failed to narrow the root naming context." &lt;&lt; endl;</TT><TT>
+</TT><TT>      <B>return</B> 0;</TT><TT>
+</TT><TT>    }</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B> (CORBA::NO_RESOURCES&amp;) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught NO_RESOURCES exception. You must configure omniORB "</TT><TT>
+</TT><TT>  &lt;&lt; "with the location" &lt;&lt; endl</TT><TT>
+</TT><TT>  &lt;&lt; "of the naming service." &lt;&lt; endl;</TT><TT>
+</TT><TT>    <B>return</B> 0;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B> (CORBA::ORB::InvalidName&amp;) {</TT><TT>
+</TT><TT>    <I>// This should not happen!</I></TT><TT>
+</TT><TT>    cerr &lt;&lt; "Service required is invalid [does not exist]." &lt;&lt; endl;</TT><TT>
+</TT><TT>    <B>return</B> 0;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>
+</TT><TT>  <B>try</B> {</TT><TT>
+</TT><TT>    <I>// Bind a context called "test" to the root context:</I></TT><TT>
+</TT><TT>
+</TT><TT>    CosNaming::Name contextName;</TT><TT>
+</TT><TT>    contextName.length(1);</TT><TT>
+</TT><TT>    contextName[0].id   = (<B>const</B> <B>char</B>*) "test";       <I>// string copied</I></TT><TT>
+</TT><TT>    contextName[0].kind = (<B>const</B> <B>char</B>*) "my_context"; <I>// string copied</I></TT><TT>
+</TT><TT>    <I>// Note on kind: The kind field is used to indicate the type</I></TT><TT>
+</TT><TT>    <I>// of the object. This is to avoid conventions such as that used</I></TT><TT>
+</TT><TT>    <I>// by files (name.type -- e.g. test.ps = postscript etc.)</I></TT><TT>
+</TT><TT>
+</TT><TT>    CosNaming::NamingContext_var testContext;</TT><TT>
+</TT><TT>    <B>try</B> {</TT><TT>
+</TT><TT>      <I>// Bind the context to root.</I></TT><TT>
+</TT><TT>      testContext = rootContext-&gt;bind_new_context(contextName);</TT><TT>
+</TT><TT>    }</TT><TT>
+</TT><TT>    <B>catch</B>(CosNaming::NamingContext::AlreadyBound&amp; ex) {</TT><TT>
+</TT><TT>      <I>// If the context already exists, this exception will be raised.</I></TT><TT>
+</TT><TT>      <I>// In this case, just resolve the name and assign testContext</I></TT><TT>
+</TT><TT>      <I>// to the object returned:</I></TT><TT>
+</TT><TT>      CORBA::Object_var obj;</TT><TT>
+</TT><TT>      obj = rootContext-&gt;resolve(contextName);</TT><TT>
+</TT><TT>      testContext = CosNaming::NamingContext::_narrow(obj);</TT><TT>
+</TT><TT>      <B>if</B>( CORBA::is_nil(testContext) ) {</TT><TT>
+</TT><TT>        cerr &lt;&lt; "Failed to narrow naming context." &lt;&lt; endl;</TT><TT>
+</TT><TT>        <B>return</B> 0;</TT><TT>
+</TT><TT>      }</TT><TT>
+</TT><TT>    }</TT><TT>
+</TT><TT>
+</TT><TT>    <I>// Bind objref with name Echo to the testContext:</I></TT><TT>
+</TT><TT>    CosNaming::Name objectName;</TT><TT>
+</TT><TT>    objectName.length(1);</TT><TT>
+</TT><TT>    objectName[0].id   = (<B>const</B> <B>char</B>*) "Echo";   <I>// string copied</I></TT><TT>
+</TT><TT>    objectName[0].kind = (<B>const</B> <B>char</B>*) "Object"; <I>// string copied</I></TT><TT>
+</TT><TT>
+</TT><TT>    <B>try</B> {</TT><TT>
+</TT><TT>      testContext-&gt;bind(objectName, objref);</TT><TT>
+</TT><TT>    }</TT><TT>
+</TT><TT>    <B>catch</B>(CosNaming::NamingContext::AlreadyBound&amp; ex) {</TT><TT>
+</TT><TT>      testContext-&gt;rebind(objectName, objref);</TT><TT>
+</TT><TT>    }</TT><TT>
+</TT><TT>    <I>// Note: Using rebind() will overwrite any Object previously bound</I></TT><TT>
+</TT><TT>    <I>//       to /test/Echo with obj.</I></TT><TT>
+</TT><TT>    <I>//       Alternatively, bind() can be used, which will raise a</I></TT><TT>
+</TT><TT>    <I>//       CosNaming::NamingContext::AlreadyBound exception if the name</I></TT><TT>
+</TT><TT>    <I>//       supplied is already bound to an object.</I></TT><TT>
+</TT><TT>
+</TT><TT>    <I>// Amendment: When using OrbixNames, it is necessary to first try bind</I></TT><TT>
+</TT><TT>    <I>// and then rebind, as rebind on it's own will throw a NotFoundexception if</I></TT><TT>
+</TT><TT>    <I>// the Name has not already been bound. [This is incorrect behaviour -</I></TT><TT>
+</TT><TT>    <I>// it should just bind].</I></TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::TRANSIENT&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught system exception TRANSIENT -- unable to contact the "</TT><TT>
+</TT><TT>         &lt;&lt; "naming service." &lt;&lt; endl</TT><TT>
+</TT><TT>  &lt;&lt; "Make sure the naming server is running and that omniORB is "</TT><TT>
+</TT><TT>  &lt;&lt; "configured correctly." &lt;&lt; endl;</TT><TT>
+</TT><TT>
+</TT><TT>    <B>return</B> 0;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::SystemException&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught a CORBA::" &lt;&lt; ex._name()</TT><TT>
+</TT><TT>  &lt;&lt; " while using the naming service." &lt;&lt; endl;</TT><TT>
+</TT><TT>    <B>return</B> 0;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>return</B> 1;</TT><TT>
+</TT><TT>}</TT></DIV><BR>
+<BR>
+
+<H3 CLASS="subsection"><A NAME="htoc38">2.12.5</A>&nbsp;&nbsp;eg3_clt.cc</H3><BR>
+<BR>
+<DIV CLASS="lstlisting"><TT><I>// eg3_clt.cc - This is the source code of example 3 used in Chapter 2</I></TT><TT>
+</TT><TT><I>//              "The Basics" of the omniORB user guide.</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>//              This is the client. It uses the COSS naming service</I></TT><TT>
+</TT><TT><I>//              to obtain the object reference.</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>// Usage: eg3_clt</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>//        On startup, the client lookup the object reference from the</I></TT><TT>
+</TT><TT><I>//        COS naming service.</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>//        The name which the object is bound to is as follows:</I></TT><TT>
+</TT><TT><I>//              root  [context]</I></TT><TT>
+</TT><TT><I>//               |</I></TT><TT>
+</TT><TT><I>//              text  [context] kind [my_context]</I></TT><TT>
+</TT><TT><I>//               |</I></TT><TT>
+</TT><TT><I>//              Echo  [object]  kind [Object]</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT>
+</TT><TT><B>#include</B> &lt;echo.hh&gt;</TT><TT>
+</TT><TT>
+</TT><TT><B>#ifdef</B> HAVE_STD</TT><TT>
+</TT><TT><B>#  include</B> &lt;iostream&gt;</TT><TT>
+</TT><TT>   <B>using</B> <B>namespace</B> std;</TT><TT>
+</TT><TT><B>#else</B></TT><TT>
+</TT><TT><B>#  include</B> &lt;iostream.h&gt;</TT><TT>
+</TT><TT><B>#endif</B></TT><TT>
+</TT><TT>
+</TT><TT><B>static</B> CORBA::Object_ptr getObjectReference(CORBA::ORB_ptr orb);</TT><TT>
+</TT><TT>
+</TT><TT><B>static</B> <B>void</B> hello(Echo_ptr e)</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT>  <B>if</B>( CORBA::is_nil(e) ) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "hello: The object reference is nil!\n" &lt;&lt; endl;</TT><TT>
+</TT><TT>    <B>return</B>;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>
+</TT><TT>  CORBA::String_var src = (<B>const</B> <B>char</B>*) "Hello!";</TT><TT>
+</TT><TT>
+</TT><TT>  CORBA::String_var dest = e-&gt;echoString(src);</TT><TT>
+</TT><TT>
+</TT><TT>  cerr &lt;&lt; "I said, \"" &lt;&lt; (<B>char</B>*)src &lt;&lt; "\"." &lt;&lt; endl</TT><TT>
+</TT><TT>       &lt;&lt; "The Echo object replied, \"" &lt;&lt; (<B>char</B>*)dest &lt;&lt;"\"." &lt;&lt; endl;</TT><TT>
+</TT><TT>}</TT><TT>
+</TT><TT>
+</TT><TT><I>//////////////////////////////////////////////////////////////////////</I></TT><TT>
+</TT><TT>
+</TT><TT><B>int</B></TT><TT>
+</TT><TT>main (<B>int</B> argc, <B>char</B> **argv)</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT>  <B>try</B> {</TT><TT>
+</TT><TT>    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);</TT><TT>
+</TT><TT>
+</TT><TT>    CORBA::Object_var obj = getObjectReference(orb);</TT><TT>
+</TT><TT>
+</TT><TT>    Echo_var echoref = Echo::_narrow(obj);</TT><TT>
+</TT><TT>
+</TT><TT>    <B>for</B> (CORBA::ULong count=0; count &lt; 10; count++)</TT><TT>
+</TT><TT>      hello(echoref);</TT><TT>
+</TT><TT>
+</TT><TT>    orb-&gt;destroy();</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::TRANSIENT&amp;) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught system exception TRANSIENT -- unable to contact the "</TT><TT>
+</TT><TT>         &lt;&lt; "server." &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::SystemException&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught a CORBA::" &lt;&lt; ex._name() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::Exception&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught CORBA::Exception: " &lt;&lt; ex._name() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(omniORB::fatalException&amp; fe) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught omniORB::fatalException:" &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  file: " &lt;&lt; fe.file() &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  line: " &lt;&lt; fe.line() &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  mesg: " &lt;&lt; fe.errmsg() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>return</B> 0;</TT><TT>
+</TT><TT>}</TT><TT>
+</TT><TT>
+</TT><TT><I>//////////////////////////////////////////////////////////////////////</I></TT><TT>
+</TT><TT>
+</TT><TT><B>static</B> CORBA::Object_ptr</TT><TT>
+</TT><TT>getObjectReference(CORBA::ORB_ptr orb)</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT>  CosNaming::NamingContext_var rootContext;</TT><TT>
+</TT><TT>
+</TT><TT>  <B>try</B> {</TT><TT>
+</TT><TT>    <I>// Obtain a reference to the root context of the Name service:</I></TT><TT>
+</TT><TT>    CORBA::Object_var obj;</TT><TT>
+</TT><TT>    obj = orb-&gt;resolve_initial_references("NameService");</TT><TT>
+</TT><TT>
+</TT><TT>    <I>// Narrow the reference returned.</I></TT><TT>
+</TT><TT>    rootContext = CosNaming::NamingContext::_narrow(obj);</TT><TT>
+</TT><TT>    <B>if</B>( CORBA::is_nil(rootContext) ) {</TT><TT>
+</TT><TT>      cerr &lt;&lt; "Failed to narrow the root naming context." &lt;&lt; endl;</TT><TT>
+</TT><TT>      <B>return</B> CORBA::Object::_nil();</TT><TT>
+</TT><TT>    }</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B> (CORBA::NO_RESOURCES&amp;) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught NO_RESOURCES exception. You must configure omniORB "</TT><TT>
+</TT><TT>  &lt;&lt; "with the location" &lt;&lt; endl</TT><TT>
+</TT><TT>  &lt;&lt; "of the naming service." &lt;&lt; endl;</TT><TT>
+</TT><TT>    <B>return</B> 0;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::ORB::InvalidName&amp; ex) {</TT><TT>
+</TT><TT>    <I>// This should not happen!</I></TT><TT>
+</TT><TT>    cerr &lt;&lt; "Service required is invalid [does not exist]." &lt;&lt; endl;</TT><TT>
+</TT><TT>    <B>return</B> CORBA::Object::_nil();</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>
+</TT><TT>  <I>// Create a name object, containing the name test/context:</I></TT><TT>
+</TT><TT>  CosNaming::Name name;</TT><TT>
+</TT><TT>  name.length(2);</TT><TT>
+</TT><TT>
+</TT><TT>  name[0].id   = (<B>const</B> <B>char</B>*) "test";       <I>// string copied</I></TT><TT>
+</TT><TT>  name[0].kind = (<B>const</B> <B>char</B>*) "my_context"; <I>// string copied</I></TT><TT>
+</TT><TT>  name[1].id   = (<B>const</B> <B>char</B>*) "Echo";</TT><TT>
+</TT><TT>  name[1].kind = (<B>const</B> <B>char</B>*) "Object";</TT><TT>
+</TT><TT>  <I>// Note on kind: The kind field is used to indicate the type</I></TT><TT>
+</TT><TT>  <I>// of the object. This is to avoid conventions such as that used</I></TT><TT>
+</TT><TT>  <I>// by files (name.type -- e.g. test.ps = postscript etc.)</I></TT><TT>
+</TT><TT>
+</TT><TT>  <B>try</B> {</TT><TT>
+</TT><TT>    <I>// Resolve the name to an object reference.</I></TT><TT>
+</TT><TT>    <B>return</B> rootContext-&gt;resolve(name);</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CosNaming::NamingContext::NotFound&amp; ex) {</TT><TT>
+</TT><TT>    <I>// This exception is thrown if any of the components of the</I></TT><TT>
+</TT><TT>    <I>// path [contexts or the object] aren't found:</I></TT><TT>
+</TT><TT>    cerr &lt;&lt; "Context not found." &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::TRANSIENT&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught system exception TRANSIENT -- unable to contact the "</TT><TT>
+</TT><TT>         &lt;&lt; "naming service." &lt;&lt; endl</TT><TT>
+</TT><TT>  &lt;&lt; "Make sure the naming server is running and that omniORB is "</TT><TT>
+</TT><TT>  &lt;&lt; "configured correctly." &lt;&lt; endl;</TT><TT>
+</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::SystemException&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught a CORBA::" &lt;&lt; ex._name()</TT><TT>
+</TT><TT>  &lt;&lt; " while using the naming service." &lt;&lt; endl;</TT><TT>
+</TT><TT>    <B>return</B> 0;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>
+</TT><TT>  <B>return</B> CORBA::Object::_nil();</TT><TT>
+</TT><TT>}</TT></DIV><BR>
+<BR>
+
+<H3 CLASS="subsection"><A NAME="htoc39">2.12.6</A>&nbsp;&nbsp;eg3_tieimpl.cc</H3><BR>
+<BR>
+<DIV CLASS="lstlisting"><TT><I>// eg3_tieimpl.cc - This example is similar to eg3_impl.cc except that</I></TT><TT>
+</TT><TT><I>//                  the tie implementation skeleton is used.</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>//               This is the object implementation.</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>// Usage: eg3_tieimpl</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>//        On startup, the object reference is registered with the </I></TT><TT>
+</TT><TT><I>//        COS naming service. The client uses the naming service to</I></TT><TT>
+</TT><TT><I>//        locate this object.</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT><I>//        The name which the object is bound to is as follows:</I></TT><TT>
+</TT><TT><I>//              root  [context]</I></TT><TT>
+</TT><TT><I>//               |</I></TT><TT>
+</TT><TT><I>//              test  [context] kind [my_context]</I></TT><TT>
+</TT><TT><I>//               |</I></TT><TT>
+</TT><TT><I>//              Echo  [object]  kind [Object]</I></TT><TT>
+</TT><TT><I>//</I></TT><TT>
+</TT><TT>
+</TT><TT><B>#include</B> &lt;echo.hh&gt;</TT><TT>
+</TT><TT>
+</TT><TT><B>#ifdef</B> HAVE_STD</TT><TT>
+</TT><TT><B>#  include</B> &lt;iostream&gt;</TT><TT>
+</TT><TT>   <B>using</B> <B>namespace</B> std;</TT><TT>
+</TT><TT><B>#else</B></TT><TT>
+</TT><TT><B>#  include</B> &lt;iostream.h&gt;</TT><TT>
+</TT><TT><B>#endif</B></TT><TT>
+</TT><TT>
+</TT><TT><B>static</B> CORBA::Boolean bindObjectToName(CORBA::ORB_ptr,CORBA::Object_ptr);</TT><TT>
+</TT><TT>
+</TT><TT>
+</TT><TT><I>// This is the object implementation.  Notice that it does not inherit</I></TT><TT>
+</TT><TT><I>// from any stub class, and notice that the echoString() member</I></TT><TT>
+</TT><TT><I>// function does not have to be virtual.</I></TT><TT>
+</TT><TT>
+</TT><TT><B>class</B> Echo_i {</TT><TT>
+</TT><TT><B>public</B>:</TT><TT>
+</TT><TT>  <B>inline</B> Echo_i() {}</TT><TT>
+</TT><TT>  <B>inline</B> ~Echo_i() {}</TT><TT>
+</TT><TT>  <B>char</B>* echoString(<B>const</B> <B>char</B>* mesg);</TT><TT>
+</TT><TT>};</TT><TT>
+</TT><TT>
+</TT><TT>
+</TT><TT><B>char</B>* Echo_i::echoString(<B>const</B> <B>char</B>* mesg)</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT>  <B>return</B> CORBA::string_dup(mesg);</TT><TT>
+</TT><TT>}</TT><TT>
+</TT><TT>
+</TT><TT><I>//////////////////////////////////////////////////////////////////////</I></TT><TT>
+</TT><TT>
+</TT><TT><B>int</B> main(<B>int</B> argc, <B>char</B>** argv)</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT>  <B>try</B> {</TT><TT>
+</TT><TT>    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);</TT><TT>
+</TT><TT>
+</TT><TT>    CORBA::Object_var obj = orb-&gt;resolve_initial_references("RootPOA");</TT><TT>
+</TT><TT>    PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);</TT><TT>
+</TT><TT>
+</TT><TT>    <I>// Note that the &lt;myecho&gt; tie object is constructed on the stack</I></TT><TT>
+</TT><TT>    <I>// here. It will delete its implementation (myimpl) when it it</I></TT><TT>
+</TT><TT>    <I>// itself destroyed (when it goes out of scope).  It is essential</I></TT><TT>
+</TT><TT>    <I>// however to ensure that such servants are not deleted whilst</I></TT><TT>
+</TT><TT>    <I>// still activated.</I></TT><TT>
+</TT><TT>    <I>//</I></TT><TT>
+</TT><TT>    <I>// Tie objects can of course be allocated on the heap using new,</I></TT><TT>
+</TT><TT>    <I>// in which case they are deleted when their reference count</I></TT><TT>
+</TT><TT>    <I>// becomes zero, as with any other servant object.</I></TT><TT>
+</TT><TT>    Echo_i* myimpl = <B>new</B> Echo_i();</TT><TT>
+</TT><TT>    POA_Echo_tie&lt;Echo_i&gt; myecho(myimpl);</TT><TT>
+</TT><TT>
+</TT><TT>    PortableServer::ObjectId_var myechoid = poa-&gt;activate_object(&amp;myecho);</TT><TT>
+</TT><TT>
+</TT><TT>    <I>// Obtain a reference to the object, and register it in</I></TT><TT>
+</TT><TT>    <I>// the naming service.</I></TT><TT>
+</TT><TT>    obj = myecho._this();</TT><TT>
+</TT><TT>    <B>if</B>( !bindObjectToName(orb, obj) )</TT><TT>
+</TT><TT>      <B>return</B> 1;</TT><TT>
+</TT><TT>
+</TT><TT>    PortableServer::POAManager_var pman = poa-&gt;the_POAManager();</TT><TT>
+</TT><TT>    pman-&gt;activate();</TT><TT>
+</TT><TT>
+</TT><TT>    orb-&gt;run();</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::SystemException&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught CORBA::" &lt;&lt; ex._name() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::Exception&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught CORBA::Exception: " &lt;&lt; ex._name() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(omniORB::fatalException&amp; fe) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught omniORB::fatalException:" &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  file: " &lt;&lt; fe.file() &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  line: " &lt;&lt; fe.line() &lt;&lt; endl;</TT><TT>
+</TT><TT>    cerr &lt;&lt; "  mesg: " &lt;&lt; fe.errmsg() &lt;&lt; endl;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>return</B> 0;</TT><TT>
+</TT><TT>}</TT><TT>
+</TT><TT>
+</TT><TT><I>//////////////////////////////////////////////////////////////////////</I></TT><TT>
+</TT><TT>
+</TT><TT><B>static</B> CORBA::Boolean</TT><TT>
+</TT><TT>bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref)</TT><TT>
+</TT><TT>{</TT><TT>
+</TT><TT>  CosNaming::NamingContext_var rootContext;</TT><TT>
+</TT><TT>
+</TT><TT>  <B>try</B> {</TT><TT>
+</TT><TT>    <I>// Obtain a reference to the root context of the Name service:</I></TT><TT>
+</TT><TT>    CORBA::Object_var obj;</TT><TT>
+</TT><TT>    obj = orb-&gt;resolve_initial_references("NameService");</TT><TT>
+</TT><TT>
+</TT><TT>    <I>// Narrow the reference returned.</I></TT><TT>
+</TT><TT>    rootContext = CosNaming::NamingContext::_narrow(obj);</TT><TT>
+</TT><TT>    <B>if</B>( CORBA::is_nil(rootContext) ) {</TT><TT>
+</TT><TT>      cerr &lt;&lt; "Failed to narrow the root naming context." &lt;&lt; endl;</TT><TT>
+</TT><TT>      <B>return</B> 0;</TT><TT>
+</TT><TT>    }</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B> (CORBA::NO_RESOURCES&amp;) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught NO_RESOURCES exception. You must configure omniORB "</TT><TT>
+</TT><TT>  &lt;&lt; "with the location" &lt;&lt; endl</TT><TT>
+</TT><TT>  &lt;&lt; "of the naming service." &lt;&lt; endl;</TT><TT>
+</TT><TT>    <B>return</B> 0;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B> (CORBA::ORB::InvalidName&amp;) {</TT><TT>
+</TT><TT>    <I>// This should not happen!</I></TT><TT>
+</TT><TT>    cerr &lt;&lt; "Service required is invalid [does not exist]." &lt;&lt; endl;</TT><TT>
+</TT><TT>    <B>return</B> 0;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>
+</TT><TT>  <B>try</B> {</TT><TT>
+</TT><TT>    <I>// Bind a context called "test" to the root context:</I></TT><TT>
+</TT><TT>
+</TT><TT>    CosNaming::Name contextName;</TT><TT>
+</TT><TT>    contextName.length(1);</TT><TT>
+</TT><TT>    contextName[0].id   = (<B>const</B> <B>char</B>*) "test";       <I>// string copied</I></TT><TT>
+</TT><TT>    contextName[0].kind = (<B>const</B> <B>char</B>*) "my_context"; <I>// string copied</I></TT><TT>
+</TT><TT>    <I>// Note on kind: The kind field is used to indicate the type</I></TT><TT>
+</TT><TT>    <I>// of the object. This is to avoid conventions such as that used</I></TT><TT>
+</TT><TT>    <I>// by files (name.type -- e.g. test.ps = postscript etc.)</I></TT><TT>
+</TT><TT>
+</TT><TT>    CosNaming::NamingContext_var testContext;</TT><TT>
+</TT><TT>    <B>try</B> {</TT><TT>
+</TT><TT>      <I>// Bind the context to root.</I></TT><TT>
+</TT><TT>      testContext = rootContext-&gt;bind_new_context(contextName);</TT><TT>
+</TT><TT>    }</TT><TT>
+</TT><TT>    <B>catch</B>(CosNaming::NamingContext::AlreadyBound&amp; ex) {</TT><TT>
+</TT><TT>      <I>// If the context already exists, this exception will be raised.</I></TT><TT>
+</TT><TT>      <I>// In this case, just resolve the name and assign testContext</I></TT><TT>
+</TT><TT>      <I>// to the object returned:</I></TT><TT>
+</TT><TT>      CORBA::Object_var obj;</TT><TT>
+</TT><TT>      obj = rootContext-&gt;resolve(contextName);</TT><TT>
+</TT><TT>      testContext = CosNaming::NamingContext::_narrow(obj);</TT><TT>
+</TT><TT>      <B>if</B>( CORBA::is_nil(testContext) ) {</TT><TT>
+</TT><TT>        cerr &lt;&lt; "Failed to narrow naming context." &lt;&lt; endl;</TT><TT>
+</TT><TT>        <B>return</B> 0;</TT><TT>
+</TT><TT>      }</TT><TT>
+</TT><TT>    }</TT><TT>
+</TT><TT>
+</TT><TT>    <I>// Bind objref with name Echo to the testContext:</I></TT><TT>
+</TT><TT>    CosNaming::Name objectName;</TT><TT>
+</TT><TT>    objectName.length(1);</TT><TT>
+</TT><TT>    objectName[0].id   = (<B>const</B> <B>char</B>*) "Echo";   <I>// string copied</I></TT><TT>
+</TT><TT>    objectName[0].kind = (<B>const</B> <B>char</B>*) "Object"; <I>// string copied</I></TT><TT>
+</TT><TT>
+</TT><TT>    <B>try</B> {</TT><TT>
+</TT><TT>      testContext-&gt;bind(objectName, objref);</TT><TT>
+</TT><TT>    }</TT><TT>
+</TT><TT>    <B>catch</B>(CosNaming::NamingContext::AlreadyBound&amp; ex) {</TT><TT>
+</TT><TT>      testContext-&gt;rebind(objectName, objref);</TT><TT>
+</TT><TT>    }</TT><TT>
+</TT><TT>    <I>// Note: Using rebind() will overwrite any Object previously bound</I></TT><TT>
+</TT><TT>    <I>//       to /test/Echo with obj.</I></TT><TT>
+</TT><TT>    <I>//       Alternatively, bind() can be used, which will raise a</I></TT><TT>
+</TT><TT>    <I>//       CosNaming::NamingContext::AlreadyBound exception if the name</I></TT><TT>
+</TT><TT>    <I>//       supplied is already bound to an object.</I></TT><TT>
+</TT><TT>
+</TT><TT>    <I>// Amendment: When using OrbixNames, it is necessary to first try bind</I></TT><TT>
+</TT><TT>    <I>// and then rebind, as rebind on it's own will throw a NotFoundexception if</I></TT><TT>
+</TT><TT>    <I>// the Name has not already been bound. [This is incorrect behaviour -</I></TT><TT>
+</TT><TT>    <I>// it should just bind].</I></TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::TRANSIENT&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught system exception TRANSIENT -- unable to contact the "</TT><TT>
+</TT><TT>         &lt;&lt; "naming service." &lt;&lt; endl</TT><TT>
+</TT><TT>  &lt;&lt; "Make sure the naming server is running and that omniORB is "</TT><TT>
+</TT><TT>  &lt;&lt; "configured correctly." &lt;&lt; endl;</TT><TT>
+</TT><TT>
+</TT><TT>    <B>return</B> 0;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>catch</B>(CORBA::SystemException&amp; ex) {</TT><TT>
+</TT><TT>    cerr &lt;&lt; "Caught a CORBA::" &lt;&lt; ex._name()</TT><TT>
+</TT><TT>  &lt;&lt; " while using the naming service." &lt;&lt; endl;</TT><TT>
+</TT><TT>    <B>return</B> 0;</TT><TT>
+</TT><TT>  }</TT><TT>
+</TT><TT>  <B>return</B> 1;</TT><TT>
+</TT><TT>}</TT></DIV><BR>
+<BR>
+<HR WIDTH="50%" SIZE=1><DL CLASS="list"><DT CLASS="dt-list"><A NAME="note3" HREF="#text3"><FONT SIZE=5>1</FONT></A><DD CLASS="dd-list">The stub
 code is the C++ code that provides the object mapping as defined in
 the CORBA specification.
-<DT><A NAME="note4" HREF="#text4"><FONT SIZE=5>2</FONT></A><DD>In
+<DT CLASS="dt-list"><A NAME="note4" HREF="#text4"><FONT SIZE=5>2</FONT></A><DD CLASS="dd-list">In
 omniORB, all object reference variable types are instantiated from the
 template type <TT>_CORBA_ObjRef_Var</TT>.
-<DT><A NAME="note5" HREF="#text5"><FONT SIZE=5>3</FONT></A><DD>However, the implementation
+<DT CLASS="dt-list"><A NAME="note5" HREF="#text5"><FONT SIZE=5>3</FONT></A><DD CLASS="dd-list">However, the implementation
 of the type conversion operator between <TT>Echo_var</TT> and
 <TT>Echo_ptr</TT> varies slightly among different C++ compilers; you
 may need to do an explicit cast if the compiler complains about the
 conversion being ambiguous.
-<DT><A NAME="note6" HREF="#text6"><FONT SIZE=5>4</FONT></A><DD>A conversion operator of
+<DT CLASS="dt-list"><A NAME="note6" HREF="#text6"><FONT SIZE=5>4</FONT></A><DD CLASS="dd-list">In the previous 1.0 version of the C++
+mapping, servant reference counting was optional, chosen by inheriting
+from a mixin class named <TT>RefCountServantBase</TT>. That has been
+deprecated in the 1.1 version of the C++ mapping, but the class is
+still available as an empty struct, so existing code that inherits
+from <TT>RefCountServantBase</TT> will continue to work.
+<DT CLASS="dt-list"><A NAME="note7" HREF="#text7"><FONT SIZE=5>5</FONT></A><DD CLASS="dd-list">A conversion operator of
 <TT>CORBA::String_var</TT> converts a <TT>CORBA::String_var</TT>
 to a <TT>char*</TT>.
-<DT><A NAME="note7" HREF="#text7"><FONT SIZE=5>5</FONT></A><DD>Please refer to the C++
+<DT CLASS="dt-list"><A NAME="note8" HREF="#text8"><FONT SIZE=5>6</FONT></A><DD CLASS="dd-list">Please refer to the C++
 mapping specification for details of the String_var mapping.
-<DT><A NAME="note8" HREF="#text8"><FONT SIZE=5>6</FONT></A><DD>For backwards compatibility, the ORB identifiers
+<DT CLASS="dt-list"><A NAME="note9" HREF="#text9"><FONT SIZE=5>7</FONT></A><DD CLASS="dd-list">For backwards compatibility, the ORB identifiers
 `omniORB2' and `omniORB3' are also accepted.
-<DT><A NAME="note9" HREF="#text9"><FONT SIZE=5>7</FONT></A><DD>If a system exception is not caught, the C++
+<DT CLASS="dt-list"><A NAME="note10" HREF="#text10"><FONT SIZE=5>8</FONT></A><DD CLASS="dd-list">If a system exception is not caught, the C++
 runtime will call the <TT>terminate()</TT> function. This function is
 defaulted to abort the whole process and on some systems will cause a
 core file to be produced.
-<DT><A NAME="note10" HREF="#text10"><FONT SIZE=5>8</FONT></A><DD>Run Time Type
+<DT CLASS="dt-list"><A NAME="note11" HREF="#text11"><FONT SIZE=5>9</FONT></A><DD CLASS="dd-list">Run Time Type
 Identification
-<DT><A NAME="note11" HREF="#text11"><FONT SIZE=5>9</FONT></A><DD>The POA itself
+<DT CLASS="dt-list"><A NAME="note12" HREF="#text12"><FONT SIZE=5>10</FONT></A><DD CLASS="dd-list">The POA itself
 can be activated on demand with an adapter activator.
-<DT><A NAME="note12" HREF="#text12"><FONT SIZE=5>10</FONT></A><DD>There are escaping rules to cope
+<DT CLASS="dt-list"><A NAME="note13" HREF="#text13"><FONT SIZE=5>11</FONT></A><DD CLASS="dd-list">There are escaping rules to cope
 with id and kind fields which contain `.' and `/' characters. See
-chapter&nbsp;<A HREF="omniORB006.html#chap:ins">663Interoperable Naming Servicechapter.6</A> of this manual, and chapter 3 of the CORBA
+chapter&nbsp;<A HREF="omniORB006.html#chap:ins">6</A> of this manual, and chapter 3 of the CORBA
 services specification, as updated for the Interoperable Naming
-Service&nbsp;[<A HREF="omniORB013.html#inschapters"><CITE>OMG00</CITE></A>].
+Service&nbsp;[<A HREF="omniORB014.html#inschapters"><CITE>OMG00</CITE></A>].
 </DL>
 <HR>
 <A HREF="omniORB001.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>

Modified: trunk/omniorb4/doc/tex/omniNames.tex
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/doc/tex/omniNames.tex?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/doc/tex/omniNames.tex (original)
+++ trunk/omniorb4/doc/tex/omniNames.tex Thu Sep 20 20:19:25 2007
@@ -60,7 +60,7 @@
 set with the \verb|OMNINAMES_ITBC| environment variable.  It defaults
 to 15 minutes.
 
-\section{Starting omniNames and setting omniORB.cfg}
+\section{Starting omniNames and setting omniORB4.cfg}
 
 When starting omniNames for the first time, you can either let it
 start with the default TCP port of 2809, or you can specify the port
@@ -71,10 +71,10 @@
 reference for its root context on standard error.
 
 At startup, omniORB tries to read the configuration file
-\verb|omniORB.cfg| to obtain the object reference to the root context
+\verb|omniORB4.cfg| to obtain the object reference to the root context
 of the Naming Service.  This object reference is returned by
 \verb|resolve_initial_references("NameService")|. There are a number
 of methods of specifying the root naming context in
-\verb|omniORB.cfg|---see the omniORB manual for details.
+\verb|omniORB4.cfg|---see the omniORB manual for details.
 
 \end{document}

Modified: trunk/omniorb4/doc/tex/omniORB.tex
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/doc/tex/omniORB.tex?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/doc/tex/omniORB.tex (original)
+++ trunk/omniorb4/doc/tex/omniORB.tex Thu Sep 20 20:19:25 2007
@@ -29,6 +29,7 @@
 % Semantic mark-up:
 \newcommand{\type}[1]{\texttt{#1}}
 \newcommand{\intf}[1]{\texttt{#1}}
+\newcommand{\module}[1]{\texttt{#1}}
 \newcommand{\code}[1]{\texttt{#1}}
 \newcommand{\op}[1]{\texttt{#1()}}
 \newcommand{\cmdline}[1]{\texttt{#1}}
@@ -62,73 +63,83 @@
 
 % URL-like things:
 \usepackage[T1]{url}
-\newcommand{\weburl}{\url}
-\newcommand{\email}{\begingroup \urlstyle{rm}\Url}
+\newcommand{\email}{\begingroup \urlstyle{sf}\Url}
 \newcommand{\file}{\begingroup \urlstyle{tt}\Url}
 \newcommand{\envvar}{\begingroup \urlstyle{tt}\Url}
 \newcommand{\makevar}{\begingroup \urlstyle{tt}\Url}
 \newcommand{\corbauri}{\begingroup \urlstyle{tt}\Url}
+%BEGIN LATEX
+\newcommand{\weburl}{\begingroup \urlstyle{sf}\Url}
+%END LATEX
+%HEVEA\def\weburl{\begingroup%
+%HEVEA\def\UrlLeft##1\UrlRight{\ahrefurl{##1}}%
+%HEVEA\urlstyle{tt}%
+%HEVEA\Url}
+
 
 % Mark-up for configuration options
+\newcommand{\confopt}[2]
+  {\vspace{\baselineskip}\par\noindent\code{#1} ~~ \textit{default} =
+   \code{#2}}
+
+%BEGIN LATEX
 \makeatletter
-\newcommand{\confopt}[2]
+\renewcommand{\confopt}[2]
   {\vspace{\baselineskip}\par\noindent\code{#1} ~~ \textit{default} =
    \code{#2}\\[-1ex]\@afterheading}
 \makeatother
-
-% HeVeA barfs at the following:
-
-%BEGIN LATEX
+%END LATEX
 
 \addtolength{\oddsidemargin}{-0.2in}
 \addtolength{\evensidemargin}{-0.6in}
 \addtolength{\textwidth}{0.5in}
 
+%BEGIN LATEX
 \newcommand{\dsc}{\discretionary{}{}{}}
+%END LATEX
+%HEVEA\newcommand{\dsc}{}
 
 \pagestyle{headings}
 \setcounter{secnumdepth}{3}
 \setcounter{tocdepth}{3}
 
 \usepackage{listings}
+
+\makeatletter
+\let\lst at ifdraft\iffalse
+\makeatother
+
 \lstdefinelanguage{idl}%
-  {keywords={any,attribute,boolean,case,char,const,context,default,double,enum,exception,FALSE,float,in,inout,interface,long,module,Object,octet,oneway,out,raises,readonly,sequence,short,string,struct,switch,TRUE,typedef,unsigned,union,void},%
+  {keywords={abstract,any,attribute,boolean,case,char,const,context,custom,default,double,enum,exception,factory,FALSE,fixed,float,in,inout,interface,local,long,module,native,Object,octet,oneway,out,private,public,raises,readonly,sequence,short,string,struct,supports,switch,TRUE,truncatable,typedef,unsigned,union,ValueBase,valuetype,void,wchar,wstring},%
   sensitive,%
-  singlecomment={/*}{*/},%
-  commentline=//,%
-  stringizer=[b]",%
-  directives={define,elif,else,endif,error,if,ifdef,ifndef,line,include,pragma,undef,warning}%
-  }[keywords,comments,strings,directives]
+  morecomment=[s]{/*}{*/},%
+  morecomment=[l]//,%
+  morestring=[b]",%
+  morestring=[b]',%
+  moredirectives={define,elif,else,endif,error,if,ifdef,ifndef,line,%
+     include,pragma,undef,warning}%
+ }[keywords,comments,strings,directives]%
 
 \lstset{basicstyle=\ttfamily\small,
         keywordstyle=,
         commentstyle=\itshape,
-        labelstyle=\tiny,
-        stringspaces=false,
+        numberstyle=\tiny,
+        showstringspaces=false,
         abovecaptionskip=0pt,
         belowcaptionskip=0pt,
-        indent=\parindent,
+        xleftmargin=\parindent,
         fontadjust}
+
 
 \lstnewenvironment{idllisting}{\lstset{language=idl}}{}
 \lstnewenvironment{cxxlisting}{\lstset{language=C++}}{}
 \lstnewenvironment{makelisting}{\lstset{language=[gnu]make}}{}
 
-%END LATEX
-
 % These things make up for HeVeA's lack of understanding:
 
-%HEVEA\newcommand{\dsc}{}
 %HEVEA\newcommand{\vfill}{}
 %HEVEA\newcommand{\mainmatter}{}
 %HEVEA\newcommand{\backmatter}{}
-%HEVEA\newcommand{\lstset}[1]{}
-%HEVEA\newcommand{\textbackslash}{$\backslash$}
-%HEVEA\usepackage{verbatim}
-%HEVEA\newenvironment{idllisting}{\verbatim}{\endverbatim}
-%HEVEA\newenvironment{cxxlisting}{\verbatim}{\endverbatim}
-%HEVEA\newenvironment{makelisting}{\verbatim}{\endverbatim}
-
 
 % Hyperref things for pdf and html:
 \usepackage{hyperref}
@@ -158,7 +169,7 @@
 \vfill
 
 { \Huge
-The omniORB version 4.0\\[4mm]
+The omniORB version 4.1\\[4mm]
 User's Guide
 }
 
@@ -182,12 +193,19 @@
 
 \vfill
 \vfill
-October 2004
+April 2006
 \vfill
 
 \end{center}
 
 \clearpage
+
+{\Large \bf Changes and Additions, June 2005}
+\begin{itemize}
+\item New omniORB 4.1 features.
+\end{itemize}
+
+\vspace{\baselineskip}
 
 {\Large \bf Changes and Additions, October 2004}
 \begin{itemize}
@@ -220,18 +238,19 @@
 
 \cleardoublepage
 
-%HEVEA{\Large \bf Contents}
 %BEGIN LATEX
 \tableofcontents
+
+\cleardoublepage
 %END LATEX
 
-\cleardoublepage
-
 \pagestyle{headings}
 
 \pagenumbering{arabic}
 
 \mainmatter
+
+%HEVEA{\LARGE \bf Contents}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{Introduction}
@@ -273,18 +292,18 @@
 messages are fragmented, so the marshaller can start transmission
 before it knows how large the entire message will be.
 
-New in version 4.0, omniORB also supports a flexible thread pooling
-policy, and supports sending multiple interleaved calls on a single
-connection. This policy leads to a small amount of additional call
-overhead, compared to the default thread per connection model, but
-allows omniORB to scale to extremely large numbers of concurrent
+From version 4.0 onwards, omniORB also supports a flexible thread
+pooling policy, and supports sending multiple interleaved calls on a
+single connection. This policy leads to a small amount of additional
+call overhead, compared to the default thread per connection model,
+but allows omniORB to scale to extremely large numbers of concurrent
 clients.
 
 \subsection{Portability}
 
 omniORB has always been designed to be portable. It runs on many
 flavours of Unix, Windows, several embedded operating systems, and
-relatively obscure systems such as OpenVMS, Fujitsu-Siemens BS2000.
+relatively obscure systems such as OpenVMS and Fujitsu-Siemens BS2000.
 It is designed to be easy to port to new platforms. The IDL to C++
 mapping for all target platforms is the same.
 
@@ -315,11 +334,6 @@
 (\weburl{http://omniifr.sourceforge.net/}) aims to create an IfR for
 omniORB.
 
-\item Objects by value (IDL valuetype) is not supported in this
-release.
-
-\item Local interfaces are not supported.
-
 \item omniORB supports interceptors, but not the standard Portable
 Interceptor API.
 
@@ -330,7 +344,9 @@
 (\weburl{http://omniorb.sourceforge.net/}).
 
 
-\section{Setting Up Your Environment}
+
+
+\section{Setting up your environment}
 \label{sec:setup}
 
 To get omniORB running, you first need to install omniORB according to
@@ -349,17 +365,14 @@
 variable \envvar{OMNIORB_CONFIG}. If this variable is defined, it
 contains the pathname of the omniORB configuration file. If the
 variable is not set, omniORB will use the compiled-in pathname to
-locate the file (by default \file{/etc/omniORB.cfg}).
+locate the file (by default \file{/etc/omniORB4.cfg}).
 
 \item On Win32 platforms (Windows NT, 2000, 95, 98), omniORB first
-checks the environment variable \envvar{OMNIORB_CONFIG} to obtain the
+checks the environment variable \envvar{OMNIORB_CONFIG}~to obtain the
 pathname of the configuration file. If this is not set, it then
 attempts to obtain configuration data in the system registry. It
 searches for the data under the key
-%BEGIN LATEX
 \file{HKEY_LOCAL_MACHINE\SOFTWARE\omniORB}.
-%END LATEX
-%HEVEA \verb|HKEY_LOCAL_MACHINE\SOFTWARE\omniORB|.
 
 \end{itemize}
 
@@ -579,7 +592,7 @@
 
 \section{A Quick Tour of the C++ stubs}
 
-The C++ stubs conform to the mapping defined in the CORBA
+The C++ stubs conform to the standard mapping defined in the CORBA
 specification~\cite{cxxmapping}. It is important to understand the
 mapping before you start writing any serious CORBA applications.
 Before going any further, it is worth knowing what the mapping looks
@@ -679,7 +692,7 @@
 follows:
 
 \begin{cxxlisting}
-namespaceCORBA {
+namespace CORBA {
   void release(CORBA::Object_ptr obj);
   ... // other methods
 };
@@ -824,8 +837,7 @@
 Here is a simple implementation of the Echo object.
 
 \begin{cxxlisting}
-class Echo_i : public POA_Echo,
-	       public PortableServer::RefCountServantBase
+class Echo_i : public POA_Echo
 {
 public:
   inline Echo_i() {}
@@ -872,23 +884,28 @@
 
 \item[Reference Counting]\mbox{}\\
 %
-As well as inheriting from the Echo skeleton class, the servant class
-is also derived from \type{PortableServer::RefCountServantBase} which,
-as the name suggests, is a mixin class which provides reference
-counting for the servant object. This means that an \type{Echo\_i}
-instance will be deleted when no more references to it are held by
-application code or the POA itself. Note that this is totally separate
-from the reference counting which is associated with object
-references---a servant object is \emph{never} deleted due to a CORBA
-object reference being released.
+All servant objects are reference counted. The base
+\type{PortableServer::\dsc{}ServantBase} class from which all servant
+skeleton classes derive defines member functions named \op{\_add\_ref}
+and \op{\_remove\_ref}\footnote{In the previous 1.0 version of the C++
+mapping, servant reference counting was optional, chosen by inheriting
+from a mixin class named \type{RefCountServantBase}. That has been
+deprecated in the 1.1 version of the C++ mapping, but the class is
+still available as an empty struct, so existing code that inherits
+from \type{RefCountServantBase} will continue to work.}. The reference
+counting means that an \type{Echo\_i} instance will be deleted when no
+more references to it are held by application code or the POA
+itself. Note that this is totally separate from the reference counting
+which is associated with object references---a servant object is
+\emph{never} deleted due to a CORBA object reference being released.
 
 \item[Instantiation]\mbox{}\\
 %
-Servants that derive from \type{PortableServer::RefCountServantBase}
-must not be instantiated as automatic variables (i.e.\ on the stack).
-Instead, you should always instantiate them using the \code{new}
-operator, i.e.\ their storage is allocated on the heap. Otherwise, the
-POA may attempt to delete an object on the stack.
+Servants are usually instantiated on the heap, i.e.\ using the
+\code{new} operator. However, they can also be created on the stack as
+automatic variables. If you do that, it is vital to make sure that the
+servant has been deactivated, and thus released by the POA, before the
+variable goes out of scope and is destroyed.
 
 \end{description}
 
@@ -897,7 +914,9 @@
 Here is an example of how an \type{Echo\_ptr} object reference is
 used.
 
-\lstset{labelstep=1,gobble=4}
+%BEGIN LATEX
+\lstset{stepnumber=1,gobble=4}
+%END LATEX
 \begin{cxxlisting}
  1  void
  2  hello(CORBA::Object_ptr obj)
@@ -919,7 +938,7 @@
 18         << " The Object said,\"" << dest <<"\"" << endl;
 19  }
 \end{cxxlisting}
-\lstset{labelstep=0,gobble=0}
+\lstset{stepnumber=0,gobble=0}
 
 Briefly, the \op{hello} function accepts a generic object reference.
 The object reference (\code{obj}) is narrowed to \type{Echo\_ptr}. If
@@ -976,7 +995,9 @@
 The code for this example is reproduced below:
 
 
-\lstset{labelstep=1,gobble=4}
+%BEGIN LATEX
+\lstset{stepnumber=1,gobble=4}
+%END LATEX
 \begin{cxxlisting}
  1  int
  2  main(int argc, char **argv)
@@ -1001,7 +1022,7 @@
 21    return 0;
 22  }
 \end{cxxlisting}
-\lstset{labelstep=0,gobble=0}
+\lstset{stepnumber=0,gobble=0}
 
 The example illustrates several important interactions among the ORB,
 the POA, the servant, and the client. Here are the details:
@@ -1016,7 +1037,7 @@
 function. The function uses the optional 3rd argument to determine
 which ORB should be returned. Unless you are using omniORB specific
 features, it is usually best to leave it out, and get the default
-ORB. To explicitly ask for omniORB 4.0, this argument must be
+ORB. To explicitly ask for omniORB 4.x, this argument must be
 `omniORB4'\footnote{For backwards compatibility, the ORB identifiers
 `omniORB2' and `omniORB3' are also accepted.}.
 
@@ -1169,13 +1190,15 @@
 example. In the next example, we shall introduce a better way of
 passing the object reference using the CORBA Naming Service.
 
-\subsection{Object Implementation: Generating a Stringified Object Reference}
+\subsection{Object Implementation: Making a Stringified Object Reference}
 
 The \op{main} function of the server side is reproduced below. The
 full listing (\file{eg2_impl.cc}) can be found at the end of this
 chapter.
 
-\lstset{labelstep=1,gobble=4}
+%BEGIN LATEX
+\lstset{stepnumber=1,gobble=4}
+%END LATEX
 \begin{cxxlisting}
  1  int main(int argc, char** argv)
  2  {
@@ -1202,7 +1225,7 @@
 23    return 0;
 24  }
 \end{cxxlisting}
-\lstset{labelstep=0,gobble=0}
+\lstset{stepnumber=0,gobble=0}
 
 The stringified object reference is obtained by calling the ORB's
 \op{object\_to\_\dsc{}string} function (line 13). This results in a
@@ -1228,8 +1251,8 @@
   CORBA::Object_var obj = orb->string_to_object(argv[1]);
   hello(obj);
 }
-catch(CORBA::COMM_FAILURE& ex) {
-  ... // code to handle communication failure
+catch(CORBA::TRANSIENT&) {
+  ... // code to handle transient exception...
 }
 \end{cxxlisting}
 
@@ -1244,9 +1267,9 @@
 runtime will call the \op{terminate} function. This function is
 defaulted to abort the whole process and on some systems will cause a
 core file to be produced.}. For instance, the code fragment, shown in
-section~\ref{clnt2}, catches the \code{COMM\_FAILURE} system exception
-which indicates that communication with the object implementation in
-another address space has failed.
+section~\ref{clnt2}, catches the \code{TRANSIENT} system exception
+which indicates that the object could not be contacted at the time of
+the call, usually meaning the server is not running.
 
 All system exceptions inherit from \type{CORBA::SystemException}. With
 compilers that properly support RTTI\footnote{Run Time Type
@@ -1350,7 +1373,7 @@
 
 Remember, omniORB constructs its internal list of initial references
 at initialisation time using the information provided in the
-configuration file \file{omniORB.cfg}, or given on the command
+configuration file \file{omniORB4.cfg}, or given on the command
 line. If this file is not present, the internal list will be empty and
 \op{resolve\_initial\_references} will raise a
 \code{CORBA::ORB::\dsc{}InvalidName} exception.
@@ -1422,14 +1445,18 @@
 // Usage: eg1
 //
 
-#include <iostream.h>
 #include <echo.hh>
 
+#ifdef HAVE_STD
+#  include <iostream>
+   using namespace std;
+#else
+#  include <iostream.h>
+#endif
 
 // This is the object implementation.
 
-class Echo_i : public POA_Echo,
-	       public PortableServer::RefCountServantBase
+class Echo_i : public POA_Echo
 {
 public:
   inline Echo_i() {}
@@ -1443,6 +1470,7 @@
   return CORBA::string_dup(mesg);
 }
 
+
 //////////////////////////////////////////////////////////////////////
 
 // This function acts as a client to the object.
@@ -1463,7 +1491,7 @@
 
   CORBA::String_var dest = e->echoString(src);
 
-  cerr << "I said, \"" << (char*)src << "\"." << endl
+  cout << "I said, \"" << (char*)src << "\"." << endl
        << "The Echo object replied, \"" << (char*)dest <<"\"." << endl;
 }
 
@@ -1509,15 +1537,11 @@
     // Clean up all the resources.
     orb->destroy();
   }
-  catch(CORBA::COMM_FAILURE& ex) {
-    cerr << "Caught system exception COMM_FAILURE -- unable to contact the "
-         << "object." << endl;
-  }
-  catch(CORBA::SystemException&) {
-    cerr << "Caught CORBA::SystemException." << endl;
-  }
-  catch(CORBA::Exception&) {
-    cerr << "Caught CORBA::Exception." << endl;
+  catch(CORBA::SystemException& ex) {
+    cerr << "Caught CORBA::" << ex._name() << endl;
+  }
+  catch(CORBA::Exception& ex) {
+    cerr << "Caught CORBA::Exception: " << ex._name() << endl;
   }
   catch(omniORB::fatalException& fe) {
     cerr << "Caught omniORB::fatalException:" << endl;
@@ -1525,10 +1549,6 @@
     cerr << "  line: " << fe.line() << endl;
     cerr << "  mesg: " << fe.errmsg() << endl;
   }
-  catch(...) {
-    cerr << "Caught unknown exception." << endl;
-  }
-
   return 0;
 }
 \end{cxxlisting}
@@ -1550,12 +1570,16 @@
 //        eg2_clt.
 //
 
-#include <iostream.h>
 #include <echo.hh>
 
-
-class Echo_i : public POA_Echo,
-	       public PortableServer::RefCountServantBase
+#ifdef HAVE_STD
+#  include <iostream>
+   using namespace std;
+#else
+#  include <iostream.h>
+#endif
+
+class Echo_i : public POA_Echo
 {
 public:
   inline Echo_i() {}
@@ -1566,7 +1590,7 @@
 
 char* Echo_i::echoString(const char* mesg)
 {
-  cerr << "Upcall " << mesg << endl;
+  cout << "Upcall " << mesg << endl;
   return CORBA::string_dup(mesg);
 }
 
@@ -1588,7 +1612,7 @@
     // stringified IOR.
     obj = myecho->_this();
     CORBA::String_var sior(orb->object_to_string(obj));
-    cerr << "'" << (char*)sior << "'" << endl;
+    cout << (char*)sior << endl;
 
     myecho->_remove_ref();
 
@@ -1597,11 +1621,11 @@
 
     orb->run();
   }
-  catch(CORBA::SystemException&) {
-    cerr << "Caught CORBA::SystemException." << endl;
-  }
-  catch(CORBA::Exception&) {
-    cerr << "Caught CORBA::Exception." << endl;
+  catch(CORBA::SystemException& ex) {
+    cerr << "Caught CORBA::" << ex._name() << endl;
+  }
+  catch(CORBA::Exception& ex) {
+    cerr << "Caught CORBA::Exception: " << ex._name() << endl;
   }
   catch(omniORB::fatalException& fe) {
     cerr << "Caught omniORB::fatalException:" << endl;
@@ -1609,10 +1633,6 @@
     cerr << "  line: " << fe.line() << endl;
     cerr << "  mesg: " << fe.errmsg() << endl;
   }
-  catch(...) {
-    cerr << "Caught unknown exception." << endl;
-  }
-
   return 0;
 }
 \end{cxxlisting}
@@ -1631,8 +1651,15 @@
 // Usage: eg2_clt <object reference>
 //
 
-#include <iostream.h>
 #include <echo.hh>
+
+#ifdef HAVE_STD
+#  include <iostream>
+#  include <fstream>
+   using namespace std;
+#else
+#  include <iostream.h>
+#endif
 
 
 static void hello(Echo_ptr e)
@@ -1641,7 +1668,7 @@
 
   CORBA::String_var dest = e->echoString(src);
 
-  cerr << "I said, \"" << (char*)src << "\"." << endl
+  cout << "I said, \"" << (char*)src << "\"." << endl
        << "The Echo object replied, \"" << (char*)dest <<"\"." << endl;
 }
 
@@ -1670,24 +1697,21 @@
 
     orb->destroy();
   }
-  catch(CORBA::COMM_FAILURE& ex) {
-    cerr << "Caught system exception COMM_FAILURE -- unable to contact the "
-         << "object." << endl;
-  }
-  catch(CORBA::SystemException&) {
-    cerr << "Caught a CORBA::SystemException." << endl;
-  }
-  catch(CORBA::Exception&) {
-    cerr << "Caught CORBA::Exception." << endl;
+  catch(CORBA::TRANSIENT&) {
+    cerr << "Caught system exception TRANSIENT -- unable to contact the "
+         << "server." << endl;
+  }
+  catch(CORBA::SystemException& ex) {
+    cerr << "Caught a CORBA::" << ex._name() << endl;
+  }
+  catch(CORBA::Exception& ex) {
+    cerr << "Caught CORBA::Exception: " << ex._name() << endl;
   }
   catch(omniORB::fatalException& fe) {
     cerr << "Caught omniORB::fatalException:" << endl;
     cerr << "  file: " << fe.file() << endl;
     cerr << "  line: " << fe.line() << endl;
     cerr << "  mesg: " << fe.errmsg() << endl;
-  }
-  catch(...) {
-    cerr << "Caught unknown exception." << endl;
   }
   return 0;
 }
@@ -1717,15 +1741,19 @@
 //              Echo  [object]  kind [Object]
 //
 
-#include <iostream.h>
 #include <echo.hh>
 
+#ifdef HAVE_STD
+#  include <iostream>
+   using namespace std;
+#else
+#  include <iostream.h>
+#endif
 
 static CORBA::Boolean bindObjectToName(CORBA::ORB_ptr, CORBA::Object_ptr);
 
 
-class Echo_i : public POA_Echo,
-	       public PortableServer::RefCountServantBase
+class Echo_i : public POA_Echo
 {
 public:
   inline Echo_i() {}
@@ -1760,7 +1788,7 @@
 
     CORBA::String_var x;
     x = orb->object_to_string(obj);
-    cerr << x << "\n";
+    cout << x << endl;
 
     if( !bindObjectToName(orb, obj) )
       return 1;
@@ -1772,11 +1800,11 @@
 
     orb->run();
   }
-  catch(CORBA::SystemException&) {
-    cerr << "Caught CORBA::SystemException." << endl;
-  }
-  catch(CORBA::Exception&) {
-    cerr << "Caught CORBA::Exception." << endl;
+  catch(CORBA::SystemException& ex) {
+    cerr << "Caught CORBA::" << ex._name() << endl;
+  }
+  catch(CORBA::Exception& ex) {
+    cerr << "Caught CORBA::Exception: " << ex._name() << endl;
   }
   catch(omniORB::fatalException& fe) {
     cerr << "Caught omniORB::fatalException:" << endl;
@@ -1784,10 +1812,6 @@
     cerr << "  line: " << fe.line() << endl;
     cerr << "  mesg: " << fe.errmsg() << endl;
   }
-  catch(...) {
-    cerr << "Caught unknown exception." << endl;
-  }
-
   return 0;
 }
 
@@ -1810,7 +1834,13 @@
       return 0;
     }
   }
-  catch(CORBA::ORB::InvalidName& ex) {
+  catch (CORBA::NO_RESOURCES&) {
+    cerr << "Caught NO_RESOURCES exception. You must configure omniORB "
+	 << "with the location" << endl
+	 << "of the naming service." << endl;
+    return 0;
+  }
+  catch (CORBA::ORB::InvalidName&) {
     // This should not happen!
     cerr << "Service required is invalid [does not exist]." << endl;
     return 0;
@@ -1868,17 +1898,19 @@
     // the Name has not already been bound. [This is incorrect behaviour -
     // it should just bind].
   }
-  catch(CORBA::COMM_FAILURE& ex) {
-    cerr << "Caught system exception COMM_FAILURE -- unable to contact the "
-         << "naming service." << endl;
+  catch(CORBA::TRANSIENT& ex) {
+    cerr << "Caught system exception TRANSIENT -- unable to contact the "
+         << "naming service." << endl
+	 << "Make sure the naming server is running and that omniORB is "
+	 << "configured correctly." << endl;
+
     return 0;
   }
-  catch(CORBA::SystemException&) {
-    cerr << "Caught a CORBA::SystemException while using the naming service."
-	 << endl;
+  catch(CORBA::SystemException& ex) {
+    cerr << "Caught a CORBA::" << ex._name()
+	 << " while using the naming service." << endl;
     return 0;
   }
-
   return 1;
 }
 \end{cxxlisting}
@@ -1908,8 +1940,14 @@
 //              Echo  [object]  kind [Object]
 //
 
-#include <iostream.h>
 #include <echo.hh>
+
+#ifdef HAVE_STD
+#  include <iostream>
+   using namespace std;
+#else
+#  include <iostream.h>
+#endif
 
 static CORBA::Object_ptr getObjectReference(CORBA::ORB_ptr orb);
 
@@ -1945,15 +1983,15 @@
 
     orb->destroy();
   }
-  catch(CORBA::COMM_FAILURE& ex) {
-    cerr << "Caught system exception COMM_FAILURE -- unable to contact the "
-         << "object." << endl;
-  }
-  catch(CORBA::SystemException&) {
-    cerr << "Caught CORBA::SystemException." << endl;
-  }
-  catch(CORBA::Exception&) {
-    cerr << "Caught CORBA::Exception." << endl;
+  catch(CORBA::TRANSIENT&) {
+    cerr << "Caught system exception TRANSIENT -- unable to contact the "
+         << "server." << endl;
+  }
+  catch(CORBA::SystemException& ex) {
+    cerr << "Caught a CORBA::" << ex._name() << endl;
+  }
+  catch(CORBA::Exception& ex) {
+    cerr << "Caught CORBA::Exception: " << ex._name() << endl;
   }
   catch(omniORB::fatalException& fe) {
     cerr << "Caught omniORB::fatalException:" << endl;
@@ -1961,10 +1999,6 @@
     cerr << "  line: " << fe.line() << endl;
     cerr << "  mesg: " << fe.errmsg() << endl;
   }
-  catch(...) {
-    cerr << "Caught unknown exception." << endl;
-  }
-
   return 0;
 }
 
@@ -1987,6 +2021,12 @@
       return CORBA::Object::_nil();
     }
   }
+  catch (CORBA::NO_RESOURCES&) {
+    cerr << "Caught NO_RESOURCES exception. You must configure omniORB "
+	 << "with the location" << endl
+	 << "of the naming service." << endl;
+    return 0;
+  }
   catch(CORBA::ORB::InvalidName& ex) {
     // This should not happen!
     cerr << "Service required is invalid [does not exist]." << endl;
@@ -2014,13 +2054,17 @@
     // path [contexts or the object] aren't found:
     cerr << "Context not found." << endl;
   }
-  catch(CORBA::COMM_FAILURE& ex) {
-    cerr << "Caught system exception COMM_FAILURE -- unable to contact the "
-         << "naming service." << endl;
-  }
-  catch(CORBA::SystemException&) {
-    cerr << "Caught a CORBA::SystemException while using the naming service."
-	 << endl;
+  catch(CORBA::TRANSIENT& ex) {
+    cerr << "Caught system exception TRANSIENT -- unable to contact the "
+         << "naming service." << endl
+	 << "Make sure the naming server is running and that omniORB is "
+	 << "configured correctly." << endl;
+
+  }
+  catch(CORBA::SystemException& ex) {
+    cerr << "Caught a CORBA::" << ex._name()
+	 << " while using the naming service." << endl;
+    return 0;
   }
 
   return CORBA::Object::_nil();
@@ -2051,21 +2095,27 @@
 //              Echo  [object]  kind [Object]
 //
 
-#include <iostream.h>
 #include <echo.hh>
 
+#ifdef HAVE_STD
+#  include <iostream>
+   using namespace std;
+#else
+#  include <iostream.h>
+#endif
 
 static CORBA::Boolean bindObjectToName(CORBA::ORB_ptr,CORBA::Object_ptr);
 
 
-// This is the object implementation.  Notice that it does not
-// inherit from any stub class.
+// This is the object implementation.  Notice that it does not inherit
+// from any stub class, and notice that the echoString() member
+// function does not have to be virtual.
 
 class Echo_i {
 public:
   inline Echo_i() {}
   inline ~Echo_i() {}
-  virtual char* echoString(const char* mesg);
+  char* echoString(const char* mesg);
 };
 
 
@@ -2084,14 +2134,15 @@
     CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
     PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
 
-    // Note that the <myecho> object is constructed on the stack here.
-    // This is because tie implementations do not inherit from the
-    // PortableServer::RefCountServantBase mixin class -- and so are
-    // not automatically deleted by the POA.
-    // However, it will delete its implementation (myimpl) when it
-    // it itself destroyed (when it goes out of scope).  It is
-    // essential however to ensure that such objects are not deleted
-    // whilst still activated.
+    // Note that the <myecho> tie object is constructed on the stack
+    // here. It will delete its implementation (myimpl) when it it
+    // itself destroyed (when it goes out of scope).  It is essential
+    // however to ensure that such servants are not deleted whilst
+    // still activated.
+    //
+    // Tie objects can of course be allocated on the heap using new,
+    // in which case they are deleted when their reference count
+    // becomes zero, as with any other servant object.
     Echo_i* myimpl = new Echo_i();
     POA_Echo_tie<Echo_i> myecho(myimpl);
 
@@ -2108,11 +2159,11 @@
 
     orb->run();
   }
-  catch(CORBA::SystemException&) {
-    cerr << "Caught CORBA::SystemException." << endl;
-  }
-  catch(CORBA::Exception&) {
-    cerr << "Caught CORBA::Exception." << endl;
+  catch(CORBA::SystemException& ex) {
+    cerr << "Caught CORBA::" << ex._name() << endl;
+  }
+  catch(CORBA::Exception& ex) {
+    cerr << "Caught CORBA::Exception: " << ex._name() << endl;
   }
   catch(omniORB::fatalException& fe) {
     cerr << "Caught omniORB::fatalException:" << endl;
@@ -2120,10 +2171,6 @@
     cerr << "  line: " << fe.line() << endl;
     cerr << "  mesg: " << fe.errmsg() << endl;
   }
-  catch(...) {
-    cerr << "Caught unknown exception." << endl;
-  }
-
   return 0;
 }
 
@@ -2146,7 +2193,13 @@
       return 0;
     }
   }
-  catch(CORBA::ORB::InvalidName& ex) {
+  catch (CORBA::NO_RESOURCES&) {
+    cerr << "Caught NO_RESOURCES exception. You must configure omniORB "
+	 << "with the location" << endl
+	 << "of the naming service." << endl;
+    return 0;
+  }
+  catch (CORBA::ORB::InvalidName&) {
     // This should not happen!
     cerr << "Service required is invalid [does not exist]." << endl;
     return 0;
@@ -2204,17 +2257,19 @@
     // the Name has not already been bound. [This is incorrect behaviour -
     // it should just bind].
   }
-  catch(CORBA::COMM_FAILURE& ex) {
-    cerr << "Caught system exception COMM_FAILURE -- unable to contact the "
-         << "naming service." << endl;
+  catch(CORBA::TRANSIENT& ex) {
+    cerr << "Caught system exception TRANSIENT -- unable to contact the "
+         << "naming service." << endl
+	 << "Make sure the naming server is running and that omniORB is "
+	 << "configured correctly." << endl;
+
     return 0;
   }
-  catch(CORBA::SystemException&) {
-    cerr << "Caught a CORBA::SystemException while using the naming service."
-	 << endl;
+  catch(CORBA::SystemException& ex) {
+    cerr << "Caught a CORBA::" << ex._name()
+	 << " while using the naming service." << endl;
     return 0;
   }
-
   return 1;
 }
 \end{cxxlisting}
@@ -2247,7 +2302,7 @@
 skeleton code with the same interface as the old omniORB 2 BOA
 mapping, as well as code to be used with the POA. Note that since the
 major problem with the BOA specification was that server code was not
-portable between ORBs, it is unlikely that omniORB 4.0's BOA
+portable between ORBs, it is unlikely that omniORB 4.1's BOA
 compatibility will help you much if you are moving from a different
 BOA-based ORB.
 
@@ -2260,7 +2315,7 @@
 \item omniORB 2 did not use distinct types for object references and
 servants, and often accepted a pointer to a servant when the CORBA
 specification says it should only accept an object reference. Such
-code will not compile under omniORB 4.0.
+code will not compile under omniORB 4.1.
 
 \item The reverse is true for \op{BOA::obj\_is\_ready}. It now only
 works when passed a pointer to a servant object, not an object
@@ -2320,7 +2375,7 @@
 
 \section{omniORB 3.0 compatibility}
 
-omniORB 4.0 is almost completely source-code compatible with omniORB
+omniORB 4.1 is almost completely source-code compatible with omniORB
 3.0. There are two main cases where code may have to change. The first
 is code that uses the omniORB API, some aspects of which have
 changed. The omniORB configuration file also has a new format. See the
@@ -2329,9 +2384,36 @@
 The second case of code that may have to change is code using the
 Dynamic Any interfaces. The standard changed quite significantly
 between CORBA 2.2 and CORBA 2.3; omniORB 3.0 supported the old CORBA
-2.2 interfaces; omniORB 4.0 uses the new mapping. The changes are
+2.2 interfaces; omniORB 4.1 uses the new mapping. The changes are
 largely syntax changes, rather than semantic differences.
 
+
+\section{omniORB 4.0 compatibility}
+
+omniORB 4.1 is source-code compatible with omniORB 4.0, with three
+minor exceptions:
+
+\begin{enumerate}
+
+\item As required by the 1.1 version of the CORBA C++ mapping
+  specification, the \type{RefCountServantBase} class has been
+  deprecated, and the reference counting functionality moved into
+  \type{ServantBase}. For backwards compatibility,
+  \type{RefCountServantBase} still exists, but is now defined as an
+  empty struct. Most code will continue to work unchanged, but code
+  that explicitly calls \op{RefCountServantBase::\_add\_ref} or
+  \op{\_remove\_ref} will no longer compile.
+
+\item omniORB 4.0 had an option for Any extraction semantics that was
+  compatible with omniORB 2.7, where ownership of extracted values was
+  not maintained by the Any. That option is no longer available.
+
+\item The members of the \code{clientSendRequest} interceptor have
+  been changed, replacing all the separate variables with a single
+  member of type \code{GIOP\_C}. All the values previously available
+  can be accessed through the \code{GIOP\_C} instance.
+
+\end{enumerate}
 
 
 
@@ -2340,7 +2422,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \label{chap:config}
 
-omniORB 4.0 has a wide range of parameters that can be
+omniORB 4.1 has a wide range of parameters that can be
 configured. They can be set in the configuration file / Windows
 registry, as environment variables, on the command line, or within a
 proprietary extra argument to \op{CORBA::ORB\_init}. A few parameters
@@ -2372,7 +2454,7 @@
 \subsection{ORB\_init() parameter}
 
 \op{ORB\_init}'s extra argument accepts an array of two-dimensional
-arrays of strings, like this:
+string arrays, like this:
 
 \begin{cxxlisting}
 const char* options[][2] = { { "traceLevel", "1" }, { 0, 0 } }; 
@@ -2421,11 +2503,7 @@
 \subsection{Windows registry}
 
 On Windows, configuration parameters can be stored in the registry,
-under the key
-%BEGIN LATEX
-\file{HKEY_LOCAL_MACHINE\SOFTWARE\omniORB}.
-%END LATEX
-%HEVEA \verb|HKEY_LOCAL_MACHINE\SOFTWARE\omniORB|.
+under the key \file{HKEY_LOCAL_MACHINE\SOFTWARE\omniORB}.
 
 The file \file{sample.reg} shows the settings that can be made. It can
 be edited and then imported into regedit.
@@ -2481,6 +2559,15 @@
 have been selected with \code{traceLevel}.
 
 
+\confopt{traceInvocationReturns}{0}
+
+If the \code{traceInvocationReturns} parameter is set true, a log
+message is output as an operation invocation returns. In conjunction
+with \code{traceInvocations} and \code{traceTime} (described below),
+this provides a simple way of timing CORBA calls within your
+application.
+
+
 \confopt{traceThreadId}{0}
 
 If \code{traceThreadId} is set true, all trace messages are prefixed
@@ -2489,17 +2576,27 @@
 the logging function so it is turned off by default.
 
 
+\confopt{traceTime}{0}
+
+If \code{traceTime} is set true, all trace messages are prefixed with
+the time. This is useful, but on some platforms it adds a very large
+overhead, so it is turned off by default.
+
+
+
 \subsection{Tracing API}
 
-The four tracing parameters can be modified at runtime by assigning to
-the following variables
+The tracing parameters can be modified at runtime by assigning to the
+following variables
 
 \begin{cxxlisting}
 namespace omniORB {
   CORBA::ULong   traceLevel;
   CORBA::Boolean traceExceptions;
   CORBA::Boolean traceInvocations;
+  CORBA::Boolean traceInvocationReturns;
   CORBA::Boolean traceThreadId;
+  CORBA::Boolean traceTime;
 };
 \end{cxxlisting}
 
@@ -2553,15 +2650,10 @@
 \type{wstring}. See chapter~\ref{chap:codesets}.
 
 
-\confopt{omniORB\_27\_CompatibleAnyExtraction}{0}
-
-In omniORB 2.7 and earlier, the Any extraction operators for strings
-and object references returned a copy/duplicate of the value stored in
-the Any, meaning the caller had to release the extracted value. The
-C++ mapping was clarified to state that the Any retains ownership of
-the returned value, so the caller does not need to release it. To aid
-the transition for ancient programs from omniORB 2.7 or earlier,
-setting this flag to true selects the old copying behaviour.
+\confopt{copyValuesInLocalCalls}{1}
+
+Determines whether valuetype parameters in local calls are copied or
+not. See chapter~\ref{chap:valuetype}.
 
 
 \confopt{abortOnInternalError}{0}
@@ -2579,11 +2671,11 @@
 
 \confopt{InitRef}{\textit{none}}
 
-Specify the objects available from
+Specify objects available from
 \op{ORB::resolve\_initial\_references}. The arguments take the form
-<\textit{key}>=<\textit{uri}>, where the \textit{key} is the name
-given to \op{resolve\_\dsc{}initial\_\dsc{}references} and
-\textit{uri} is a valid CORBA object reference URI, as detailed in
+<\textit{key}>=<\textit{uri}>, where \textit{key} is the name given to
+\op{resolve\_\dsc{}initial\_\dsc{}references} and \textit{uri} is a
+valid CORBA object reference URI, as detailed in
 chapter~\ref{chap:ins}.
 
 
@@ -2604,14 +2696,22 @@
 
 Call timeout in milliseconds for the client side. If a call takes
 longer than the specified number of milliseconds, the ORB closes the
-connection and raises a \code{TRANSIENT} exception. A value of zero
-means no timeout; calls can block for ever. See
+connection to the server and raises a \code{TRANSIENT} exception. A
+value of zero means no timeout; calls can block for ever. See
 section~\ref{sec:timeoutAPI} for more information about timeouts.
 
 \vspace{.5\baselineskip}
 
-\noindent\textbf{Note}: omniORB 3 had timeouts specified in seconds; omniORB
-4.0 uses milliseconds for timeouts.
+\noindent\textbf{Note}: omniORB 3 had timeouts specified in seconds;
+omniORB 4.0 and later use milliseconds for timeouts.
+
+
+\confopt{clientConnectTimeOutPeriod}{0}
+
+The timeout that is used in the case that a new network connection is
+established to the server. A value of zero means that the normal call
+timeout is used. See section~\ref{sec:timeoutAPI} for more information
+about timeouts.
 
 
 \confopt{supportPerThreadTimeOut}{0}
@@ -2717,6 +2817,7 @@
 \noindent
 \code{endPoint~~~~~~~~~} ~~ \textit{default} = \code{giop:tcp::}\\
 \code{endPointNoListen}\\
+\code{endPointPublish}\\
 \code{endPointNoPublish}\\
 \code{endPointPublishAllIFs}\\[.1ex]
 
@@ -2791,8 +2892,8 @@
 
 \confopt{threadPoolWatchConnection}{1}
 
-If true, threads from the pool temporarily behave a bit like thread
-per connection after dispatching a call. See
+If non-zero, threads from the pool temporarily behave a bit like
+thread per connection after dispatching a call. See
 section~\ref{sec:watchConn} for details.
 
 
@@ -2817,9 +2918,9 @@
 
 \confopt{supportCurrent}{1}
 
-omniORB 4.0 supports the \type{PortableServer::Current} interface that
-provides thread context information to a servant. Supporting current
-has a small but noticeable run-time overhead due to accessing thread
+omniORB supports the \type{PortableServer::Current} interface to
+provide thread context information to servants. Supporting current has
+a small but noticeable run-time overhead due to accessing thread
 specific storage, so this option allows it to be turned off.
 
 
@@ -2921,7 +3022,7 @@
 \confopt{useTypeCodeIndirections}{1}
 
 TypeCode Indirections reduce the size of marshalled TypeCodes, and are
-essential for recursive types, but some ORBs do not support them.
+essential for recursive types, but some old ORBs do not support them.
 Setting this flag to false prevents the use of indirections (and,
 therefore, recursive TypeCodes).
 
@@ -2929,7 +3030,8 @@
 \confopt{acceptMisalignedTcIndirections}{0}
 
 If true, try to fix a mis-aligned indirection in a typecode. This is
-used to work around a bug in some versions of Visibroker's Java ORB.
+used to work around a bug in some old versions of Visibroker's Java
+ORB.
 
 
 \vspace{2\baselineskip}
@@ -2960,11 +3062,11 @@
 
 \subsection{Minor codes}
 
-A new feature in omniORB 4.0 is extensive use of exception minor codes
-to indicate the specific circumstances surrounding a system exception.
-The file \file{include/omniORB4/minorCode.h} contains definitions of
-all the minor codes used in omniORB, covering codes allocated in the
-CORBA specification, and ones specific to omniORB. In compilers with
+omniORB makes extensive use of exception minor codes to indicate the
+specific circumstances surrounding a system exception.  The file
+\file{include/omniORB4/minorCode.h} contains definitions of all the
+minor codes used in omniORB, covering codes allocated in the CORBA
+specification, and ones specific to omniORB. In compilers with
 namespace support, the minor code constants appear in namespace
 \code{omni}; otherwise they are in the global scope.
 
@@ -3009,7 +3111,7 @@
 
 In this situation, the default \code{TRANSIENT} exception handler
 retries the call, using the object's original location. If the retry
-results in another \code{LOCATION\_FORWARD}, to the same or a
+results in another \code{LOCATION\_\dsc{}FORWARD}, to the same or a
 different location, and \emph{that} forwarded location fails
 immediately, the \code{TRANSIENT} exception will occur again, and the
 pattern will repeat. With repeated exceptions, the handler starts
@@ -3024,16 +3126,19 @@
 \begin{cxxlisting}
 namespace omniORB {
   
-  typedef CORBA::Boolean (*transientExceptionHandler_t)(void* cookie,
-                                                  CORBA::ULong n_retries,
-                                                  const CORBA::TRANSIENT& ex);
-
-  void installTransientExceptionHandler(void* cookie,
-                                        transientExceptionHandler_t fn);
-
-  void installTransientExceptionHandler(CORBA::Object_ptr obj,
-                                        void* cookie,
-                                        transientExceptionHandler_t fn);
+  typedef CORBA::Boolean 
+  (*transientExceptionHandler_t)(void* cookie,
+                                 CORBA::ULong n_retries,
+                                 const CORBA::TRANSIENT& ex);
+
+  void 
+  installTransientExceptionHandler(void* cookie,
+                                   transientExceptionHandler_t fn);
+
+  void
+  installTransientExceptionHandler(CORBA::Object_ptr obj,
+                                   void* cookie,
+                                   transientExceptionHandler_t fn);
 }
 \end{cxxlisting}
 
@@ -3052,10 +3157,17 @@
 \code{n\_retries} is the number of times the proxy has called this
 handler for the same invocation. The argument \code{ex} is the value
 of the exception caught.  The exception handler is expected to do
-whatever is appropriate and returns a boolean value. If the return
+whatever is appropriate and return a boolean value. If the return
 value is TRUE(1), the proxy object retries the operation. If the
-return value is FALSE(0), the \code{CORBA::TRANSIENT} exception is
-propagated into the application code.
+return value is FALSE(0), the original exception is propagated into
+the application code. In the case of a \code{TRANSIENT} exception due
+to a failed location forward, the exception propagated to the
+application is the \emph{original} exception that caused the
+\code{TRANSIENT} (e.g.\ a \code{COMM\_FAILURE} or
+\code{OBJECT\_NOT\_EXIST}), rather than the \code{TRANSIENT}
+exception\footnote{This is a change from omniORB 4.0 and earlier,
+where it was the \code{TRANSIENT} exception that was propagated to the
+application.}.
 
 The following sample code installs a simple exception handler for all
 objects and for a specific object:
@@ -3104,21 +3216,19 @@
 is summarised below:
 
 \begin{cxxlisting}
-class omniORB {
-public:
-
-typedef CORBA::Boolean (*commFailureExceptionHandler_t)(void* cookie,
-                                                CORBA::ULong n_retries,
-                                                const CORBA::COMM_FAILURE& ex);
-
-static void installCommFailureExceptionHandler(void* cookie,
-                                             commFailureExceptionHandler_t fn);
-
-static void installCommFailureExceptionHandler(CORBA::Object_ptr obj,
-                                             void* cookie,
-                                             commFailureExceptionHandler_t
-                                             fn);
-}
+typedef CORBA::Boolean
+(*commFailureExceptionHandler_t)(void* cookie,
+                                 CORBA::ULong n_retries,
+                                 const CORBA::COMM_FAILURE& ex);
+
+void
+installCommFailureExceptionHandler(void* cookie,
+                                   commFailureExceptionHandler_t fn);
+
+void
+installCommFailureExceptionHandler(CORBA::Object_ptr obj,
+                                   void* cookie,
+                                   commFailureExceptionHandler_t fn);
 \end{cxxlisting}
 
 The functions are equivalent to their counterparts for
@@ -3127,28 +3237,27 @@
 
 \subsection{CORBA::SystemException}
 
-If a system exception other than \code{CORBA::TRANISENT} or
-\code{CORBA::COMM\_FAILURE} occurs, the default behaviour of the proxy
+If a system exceptions other than \code{TRANSIENT} or
+\code{COMM\_FAILURE} occurs, the default behaviour of the proxy
 objects is to propagate this exception to the application.
 Applications can override the default behaviour by installing their
 own exception handlers. The API to do so is summarised below:
 
 
 \begin{cxxlisting}
-class omniORB {
-public:
-
-typedef CORBA::Boolean (*systemExceptionHandler_t)(void* cookie,
-                                            CORBA::ULong n_retries,
-                                            const CORBA::SystemException& ex);
-
-static void installSystemExceptionHandler(void* cookie,
-                                          systemExceptionHandler_t fn);
-
-static void installSystemExceptionHandler(CORBA::Object_ptr obj,
-                                          void* cookie,
-                                          systemExceptionHandler_t fn);
-}
+typedef CORBA::Boolean
+(*systemExceptionHandler_t)(void* cookie,
+                            CORBA::ULong n_retries,
+                            const CORBA::SystemException& ex);
+
+void
+installSystemExceptionHandler(void* cookie,
+                              systemExceptionHandler_t fn);
+
+void
+installSystemExceptionHandler(CORBA::Object_ptr obj,
+                              void* cookie,
+                              systemExceptionHandler_t fn);
 \end{cxxlisting}
 
 The functions are equivalent to their counterparts for
@@ -3278,11 +3387,10 @@
 \subsection{Preprocessor interactions}
 
 IDL is processed by the C preprocessor before omniidl parses it.
-Unlike the old IDL compiler, which used different C preprocessors on
-different platforms, omniidl always uses the GNU C preprocessor (which
-it builds with the name omnicpp). The \cmdline{-D}, \cmdline{-U}, and
-\cmdline{-I} options are just sent to the preprocessor. Note that the
-current directory is not on the include search path by default---use
+omniidl always uses the GNU C preprocessor (which it builds with the
+name omnicpp). The \cmdline{-D}, \cmdline{-U}, and \cmdline{-I}
+options are just sent to the preprocessor. Note that the current
+directory is not on the include search path by default---use
 `\cmdline{-I.}' for that. The \cmdline{-Y} option can be used to
 specify a different preprocessor to omnicpp. Beware that line
 directives inserted by other preprocessors are likely to confuse
@@ -3427,10 +3535,10 @@
 \file{SK.cc} file) from the `dynamic' stubs (the \file{DynSK.cc}
 file), so applications that do not need support for Any and TypeCode
 for a particular IDL file do not waste space with unnecessary
-definitions. New in omniORB 4.0, it is possible to output both the
-normal stubs \emph{and} the dynamic stubs to a single file, by simply
-specifying the same extension for both files. This command places
-both the normal stubs and the dynamic stubs in \file{aSK.cc}:
+definitions. It is possible to output both the normal stubs \emph{and}
+the dynamic stubs to a single file, by simply specifying the same
+extension for both files. This command places both the normal stubs
+and the dynamic stubs in \file{aSK.cc}:
 
 \begin{quote}
 \cmdline{omniidl -bcxx -Wba -Wbd=SK.cc a.idl}
@@ -3440,11 +3548,11 @@
 
 \subsection{Module splicing}
 
-On C++ compilers without namespace support, IDL modules map to C++
-classes, and so cannot be reopened. For some IDL, it is possible to
-`splice' reopened modules on to the first occurrence of the module, so
-all module definitions are in a single class. It is possible in this
-sort of situation:
+On ancient C++ compilers without namespace support, IDL modules map to
+C++ classes, and so cannot be reopened. For some IDL, it is possible
+to `splice' reopened modules on to the first occurrence of the module,
+so all module definitions are in a single class. It is possible in
+this sort of situation:
 
 \begin{idllisting}
 module M1 {
@@ -3552,8 +3660,9 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \label{chap:ins}
 
-omniORB 4.0 supports the Interoperable Naming Service (INS). The
-following is a summary of its facilities.
+omniORB supports the Interoperable Naming Service (INS). The following
+is a summary of its facilities.
+
 
 \section{Object URIs}
 
@@ -3694,7 +3803,7 @@
 \section{Configuring resolve\_initial\_references}
 \label{sec:insargs}
 
-The INS specified two standard command line arguments which provide a
+The INS specifies two standard command line arguments which provide a
 portable way of configuring \op{ORB::resolve\_initial\_references}:
 
 
@@ -3820,9 +3929,9 @@
 
 omniMapper is a simple daemon which listens on port 2809 (or any other
 port), and redirects IIOP requests for configured object keys to
-associated persistent IORs. It can be used to make a naming service
-(even an old non-INS aware version of omniNames or other ORB's naming
-service) appear on port 2809 with the object key
+associated persistent object references. It can be used to make a
+naming service (even an old non-INS aware version of omniNames or
+other ORB's naming service) appear on port 2809 with the object key
 `\texttt{NameService}'. The same goes for any other service you may
 wish to specify, such as an interface repository. omniMapper is
 started with a command line of:
@@ -3836,15 +3945,10 @@
 \noindent The \cmdline{-port} option allows you to choose a port other
 than 2809 to listen on. The \cmdline{-config} option specifies a
 location for the configuration file. The default name is
-\file{/etc/omniMapper.cfg}, or
-%BEGIN LATEX
-\file{C:\omniMapper.cfg}
-%END LATEX
-%HEVEA\verb|C:\omniMapper.cfg|
-on Windows. omniMapper does not normally print anything; the
-\cmdline{-v} option makes it verbose so it prints configuration
-information and a record of the redirections it makes, to standard
-output.
+\file{/etc/omniMapper.cfg}, or \file{C:\omniMapper.cfg} on
+Windows. omniMapper does not normally print anything; the \cmdline{-v}
+option makes it verbose so it prints configuration information and a
+record of the redirections it makes, to standard output.
 
 The configuration file is very simple. Each line contains a string to
 be used as an object key, some white space, and an IOR (or any valid
@@ -3892,7 +3996,13 @@
 can activate/deactivate it, create children, and so on, in the usual
 way.
 
-
+Children of the omniINSPOA do not inherit its special properties of
+creating simple object keys. If the omniINSPOA's policies are not
+suitable for your application, you cannot create a POA with different
+policies (such as single threading, for example), and still generate
+simple object keys. Instead, you can activate a servant in the
+omniINSPOA that uses location forwarding to redirect requests to
+objects in a different POA.
 
 
 
@@ -3922,7 +4032,7 @@
 Unless the \code{ID} pragma is specified in the IDL, the ORB generates
 the RepoId string in the so-called OMG IDL Format\footnote{For further
 details of the repository ID formats, see section 10.6 in the CORBA
-2.3 specification.}. For instance, the RepoId for the \intf{Echo}
+2.6 specification.}. For instance, the RepoId for the \intf{Echo}
 interface used in the examples of chapter~\ref{chap:basic} is
 \texttt{IDL:Echo:1.0}.
 
@@ -3958,8 +4068,8 @@
 The GIOP/IIOP specification allows an ORB to send a null string in the
 RepoId field of an IOR. It is up to the receiving end to work out the
 real type of the object. omniORB never sends out null strings as
-RepoId, but it may receive null RepoIds from other ORBs. In that case,
-it will use the mechanism described below to ensure type safety.
+RepoIds, but it may receive null RepoIds from other ORBs. In that
+case, it will use the mechanism described below to ensure type safety.
 
 
 \section{Interface Inheritance}
@@ -4013,7 +4123,9 @@
 };
 \end{idllisting}
 
-\lstset{labelstep=1,gobble=4}
+%BEGIN LATEX
+\lstset{stepnumber=1,gobble=4}
+%END LATEX
 \begin{cxxlisting}
  1  // C++
  2  C_ptr objC;
@@ -4026,7 +4138,7 @@
  9  objR =  objC->op2();
 10  objA =  A::_narrow(objR);
 \end{cxxlisting}
-\lstset{labelstep=0,gobble=0}
+\lstset{stepnumber=0,gobble=0}
 
 \noindent If the stubs of A,B,C,D are linked into the executable and:
 
@@ -4035,9 +4147,13 @@
 complete successfully. The remote object is only contacted at line 7.
 
 \item[Case 2] \op{C::op1} and \op{C::op2} return a D. This condition
-only occurs if the runtime of the remote end is buggy. The ORB raises
-a \code{CORBA::MARSHAL} exception at line 1 because it knows it has
-received an interface of the wrong type.
+only occurs if the runtime of the remote end is buggy. Even though the
+IDL definitions show that D is not derived from A, omniORB gives it
+the benefit of the doubt, in case it actually has a more derived
+interface that is derived from both A and D. At line 7, the object is
+contacted to ask if it is an A. The answer is no, so a
+\code{CORBA::INV\_OBJREF} exception is raised. At line 10, the narrow
+operation will fail, and objA will be set to nil.
 \end{description}
 
 \noindent If only the stubs of A are linked into the executable and:
@@ -4051,8 +4167,8 @@
 only occurs if the runtime of the remote end is buggy. Line 6
 completes and no exception is raised. At line 7, the object is
 contacted to ask if it is an A. If the answer is no, a
-\code{CORBA::INV\_OBJREF} exception is raised. The application will
-also see a \code{CORBA::INV\_OBJREF} at line 10.
+\code{CORBA::INV\_OBJREF} exception is raised. At line 10, the narrow
+operation will fail, and objA will be set to nil.
 \end{description}
 
 
@@ -4150,9 +4266,13 @@
 
 In the default one call per connection mode, there is a limit to the
 number of concurrent connections that are opened, set with the
-\code{maxGIOPConnection\dsc{}PerServer} parameter. To tell the ORB to
-multiplex calls on a single connection, set the
-\code{oneCallPerConnection} parameter to zero.
+\code{maxGIOPConnection\dsc{}PerServer} parameter. To tell the ORB
+that it may multiplex calls on a single connection, set the
+\code{oneCallPerConnection} parameter to zero. If the
+\code{oneCallPer\dsc{}Connection} parameter is set to the default
+value of one, and there are more concurrent calls than specified by
+\code{maxGIOPConnectionPerServer}, calls block waiting for connections
+to become free.
 
 Note that some server-side ORBs, including omniORB versions before
 version 4.0, are unable to deal with concurrent calls multiplexed on a
@@ -4175,6 +4295,7 @@
   void setClientCallTimeout(CORBA::ULong millisecs);
   void setClientCallTimeout(CORBA::Object_ptr obj, CORBA::ULong millisecs);
   void setClientThreadCallTimeout(CORBA::ULong millisecs);
+  void setClientConnectTimeout(CORBA::ULong millisecs);
 };
 \end{cxxlisting}
 
@@ -4192,6 +4313,52 @@
 To choose the timeout value to use for a call, the ORB first looks to
 see if there is a timeout for the object reference, then to the
 calling thread, and finally to the global timeout.
+
+When a client has no existing connection to communicate with a server,
+it must open a new connection before performing the
+call. \op{setClientConnect\dsc{}Timeout} sets an overriding timeout for
+cases where a new connection must be established. The effect of the
+connect timeout depends upon whether the connect timeout is greater
+or less than the timeout that would otherwise be used.
+
+\vspace{\baselineskip}\noindent
+As an example, imagine that the usual call timeout is 10 seconds:
+
+\subsubsection*{Connect timeout > usual timeout}
+
+If the connect timeout is set to 20 seconds, then a call that
+establishes a new connection will be permitted 20 seconds before it
+times out. Subsequent calls using the same connection have the normal
+10 second timeout. If establishing the connection takes 8 seconds,
+then the call itself takes 5 seconds, the call succeeds despite having
+taken 13 seconds in total, longer than the usual timeout.
+
+This kind of configuration is good when connections are slow to be
+established.
+
+\subsubsection*{Connect timeout < usual timeout}
+
+If the connect timeout is set to 2 seconds, the actual network-level
+connect is only permitted to take 2 seconds. As long as the connection
+is established in less than 2 seconds, the call can proceed. The 10
+second call timeout still applies to the time taken for the whole call
+(including the connection establishment). So, if establishing the
+connection takes 1.5 seconds, and the call itself takes 9.5 seconds,
+the call will time out because although it met the connection timeout,
+it exceeded the 10 second total call timeout. On the other hand, if
+establishing the connection takes 3 seconds, the call will fail after
+only 2 seconds, since only 2 seconds are permitted for the connect.
+
+If an object reference has multiple possible endpoints available, the
+client will attempt to connect to them in turn, until one succeeds.
+The connect timeout applies to each connection attempt. So with a
+connect timeout of 2 seconds, the client will spend up to 2 seconds
+attempting to connect to the first address and then, if that fails, up
+to 2 seconds trying the second address, and so on.
+
+This kind of configuration is useful where calls may take a long time
+to complete (so call timeouts are long), but a fast indication of
+connection failure is required.
 
 
 \section{Server side behaviour}
@@ -4228,7 +4395,7 @@
 the number of threads that can be allocated to a single connection
 containing concurrent calls. Setting the parameter to 1 mimics the
 behaviour of omniORB versions before 4.0, that did not support
-multiplexed calls.
+calls multiplexed on one connection.
 
 
 \subsection{Thread pool mode}
@@ -4243,9 +4410,9 @@
 
 The thread pool is not pre-initialised. Instead, threads are started
 on demand, and idle threads are stopped after a period of inactivity.
-The maximum number of threads that can be started in the pool is
-selected with the \code{maxServerThreadPool\dsc{}Size} parameter. The
-default is 100.
+The maximum number of threads that can be started in the pool is set
+with the \code{maxServerThreadPool\dsc{}Size} parameter. The default
+is 100.
 
 A common pattern in CORBA applications is for a client to make several
 calls to a single object in quick succession. To handle this situation
@@ -4261,6 +4428,14 @@
 parameter is set to zero, connection watching is disabled and threads
 return to the pool immediately after finishing a single request.
 
+In the face of multiplexed calls on a single connection, multiple
+threads from the pool can be dispatched for one connection, just as in
+thread per connection mode. With \code{threadPoolWatchConnection} set
+to the default value of 1, only the last thread servicing a connection
+will watch it when it finishes a request. Setting the parameter to a
+larger number allows the last \emph{n} connections to watch the
+connection.
+
 
 \subsection{Policy transition}
 
@@ -4299,10 +4474,10 @@
 It is wasteful to leave a connection open when it has been left unused
 for a considerable time. Too many idle connections could block out new
 connections when it runs out of spare communication channels. For
-example, most Unix platforms have a limit on the number of file
-handles a process can open. 64 is the usual default limit. The value
-can be increased to a maximum of a thousand or more by changing the
-`ulimit' in the shell.
+example, most platforms have a limit on the number of file handles a
+process can open. Many platforms have a very small default limit like
+64. The value can often be increased to a maximum of a thousand or
+more by changing the `ulimit' in the shell.
 
 Every so often, a thread scans all open connections to see which are
 idle. The scanning period (in seconds) is set with the
@@ -4357,27 +4532,27 @@
 
 Details are selected with the \code{endPoint} family of parameters.
 The simplest is plain \code{endPoint}, which chooses a transport and
-interface details, and publishes the information in IORs. End point
+interface details, and publishes the information in IORs. Endpoint
 parameters are in the form of URIs, with a scheme name of
 `\code{giop:}', followed by the transport name. Different transports
 have different parameters following the transport.
 
-TCP end points have the format:
+TCP endpoints have the format:
 
 \begin{quote}
 \code{giop:tcp:}\textit{<host>}\code{:}\textit{<port>}
 \end{quote}
 
-\noindent The host must be a valid host name for the server machine.
-It determines the network interface on which the server listens. The
-port selects the TCP port to listen on, which must be unoccupied.
-Either the host or port, or both can be left empty. If the host is
-empty, the ORB published the IP address of the first non-loopback
-network interface it can find (or the loopback if that is the only
-interface), but listens on \emph{all} network interfaces. If the port
-is empty, the operating system chooses a port.
-
-Multiple TCP end points can be selected, either to specify multiple
+\noindent The host must be a valid host name or IP address for the
+server machine.  It determines the network interface on which the
+server listens. The port selects the TCP port to listen on, which must
+be unoccupied.  Either the host or port, or both can be left empty. If
+the host is empty, the ORB publishes the IP address of the first
+non-loopback network interface it can find (or the loopback if that is
+the only interface), but listens on \emph{all} network interfaces. If
+the port is empty, the operating system chooses a port.
+
+Multiple TCP endpoints can be selected, either to specify multiple
 network interfaces on which to listen, or (less usefully) to select
 multiple TCP ports on which to listen.
 
@@ -4386,8 +4561,8 @@
 the first non-loopback network interface, the ORB listens on all
 interfaces, and the OS chooses a port number.
 
-SSL end points have the same format as TCP ones, except `\code{tcp}'
-is replaced with `\code{ssl}'. Unix domain socket end points have the
+SSL endpoints have the same format as TCP ones, except `\code{tcp}'
+is replaced with `\code{ssl}'. Unix domain socket endpoints have the
 format:
 
 \begin{quote}
@@ -4398,40 +4573,170 @@
 filesystem. If the filename is left blank, the ORB chooses a name
 based on the process id and a timestamp.
 
-
-\subsection{End point publishing}
-
-To publish an end point in IORs, without actually listening on that
-end point, the \code{endPointNoListen} parameter can be set. This can
-be useful in fault-tolerant applications where replicas of an object
-can be contacted at more than one server. \code{endPointNoListen} does
-not check that the transport specified is sensible for the current
-machine, so it allows the address of a different machine to be
-specified.
-
-Similarly, but less likely to be useful, it is possible to ask the
-server to listen on an end point, but not publish the details in IORs,
-using the \code{endPointNoPublish} parameter. This should \emph{not}
-be used for security by obscurity!
-
-If a machine has multiple TCP network interfaces, it may be useful to
-publish all interfaces, instead of just the first one. This is
-necessary if different interfaces are on separate non-gatewayed
-subnets, for example. Publishing all addresses could be achieved with
-lots of \code{endPoint} parameters, but a short-hand is to set the
-\code{endPointPublishAllIFs} parameter to 1. That (in conjunction with
-a `\code{giop:tcp::}' transport selection without a specific hostname)
-causes all the machine's non-loopback interfaces to be published in
+To listen on an endpoint without publishing it in IORs, specify it
+with the \code{endPointNoPublish} configuration parameter. See below
+for more details about endpoint publishing.
+
+
+\subsection{IPv6}
+
+On platforms where it is available, omniORB supports IPv6. On most
+Unix platforms, IPv6 sockets accept both IPv6 and IPv4 connections, so
+omniORB's default \code{giop:tcp::} endpoint accepts both IPv4 and
+IPv6 connections. On Windows, each socket type only accepts incoming
+connections of the same type, so an IPv6 socket cannot be used with
+IPv4 clients. For this reason, the default \code{giop:tcp::} endpoint
+only listens for IPv4 connections. Since endpoints with a specific
+host name or address only listen on a single network interface, they
+are inherently limited to just one protocol family.
+
+To explicitly ask for just IPv4 or just IPv6, an endpoint with the
+wildcard address for the protocol family should be used. For IPv4, the
+wildcard address is `\code{0.0.0.0}', and for IPv6 it is `\code{::}'.
+So, to listen for IPv4 connections on all IPv4 network interfaces, use
+an endpoint of:
+
+\begin{quote}
+\code{giop:tcp:0.0.0.0:}
+\end{quote}
+
+\noindent All IPv6 addresses contain colons, so the address portion in
+URIs must be contained within \code{[]} characters. Therefore, to
+listen just for IPv6 connections on all IPv6 interfaces, use the
+somewhat cryptic:
+
+\begin{quote}
+\code{giop:tcp:[::]:}
+\end{quote}
+
+\noindent To listen for both IPv4 and IPv6 connections on Windows,
+both endpoints must be explicitly provided.
+
+\subsubsection{Link local addresses}
+
+In IPv6, all network interfaces are assigned a \term{link local}
+address, starting with the digits \code{fe80}. The link local address
+is only valid on the same `link' as the interface, meaning directly
+connected to the interface, or possibly on the same subnet, depending
+on how the network is switched. To connect to a server's link local
+address, a client has to know which of its network interfaces is on
+the same link as the server. Since there is no way for omniORB to know
+which local interface a remote link local address may be connected to,
+and in extreme circumstances may even end up contacting the wrong
+server if it picks the wrong interface, link local addresses are not
+considered valid. Servers do not publish link local addresses in their
 IORs.
 
 
+\subsection{Endpoint publishing}
+
+For clients to be able to connect to a server, the server publishes
+endpoint information in its IORs (Interoperable Object References).
+Normally, omniORB publishes the first available address for each of
+the endpoints it is listening on.
+
+The endpoint information to publish is determined by the
+\code{endPointPublish} configuration parameter. It contains a
+comma-separated list of publish rules. The rules are applied in turn
+to each of the configured endpoints; if a rule matches an endpoint, it
+causes one or more endpoints to be published.
+
+The following core rules are supported:
+
+\vspace{\baselineskip}
+
+\begin{tabular}{p{.25\textwidth}p{.75\textwidth}}
+\code{addr} &     the first natural address of the endpoint\\
+\code{ipv4} &     the first IPv4 address of a TCP or SSL endpoint\\
+\code{ipv6} &     the first IPv6 address of a TCP or SSL endpoint\\
+\code{name} &     the first address that can be resolved to a name\\
+\code{hostname} & the result of the gethostname() system call\\
+\code{fqdn} &     the fully-qualified domain name\\
+\end{tabular}
+
+\vspace{\baselineskip}
+
+\noindent
+The core rules can be combined using the vertical bar operator to
+try several rules in turn until one succeeds. e.g:
+
+\vspace{\baselineskip}
+
+\begin{tabular}{p{.25\textwidth}p{.65\textwidth}}
+\code{name|ipv6|ipv4} & the name of the endpoint if it has one;
+                 	failing that, its first IPv6 address;
+                 	failing that, its first IPv4 address.
+\end{tabular}
+
+\vspace{\baselineskip}
+
+\noindent
+Multiple rules can be combined using the comma operator to
+publish more than one endpoint. e.g.
+
+\vspace{\baselineskip}
+
+\begin{tabular}{p{.25\textwidth}p{.65\textwidth}}
+\code{name,addr} & the name of the endpoint (if it has one),
+                   followed by its first address.
+\end{tabular}
+
+\vspace{\baselineskip}
+
+\noindent
+For endpoints with multiple addresses (e.g. TCP endpoints on
+multi-homed machines), the \code{all()} manipulator causes all
+addresses to be published. e.g.:
+
+\vspace{\baselineskip}
+
+\begin{tabular}{p{.25\textwidth}p{.65\textwidth}}
+\code{all(addr)} & all addresses are published\\
+\code{all(name)} & all addresses that resolve to names are published\\
+\code{all(name|addr)} & all addresses are published by name if they have
+                        one, address otherwise.\\
+\code{all(name,addr)} & all addresses are published by name (if they
+                        have one), and by address.\\
+\code{all(name), all(addr)} & first the names of all addresses are published,
+                             followed by all the addresses.\\
+\end{tabular}
+
+\vspace{\baselineskip}
+
+\noindent
+A specific endpoint can be published by giving its endpoint URI,
+even if the server is not listening on that endpoint. e.g.:
+
+\vspace{\baselineskip}
+
+\begin{tabular}{p{.25\textwidth}p{.65\textwidth}}
+\code{giop:tcp:not.my.host:12345}\\
+\code{giop:unix:/not/my/socket-file}\\
+\end{tabular}
+
+\vspace{\baselineskip}
+
+\noindent
+If the host or port number for a TCP or SSL URI are missed out,
+they are filled in with the details from each listening TCP/SSL
+endpoint. This can be used to publish a different name for a
+TCP/SSL endpoint that is using an ephemeral port, for example.
+
+omniORB 4.0 supported two options related to endpoint publishing that
+are superseded by the \code{endPointPublish} parameter, and so are now
+deprecated. Setting \code{endPointPublishAllIFs} to 1 is equivalent to
+setting \code{endPointPublish} to `\code{all(addr)}'. The
+\code{endPointNoListen} parameter is equivalent to adding endpoint
+URIs to the \code{endPointPublish} parameter.
+
+
 
 \section{Connection selection and acceptance}
 
-In the face of IORs containing details about multiple different end
-points, clients have to know how to choose the one to use to connect a
-server. Similarly, servers may wish to restrict which clients can
-connect to particular transports. This is achieved with
+In the face of IORs containing details about multiple different
+endpoints, clients have to know how to choose the one to use to
+connect a server. Similarly, servers may wish to restrict which
+clients can connect to particular transports. This is achieved with
 \term{transport rules}.
 
 
@@ -4454,10 +4759,18 @@
 1. & \code{localhost} & The address of this machine\\
 
 2. & \textit{w.x.y.z}\code{/}\textit{m1.m2.m3.m4} & An IPv4 address
-     with the bits selected by the mask, e.g.\
-     172.16.0.0/255.240.0.0.\\
-
-3. & \code{*} & Wildcard that matches any address\\
+     with bits selected by the mask, e.g.\
+     \code{172.16.0.0/255.240.0.0}\\
+
+3. & \textit{w.x.y.z}\code{/}\textit{prefixlen} & An IPv4 address with
+     \textit{prefixlen} significant bits, e.g.\
+     \code{172.16.2.0/24}\\
+
+4. & \textit{a:b:c:d:e:f:g:h}\code{/}\textit{prefixlen} & An IPv6
+     address with \textit{prefixlen} significant bits, e.g.\
+     \code{3ffe:505:2:1::/64}\\
+
+5. & \code{*} & Wildcard that matches any address\\
 \end{tabular}
 
 \vspace{\baselineskip}
@@ -4471,17 +4784,17 @@
 2. & \code{tcp}  & Use a TCP transport\\
 3. & \code{ssl}  & Use an SSL transport\\
 4. & \code{unix} & Use a Unix socket transport\\
-5. & \code{bidir}& Any connection to this address should be used
+5. & \code{bidir}& Connections to this address can be used
                    bidirectionally (see section~\ref{sec:bidir})\\
 \end{tabular}
 
 \vspace{\baselineskip}
 
 \noindent The transport-selecting actions form a prioritised list, so
-an action of `\code{unix,tcp,ssl}' means to use a Unix transport if
-there is one, failing that a TCP transport, failing \emph{that} an SSL
+an action of `\code{unix,ssl,\dsc{}tcp}' means to use a Unix transport if
+there is one, failing that a SSL transport, failing \emph{that} a TCP
 transport. In the absence of any explicit rules, the client uses the
-implicit rule of `\code{* unix,tcp,ssl}'.
+implicit rule of `\code{* unix,ssl,tcp}'.
 
 If more than one rule is specified, they are prioritised in the order
 they are specified. For example, the configuration file might contain:
@@ -4497,14 +4810,14 @@
 (172.16.0.0), and connections to other networks are not permitted at
 all.
 
-In general, the result of filtering the end point specifications in an
+In general, the result of filtering the endpoint specifications in an
 IOR with the client transport rule will be a prioritised list of
 transports and networks. (If the transport rules do not prioritise one
-end point over another, the order the end points are listed in the IOR
+endpoint over another, the order the endpoints are listed in the IOR
 is used.)  When trying to contact an object, the ORB tries its
-possible end points in turn, until it finds one with which it can
+possible endpoints in turn, until it finds one with which it can
 contact the object. Only after it has unsuccessfully tried all
-permissible transports will it raise a \code{TRANSIENT} exception to
+permissible endpoints will it raise a \code{TRANSIENT} exception to
 indicate that the connect failed.
 
 
@@ -4512,7 +4825,7 @@
 \subsection{Server transport rules}
 \label{sec:serverRule}
 
-The server transport rules gave the same format as client transport
+The server transport rules have the same format as client transport
 rules. Rather than being used to select which of a set of ways to
 contact a machine, they are used to determine whether or not to accept
 connections from particular clients. In this example, we only allow
@@ -4524,7 +4837,7 @@
                       = *                          none
 \end{verbatim}
 
-\noindent And in this one, we only accept SSL connections if the
+\noindent And in this one, we accept only SSL connections if the
 client is not on the intranet:
 
 \begin{verbatim}
@@ -4533,7 +4846,9 @@
                       = *                          ssl,bidir
 \end{verbatim}
 
-
+\noindent In the absence of any explicit rules, the server uses the
+implicit rule of `\code{* unix,\dsc{}ssl,tcp}', meaning any kind of
+connection is accepted from any client.
 
 
 \section{Bidirectional GIOP}
@@ -4576,9 +4891,9 @@
 
 \section{SSL transport}
 
-omniORB 4.0 supports an SSL transport, using OpenSSL. It is only built
-if OpenSSL is available. On platforms using Autoconf, it is
-autodetected in many locations, or its location can be given with the
+omniORB supports an SSL transport, using OpenSSL. It is only built if
+OpenSSL is available. On platforms using Autoconf, it is autodetected
+in many locations, or its location can be given with the
 \code{-{}-with-openssl=} argument to \code{configure}. On other
 platforms, the \code{OPEN\_SSL\_ROOT} make variable must be set in the
 platform file.
@@ -4597,7 +4912,7 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \label{chap:codesets}
 
-omniORB 4.0 supports full code set negotiation, used to select and
+omniORB supports full code set negotiation, used to select and
 translate between different character code sets, for the transmission
 of chars, strings, wchars and wstrings. The support is mostly
 transparent to application code, but there are a number of options
@@ -4658,10 +4973,10 @@
 tables to convert simple 8-bit and 16-bit code sets to Unicode.
 
 When sending or receiving string data, there are a total of four code
-sets in action: a native char code set, and transmission char code
-set, a native wchar code set, and a transmission wchar code set. The
-native code sets are as described above; the transmission code sets
-are the ones selected to communicate with a remote machine. They are
+sets in action: a native char code set, a transmission char code set,
+a native wchar code set, and a transmission wchar code set. The native
+code sets are as described above; the transmission code sets are the
+ones selected to communicate with a remote machine. They are
 responsible for understanding the GIOP marshalling formats, as well as
 the code sets themselves. Each of the four code sets has an object
 associated with it which contains methods for converting data.
@@ -4691,9 +5006,9 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \label{chap:interceptors}
 
-omniORB 4.0 supports interceptors that allow the application to insert
+omniORB supports interceptors that allow the application to insert
 processing in various points along the call chain, and in various
-other locations. It does not support the standard Portable
+other locations. It does not yet support the standard Portable
 Interceptors API.
 
 The interceptor interfaces are defined in a single header,
@@ -4709,17 +5024,10 @@
 
     class info_T {
     public:
-      giopStream&              giopstream;
-      const omniIOR&           ior;
-      const char*              opname;
-      CORBA::Boolean           oneway;
-      CORBA::Boolean           response_expected;
-      IOP::ServiceContextList  service_contexts;
-
-      info_T(giopStream& s, const omniIOR& i, const char* op,
-	     CORBA::Boolean ow, CORBA::Boolean re) :
-	giopstream(s),ior(i),opname(op),oneway(ow),response_expected(re),
-	service_contexts(5) {}
+      GIOP_C&                 giop_c;
+      IOP::ServiceContextList service_contexts;
+
+      info_T(GIOP_C& c) : giop_c(c), service_contexts(5) {}
 
     private:
       info_T();
@@ -4744,8 +5052,8 @@
 interceptor returns false, later interceptors are not called. You
 should only do that if you really know what you are doing.
 
-Notice that the \code{info\_T} contains references to several omniORB
-internal data types. The definitions of these can be found in other
+Notice that the \code{info\_T} contains references to omniORB internal
+data types. The definitions of these types can be found in other
 header files within \file{include/omniORB4} and
 \file{include/omniORB4/internal}.
 
@@ -4753,10 +5061,11 @@
 \section{Interceptor registration}
 
 All the interceptor singletons are registered within another singleton
-object of class \code{omniInterceptors}. You retrieve a pointer to
-that singleton with the \op{omniORB::\dsc{}getInterceptors} function,
-which must be called after \op{CORBA::ORB\_init}, but before the ORB
-is used. The code to register an interceptor looks, for example, like:
+object of class \code{omniInterceptors}. You retrieve a pointer to the
+object with the \op{omniORB::\dsc{}getInterceptors} function, which
+must be called after the ORB has been initialised with
+\op{CORBA::ORB\_init}, but before the ORB is used. The code to
+register an interceptor looks, for example, like:
 
 \begin{cxxlisting}
 omniInterceptors* interceptors = omniORB::getInterceptors();
@@ -4889,11 +5198,6 @@
 
 
 
-
-
-
-
-
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \chapter{Type Any and TypeCode}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -4912,25 +5216,6 @@
 core section of the CORBA specification.
 
 
-\begin{statement}
-\centerline{\textbf{Warning}}
-
-Since 2.8.0, omniORB has been updated to CORBA 2.3 and above. In order
-to comply with the 2.3 specification, it was necessary to change the
-semantics of \emph{the extraction of string, object reference and
-typecode from an Any}. The memory of the extracted values of these
-types now belongs to the Any value. The storage is freed when the Any
-value is deallocated.  Previously the extracted value was a copy and
-the application was responsible for releasing the storage. It is not
-possible to detect the old usage at compile time. In particular,
-unmodified code that uses the affected Any extraction operators will
-most certainly cause runtime errors to occur.  To smooth the
-transition from the old usage to the new, an ORB configuration
-parameter \code{omniORB\_27\_CompatibleAnyExtraction} can be set to
-revert the Any extraction operators to the old semantics.
-
-\end{statement}
-
 
 \section{Example using type Any}
 
@@ -4947,7 +5232,6 @@
 
 \begin{idllisting}
 // IDL
-
 interface anyExample {
   any testOp(in any mesg);
 };
@@ -5031,23 +5315,20 @@
 // C++
 CORBA::Long l;
 CORBA::Double d;
-const char* str;     // From CORBA 2.3 onwards, uses const char*
-                     // instead of char*. 
+const char* str;
 
 if (an_any >>= l) {
-    cout << "Long: " << l << endl;
+  cout << "Long: " << l << endl;
 }
 else if (an_any >>= d) {
-    cout << "Double: " << d << endl;
+  cout << "Double: " << d << endl;
 }
 else if (an_any >>= str) {
-    cout << "String: " << str << endl;
-    // Since 2.8.0 the storage of the extracted string is still
-    // owned by the any.
-    // In pre-omniORB 2.8.0 releases, the string returned is a copy.
+  cout << "String: " << str << endl;
+  // The storage of the extracted string is still owned by the any.
 }
 else {
-    cout << "Unknown value." << endl;
+  cout << "Unknown value." << endl;
 }
 \end{cxxlisting}
 
@@ -5110,8 +5391,7 @@
 type from the Any, and can be used as follows:
 
 \begin{cxxlisting}
-const testStruct* tp;   // From CORBA 2.3 onwards, use 
-                        // const testStruct* instead of testStruct*
+const testStruct* tp;
 
 if (an_any >>= tp) {
     cout << "testStruct: l: " << tp->l << endl;
@@ -5149,20 +5429,16 @@
 This section contains some notes on the use and behaviour of type Any
 in omniORB.
 
-\paragraph*{Generating Insertion and Extraction Operators.}
+\subsection{Generating Insertion and Extraction Operators.}
 To generate type Any insertion and extraction operators for
 constructed types and interfaces, the \texttt{-Wba} command line flag
 should be specified when running omniidl.
 
-\paragraph*{TypeCode comparison when extracting from an Any.}
+\subsection{TypeCode comparison when extracting from an Any.}
 When an attempt is made to extract a type from an Any, the TypeCode of
 the type is checked for \emph{equivalence} with the TypeCode of the
 type stored by the Any. The \op{equivalent} test in the TypeCode
-interface is used for this purpose\footnote{In pre-omniORB 2.8.0
-releases, omniORB performs an equality test and will ignore any alias
-TypeCodes (\code{tk\_alias}) when making this comparison. The
-semantics is similar to the \op{equivalent} test in the TypeCode
-interface of CORBA 2.3.}.
+interface is used for this purpose.
 
 Examples:
 
@@ -5188,21 +5464,11 @@
 1 from an Any containing the \type{Test1} defined in IDL 2, this will
 succeed (and vice-versa), as the two types differ only by an alias.
 
-\paragraph*{Top-level aliases.}
+\subsection{Top-level aliases.}
 When a type is inserted into an Any, the Any stores both the value of
-the type and the TypeCode for that type. The treatment of top-level
-aliases from omniORB 2.8.0 onwards is different from pre-omniORB 2.8.0
-releases.
-
-In pre-omniORB 2.8.0 releases, if there are any top-level
-\code{tk\_alias} TypeCodes in the TypeCode, they will be removed from
-the TypeCode stored in the Any. Note that this does not affect the
-\code{\_tc\_} TypeCode generated to represent the type (see section on
-TypeCode, below). This behaviour is necessary, as two types that
-differ only by a top-level alias can use the same insertion and
-extraction operators. If the \code{tk\_alias} is not removed, one of
-the types could be transmitted with an incorrect \code{tk\_alias}
-TypeCode. Example:
+the type and the TypeCode for that type. However, in some cases, a
+top-level alias can be lost due to the details of the C++ mapping. For
+example, consider these IDL definitions:
 
 \begin{idllisting}
 // IDL 3
@@ -5211,44 +5477,43 @@
 typedef seqDouble2       seqDouble3;
 \end{idllisting}
 
-If either \type{seqDouble1} or \type{seqDouble2} is inserted into an
-Any, the TypeCode stored in the Any will be for a
-\code{sequence<double>}, and not for an alias to a
-\code{sequence<double>}.
-
-From omniORB 2.8.0 onwards, there are two changes. Firstly, in the
-example, \type{seqDouble1} and \type{seqDouble2} are now distinct
-types and therefore each has its own set of C++ operators for Any
-insertion and extraction. Secondly, the top level aliases are not
-removed. For example, if \type{seqDouble3} is inserted into an Any,
-the insertion operator for \type{seqDouble2} is invoked (because
-\type{seqDouble3} is just a C++ typedef of
-\type{seqDouble2}). Therefore, the TypeCode in the Any would be that
-of seqDouble2. If this is not desirable, one can use the new member
-function `\code{void type(TypeCode\_ptr)}' of the Any interface to
-explicitly set the TypeCode to the correct one.
-
-
-\paragraph*{Removing aliases from TypeCodes.}
-Some ORBs (such as Orbix) will not accept TypeCodes containing
-\code{tk\_alias} TypeCodes. When using type Any while interoperating
-with these ORBs, it is necessary to remove \code{tk\_alias} TypeCodes
-from throughout the TypeCode representing a constructed type.
-
-To remove all \code{tk\_alias} TypeCodes from TypeCodes stored in
+omniidl generates distinct types for \type{seqDouble1} and
+\type{seqDouble2}, and therefore each has its own set of C++ operators
+for Any insertion and extraction. That means inserting a
+\type{seqDouble1} into an Any sets the Any's TypeCode to include the
+alias `seqDouble1', and inserting a \type{seqDouble2} sets the
+TypeCode to the alias `seqDouble2'.
+
+However, in the C++ mapping, \type{seqDouble3} is required to be just
+a C++ typedef to \type{seqDouble2}, so the C++ compiler uses the Any
+insertion operator for \type{seqDouble2}. Therefore, inserting a
+\type{seqDouble3} sets the Any's TypeCode to the \type{seqDouble2}
+alias. If this is not desirable, you can use the member function
+`\code{void type(TypeCode\_ptr)}' of the Any interface to explicitly
+set the TypeCode to the correct one.
+
+
+\subsection{Removing aliases from TypeCodes.}
+Some ORBs (such as old versions of Orbix) will not accept TypeCodes
+containing \code{tk\_alias} TypeCodes. When using type Any while
+interoperating with these ORBs, it is necessary to remove
+\code{tk\_alias} TypeCodes from throughout the TypeCode representing a
+constructed type.
+
+To remove all \code{tk\_alias} TypeCodes from TypeCodes transmitted in
 Anys, supply the \texttt{-ORBtcAliasExpand 1} command-line flag when
 running an omniORB executable. There will be some (small) performance
-penalty when inserting values into an Any.
+penalty when transmitting Any values.
 
 Note that the \code{\_tc\_} TypeCodes generated for all constructed
 types will contain the complete TypeCode for the type (including any
 \code{tk\_alias} TypeCodes), regardless of whether the
-\texttt{-ORBtcAliasExpand} flag is set to 1 or not.
-
-\paragraph*{Recursive TypeCodes.}
-omniORB (as of version 2.7) supports recursive TypeCodes. This means
-that types such as the following can be inserted or extracted from an
-Any:
+\texttt{-ORBtcAliasExpand} flag is set to 1 or not. It is only when
+Anys are transmitted that the aliases are stripped.
+
+\subsection{Recursive TypeCodes.}
+omniORB supports recursive TypeCodes. This means that types such as
+the following can be inserted or extracted from an Any:
 
 \begin{idllisting}
 // IDL 4
@@ -5258,14 +5523,14 @@
 \end{idllisting}
 
 
-\paragraph*{Threads and type Any.}
+\subsection{Threads and type Any.}
 Inserting and extracting simultaneously from the same Any (in 2
-different threads) is undefined behaviour.
-
-Extracting simultaneously from the same Any (in 2 or more different
-threads) also leads to undefined behaviour.  It was decided not to
-protect the Any with a mutex, as this condition should rarely arise,
-and adding a mutex would lead to performance penalties.
+different threads) results in undefined behaviour.
+
+In versions of omniORB before 4.0, extracting simultaneously from the
+same Any (in 2 or more different threads) also led to undefined
+behaviour. That is no longer the case---Any extraction is now thread
+safe.
 
 
 \section{TypeCode in omniORB}
@@ -5273,7 +5538,7 @@
 This section contains some notes on the use and behaviour of TypeCode
 in omniORB
 
-\paragraph*{TypeCodes in IDL.}
+\subsection{TypeCodes in IDL.}
 
 When using TypeCodes in IDL, note that they are defined in the CORBA
 scope.  Therefore, \type{CORBA::TypeCode} should be used. Example:
@@ -5286,18 +5551,19 @@
 };
 \end{idllisting}
 
-\paragraph*{orb.idl}
-
-Inclusion of the file \file{orb.idl} in IDL using
-\type{CORBA::TypeCode} is optional.  An empty \file{orb.idl} file is
-provided for compatibility purposes.
-
-\paragraph*{Generating TypeCodes for constructed types.}
+\subsection{orb.idl}
+
+The CORBA specification says that IDL using \type{CORBA::TypeCode}
+must include the file \file{orb.idl}. That is not required in omniORB,
+but a suitable \file{orb.idl} is available.
+
+
+\subsection{Generating TypeCodes for constructed types.}
 
 To generate a TypeCode for constructed types, specify the
 \texttt{-Wba} command-line flag when running omniidl. This will
 generate a \code{\_tc\_} TypeCode describing the type, at the same
-scope as the type (as per the CORBA 2.3 specification). Example:
+scope as the type. Example:
 
 \begin{idllisting}
 // IDL 6
@@ -5312,40 +5578,6 @@
 can be used to query the TypeCode about the type it represents.
 
 
-\paragraph*{TypeCode equality.}
-
-The behaviour of \op{CORBA::TypeCode::equal} member function from
-omniORB 2.8.0 onwards is different from pre-omniORB 2.8.0 releases.
-In summary, the pre-omniORB 2.8.0 is close to the semantics of the new
-\op{CORBA::TypeCode::equivalent} member function. Details are as
-follows:
-
-The \op{CORBA::TypeCode::equal} member function will now return true
-only if the two TypeCodes are \emph{exactly} the same.
-\code{tk\_alias} TypeCodes are included in this comparison, unlike the
-comparison made when values are extracted from an Any (see section on
-Any, above).
-
-In pre-omniORB 2.8.0 releases, equality test would ignore the optional
-fields when one of the fields in the two typecodes is empty. For
-example, if one of the TypeCodes being checked is a \code{tk\_struct},
-\code{tk\_union}, \code{tk\_enum}, or \code{tk\_alias}, and has an
-empty repository ID parameter, then the repository ID parameter will
-be ignored when checking for equality.  Similarly, if the \code{name}
-or \code{member\_name} parameters of a TypeCode are empty strings,
-they will be ignored for equality checking purposes. This is because a
-CORBA 2 ORB does not have to include these parameters in a TypeCode
-(see the Interoperability section of the CORBA specification). Note
-that these (optional) parameters are included in TypeCodes generated
-by omniORB.
-
-Since CORBA 2.3, the issue of TypeCode equality has been clarified.
-There is now a new member \op{CORBA::TypeCode::equivalent} which
-provides the semantics of the \op{CORBA::TypeCode::equal} as
-implemented in omniORB releases prior to 2.8.0. So from omniORB 2.8.0
-onwards, the \op{CORBA::TypeCode::\dsc{}equal} function has been
-changed to enforce strict equality.  The pre-2.8.0 behaviour can be
-obtained with \op{equivalent}.
 
 
 \clearpage
@@ -5363,13 +5595,19 @@
 //
 // Usage: anyExample_impl
 //
-//        On startup, the object reference is printed to cerr as a
+//        On startup, the object reference is printed to cout as a
 //        stringified IOR. This string should be used as the argument to 
 //        anyExample_clt.
 //
 
-#include <iostream.h>
 #include <anyExample.hh>
+
+#ifdef HAVE_STD
+#  include <iostream>
+   using namespace std;
+#else
+#  include <iostream.h>
+#endif
 
 class anyExample_i : public POA_anyExample {
 public:
@@ -5378,6 +5616,7 @@
   virtual CORBA::Any* testOp(const CORBA::Any& a);
 };
 
+
 CORBA::Any* anyExample_i::testOp(const CORBA::Any& a)
 {
   cout << "Any received, containing: " << endl;
@@ -5391,12 +5630,15 @@
 
   testStruct* tp;
 
+
   if (a >>= l) {
     cout << "Long: " << l << endl;
   }
 #ifndef NO_FLOAT
+  // XXX - should we provide stream ops for _CORBA_Double_ and
+  // _CORBA_Float_on VMS??
   else if (a >>= d) {
-    cout << "Double: " << d << endl;
+    cout << "Double: " << (double)d << endl;
   }
 #endif
   else if (a >>= str) {
@@ -5423,7 +5665,7 @@
 int main(int argc, char** argv)
 {
   try {
-    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB3");
+    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
 
     CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
     PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
@@ -5434,7 +5676,7 @@
 
     obj = myobj->_this();
     CORBA::String_var sior(orb->object_to_string(obj));
-    cerr << "'" << (char*)sior << "'" << endl;
+    cout << (char*)sior << endl;
 
     myobj->_remove_ref();
 
@@ -5444,11 +5686,11 @@
     orb->run();
     orb->destroy();
   }
-  catch(CORBA::SystemException&) {
-    cerr << "Caught CORBA::SystemException." << endl;
-  }
-  catch(CORBA::Exception&) {
-    cerr << "Caught CORBA::Exception." << endl;
+  catch(CORBA::SystemException& ex) {
+    cerr << "Caught CORBA::" << ex._name() << endl;
+  }
+  catch(CORBA::Exception& ex) {
+    cerr << "Caught CORBA::Exception: " << ex._name() << endl;
   }
   catch(omniORB::fatalException& fe) {
     cerr << "Caught omniORB::fatalException:" << endl;
@@ -5456,9 +5698,6 @@
     cerr << "  line: " << fe.line() << endl;
     cerr << "  mesg: " << fe.errmsg() << endl;
   }
-  catch(...) {
-    cerr << "Caught unknown exception." << endl;
-  }
   return 0;
 }
 \end{cxxlisting}
@@ -5470,7 +5709,7 @@
 
 \begin{cxxlisting}
 // anyExample_clt.cc -  This is the source code of the example used in 
-//                      Chapter 9 "Type Any and TypeCode" of the omniORB 
+//                      Chapter 9 "Type Any and TypeCode" of the omniORB
 //                      users guide.
 //
 //                      This is the client.
@@ -5478,8 +5717,15 @@
 // Usage: anyExample_clt <object reference>
 //
 
-#include <iostream.h>
 #include <anyExample.hh>
+
+#ifdef HAVE_STD
+#  include <iostream>
+   using namespace std;
+#else
+#  include <iostream.h>
+#endif
+
 
 static void invokeOp(anyExample_ptr& tobj, const CORBA::Any& a)
 {
@@ -5498,6 +5744,7 @@
     cout << "Unknown value." << "\n" << endl;
   }
 }
+
 
 static void hello(anyExample_ptr tobj)
 {
@@ -5538,42 +5785,40 @@
 int main(int argc, char** argv)
 {
   try {
-    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB3");
+    CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
 
     if( argc != 2 ) {
       cerr << "usage:  anyExample_clt <object reference>" << endl;
       return 1;
     }
 
-    CORBA::Object_var obj = orb->string_to_object(argv[1]);
-    anyExample_var ref = anyExample::_narrow(obj);
-    if( CORBA::is_nil(ref) ) {
-      cerr << "Can't narrow reference to type anyExample (or it was nil)."
-	   << endl;
-      return 1;
+    {
+      CORBA::Object_var obj = orb->string_to_object(argv[1]);
+      anyExample_var ref = anyExample::_narrow(obj);
+      if( CORBA::is_nil(ref) ) {
+	cerr << "Can't narrow reference to type anyExample (or it was nil)."
+	     << endl;
+	return 1;
+      }
+      hello(ref);
     }
-    hello(ref);
-
     orb->destroy();
   }
-  catch(CORBA::COMM_FAILURE& ex) {
-    cerr << "Caught system exception COMM_FAILURE -- unable to contact the "
-         << "object." << endl;
-  }
-  catch(CORBA::SystemException&) {
-    cerr << "Caught a CORBA::SystemException." << endl;
-  }
-  catch(CORBA::Exception&) {
-    cerr << "Caught CORBA::Exception." << endl;
+  catch(CORBA::TRANSIENT&) {
+    cerr << "Caught system exception TRANSIENT -- unable to contact the "
+         << "server." << endl;
+  }
+  catch(CORBA::SystemException& ex) {
+    cerr << "Caught a CORBA::" << ex._name() << endl;
+  }
+  catch(CORBA::Exception& ex) {
+    cerr << "Caught CORBA::Exception: " << ex._name() << endl;
   }
   catch(omniORB::fatalException& fe) {
     cerr << "Caught omniORB::fatalException:" << endl;
     cerr << "  file: " << fe.file() << endl;
     cerr << "  line: " << fe.line() << endl;
     cerr << "  mesg: " << fe.errmsg() << endl;
-  }
-  catch(...) {
-    cerr << "Caught unknown exception." << endl;
   }
   return 0;
 }
@@ -5759,7 +6004,352 @@
 \end{enumerate}
 
 
-
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\chapter[Objects by value, etc.]
+  {Objects by value, abstract interfaces and local interfaces}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\label{chap:valuetype}
+
+omniORB 4.1 supports objects by value, declared with the
+\code{valuetype} keyword in IDL, and both abstract and local
+interfaces. This chapter outlines some issues to do with using these
+types in omniORB. You are assumed to have read the relevant parts of
+the CORBA specification, specifically chapters 3, 4, 5 and 6 of the
+CORBA 2.6 specification, and sections 1.17, 1.18 and 1.35 of the C++
+mapping specification, version 1.1.
+
+
+\section{Features}
+
+omniORB supports the complete objects by value specification, with the
+exception of custom valuetypes. All other valuetype features including
+value boxes, value sharing semantics, abstract valuetypes, and
+abstract interfaces are supported. Local interfaces are supported,
+with a number of caveats outlined in
+section~\ref{sec:LocalInterfaces}.
+
+
+\section{Reference counting}
+
+Values are reference counted. This means that, as long as your
+application properly manages reference counts, values are usually
+automatically deleted when they are no longer required. However, one
+of the features of valuetypes is that they support the representation
+of cyclic graph structures. In that kind of situation, the reference
+counting garbage collection does not work, because references internal
+to the graph prevent the reference counts ever becoming zero.
+
+To avoid memory leaks, application code must explicitly break any
+reference cycles in values it manipulates. This includes graphs of
+values received as parameters and return values from CORBA operations.
+
+
+\section{Value sharing and local calls}
+
+When valuetypes are passed as parameters in CORBA calls (i.e.\ calls
+on CORBA objects declared with \code{interface} in IDL), the structure
+of related values is maintained. Consider, for example, the following
+IDL definitions (which are from the example code in
+\file{src/examples/valuetype/simple}:
+
+\begin{idllisting}
+module ValueTest {
+  valuetype One {
+    public string s;
+    public long   l;
+  };
+
+  interface Test {
+    One op1(in One a, in One b);
+  };
+};
+\end{idllisting}
+
+If the client to the \type{Test} object passes the same value in both
+parameters, just one value is transmitted, and the object
+implementation receives a copy of the single value, with references to
+it in both parameters.
+
+In the case that the object is remote from the client, there is
+obviously a copying step involved. In the case that the object is in
+the same address space as the client, the same copying semantics must
+be maintained so that the object implementation can modify the values
+it receives without the client seeing the modifications. To support
+that, omniORB must copy the entire parameter list in one operation, in
+case there is sharing between different parameters. Such copying is a
+rather more time-consuming process than the parameter-by-parameter
+copy that takes place in calls not involving valuetypes.
+
+To avoid the overhead of copying parameters in this way, applications
+can choose to relax the semantics of value copying in local calls, so
+values are not copied at all, but are passed by reference. In that
+case, the client to a call \emph{will} see any modifications to the
+values it passes as parameters (and similarly, the object
+implementation will see any changes the client makes to returned
+values). To choose this option, set the \code{copyValuesInLocalCalls}
+configuration parameter to zero.
+
+
+\section{Value box factories}
+
+With normal valuetypes, omniidl generates factory classes (with names
+ending \code{\_init}) as required by the C++ mapping specification.
+The application is responsible for registering the factories with the
+ORB.
+
+Unfortunately, the C++ mapping makes no mention of factories for value
+boxes. In omniORB, factories for value boxes are automatically
+registered with the ORB, and there are no application-visible factory
+classes generated for them. Some other CORBA implementations generate
+application visible factories, and the application \emph{does} have to
+register the factories with the ORB.
+
+
+\section{Standard value boxes}
+
+The standard \type{CORBA::StringValue} and \type{CORBA::WStringValue}
+value boxes are available to application code. To make the definitions
+available in IDL, \#include the standard \file{orb.idl}.
+
+
+\section{Covariant returns}
+
+As required by the C++ mapping, on C++ compilers that support
+covariant return types, omniidl generates code for the
+\op{\_copy\_value} function that returns the most derived type of the
+value. On older compilers, \op{\_copy\_value} returns
+\type{CORBA::ValueBase}.
+
+If you write code that calls \op{\_copy\_value}, and you need to
+support older compilers, you should assign the result to a variable of
+type \type{CORBA::ValueBase*} and downcast to the target type, rather
+than using the covariant return.
+
+If you are overriding \op{\_copy\_value}, you must correctly take
+account of the \code{OMNI\_HAVE\_COVARIANT\_RETURNS} preprocessor
+definition.
+
+
+
+\section{Values inside Anys}
+
+Valuetypes inserted into Anys cause a number of interesting issues.
+Even when inside Anys, values are required to support complete sharing
+semantics. Take this IDL for example:
+
+\begin{idllisting}
+module ValueTest {
+  valuetype One {
+    public string s;
+    public long   l;
+  };
+
+  interface AnyTest {
+    void op1(in One v, in Any a);
+  };
+};
+\end{idllisting}
+
+\noindent Now, suppose the client behaves as follows:
+
+\begin{cxxlisting}
+ValueTest::One* v = new One_impl("hello", 123);
+CORBA::Any a;
+a <<= v;
+obj->op1(v, a);
+\end{cxxlisting}
+
+\noindent then on the server side:
+
+\begin{cxxlisting}
+void AnyTest_impl::op1(ValueTest::One* v, CORBA::Any& a)
+{
+  ValueTest::One* v2;
+  a >>= v2;
+  assert(v2 == v);
+}
+\end{cxxlisting}
+
+\noindent
+This is all very well in this kind of simple situation, but problems
+can arise if truncatable valuetypes are used. Imagine this derived
+value:
+
+\begin{idllisting}
+module ValueTest {
+  valuetype Two : truncatable One {
+    public double d;
+  };
+};
+\end{idllisting}
+
+\noindent
+Now, suppose that the client shown above sends an instance of
+valuetype \type{Two} in both parameters, and suppose that the server
+has not seen the definition of valuetype \type{Two}. In this
+situation, as the first parameter is unmarshalled, it will be
+truncated to valuetype \type{One}, as required. Now, when the Any is
+unmarshalled, it refers to the same value, which has been truncated.
+So, even though the TypeCode in the Any indicates that the value has
+type \type{Two}, the stored value actually has type \type{One}. If the
+receiver of the Any tries to pass it on, transmission will fail
+because the Any's value does not match its TypeCode.
+
+In the opposite situation, where an Any parameter comes before a
+valuetype parameter, a different problem occurs. In that case, as the
+Any is unmarshalled, there is no type information available for
+valuetype \type{Two}, so the value inside the Any has an internal
+omniORB type used for unknown valuetypes. As the next parameter is
+unmarshalled, omniORB sees that the shared value is unknown, and is
+able to convert it to the target \type{One} valuetype with
+truncation. In this case, the Any and the plain valuetype both have
+the correct types and values, but the fact that both should have
+referred to the same value has been lost.
+
+Because of these issues, it is best to avoid defining interfaces that
+mix valuetypes and Anys in a single operation, and certainly to avoid
+trying to share plain values with values inside Anys.
+
+
+\subsection{Values inside DynAnys}
+
+The sharing semantics of valuetypes can also cause difficulties for
+DynAny. The CORBA 2.6 specification does not mention how shared values
+inside DynAnys should be handled; the CORBA 3.x specification slightly
+clarifies the situation, but it is still unclear. To write portable
+code it is best to avoid manipulating DynAnys containing values that
+are shared.
+
+In omniORB, when a value inside an Any is converted into a DynAny, the
+value's state is copied into the DynAny, and manipulated there. When
+converting back to an Any a new value is created. This means that any
+other references to the original value (whether themselves inside Anys
+of not) still relate to the original value, with unchanged state.
+However, this copying only occurs when a DynValue is actually created,
+so for example a structure with two value members referring to the
+same value can manipulated inside a DynAny without breaking the
+sharing, provided the value members are not accessed as DynAnys.
+Extracting the value members as ValueBase will reveal the sharing, for
+example.
+
+
+\section{Local Interfaces}
+\label{sec:LocalInterfaces}
+
+Local interfaces are somewhat under-specified in the C++ mapping. This
+section outlines the way local interfaces are supported in omniORB,
+and details the limitations and issues.
+
+\subsection{Simple local interfaces}
+
+With simple IDL, there are no particular issues:
+
+\begin{idllisting}
+module Test {
+  local interface Example {
+    string hello(in string arg);
+  };
+};
+\end{idllisting}
+
+The IDL compiler generates an abstract base class
+\type{Test::Example}. The application defines a class derived from it
+that implements the abstract \op{hello} member function. Instances of
+that class can then be used where the IDL specifies interface
+\type{Example}.
+
+Note that, by default, local interface implementations have no
+reference counting behaviour. If the local object should be deleted
+when the last reference is released, the application must implement
+the \op{\_add\_ref} and \op{\_remove\_ref} virtual member functions
+within the implementation class. Make sure that the implementations
+are thread safe.
+
+
+\subsection{Inheritance from unconstrained interfaces}
+
+Local interfaces can inherit from unconstrained (i.e.\ non-local)
+interfaces:
+
+\begin{idllisting}
+module Test {
+  interface One {
+    void problem(inout string arg);
+  };
+  local interface Two : One {
+  };
+
+  interface Receiver {
+    void setOne(in One a);
+  };
+};
+\end{idllisting}
+
+IDL like this leads to two issues to do with omniORB's C++ mapping
+implementation.
+
+First, an instance of local interface \type{Two} should be suitable to
+pass as the argument to the \op{setOne} method of a \type{Receiver}
+object (as long as the object is in the same address space as the
+caller). Therefore, the \type{Two} abstract base class has to inherit
+from the internal class omniORB uses to map object references of type
+\type{One}. For performance reasons, the class that implements
+\type{One} object references normally has non-virtual member
+functions. That means that the application-supplied \op{problem}
+member function for the implementation of local interface \type{Two}
+will not override the base class's version. To overcome this, the IDL
+for the base unconstrained interface must be compiled with the
+-Wbvirtual\_objref switch to omniidl. That makes the member functions
+of the mapping of \type{One} into virtual functions, so they can be
+overridden.
+
+The second problem is that, in some cases, omniORB uses a different
+mapping for object reference member functions than the mapping used in
+servant classes. For example, in the \op{problem} operation, it uses
+an internal type for the inout string argument that avoids memory
+issues if the application uses a String\_var in the argument. This
+means that the abstract member function declared in the \type{Two}
+class (and implemented by the application) has a different signature
+to the member function in the base class. The application-supplied
+class will therefore not properly override the base class method. In
+all likelihood, the C++ compiler will also complain that the two
+member functions are ambiguous. The solution to this problem is to use
+the implementation mapping in the base object reference class, rather
+than the normal object reference mapping, using the -Wbimpl\_mapping
+switch to omniidl. The consequence of this is that some uses of \_var
+types for inout arguments that are normally acceptable in omniORB now
+lead to memory problems.
+
+In summary, to use local interfaces derived from normal unconstrained
+interfaces, you should compile all your IDL with the omniidl flags:
+
+\begin{quote}
+\cmdline{-Wbvirtual\_objref -Wbimpl\_mapping}
+\end{quote}
+
+
+\subsection{Valuetypes supporting local interfaces}
+
+According to the IDL specification, it should be possible to declare a
+valuetype that supports a local interface:
+
+\begin{idllisting}
+local interface I {
+  void my_operation();
+};
+valuetype V supports I {
+  public string s;
+};
+\end{idllisting}
+
+omniidl accepts the IDL, but unfortunately the resulting C++ code does
+not compile. The C++ mapping specification has a problem in that both
+the \type{CORBA::\dsc{}LocalObject} and \type{CORBA::ValueBase}
+classes have \op{add\_ref} and \op{remove\_\dsc{}ref} member functions
+defined. The classes generated for the valuetype inherit from both
+these base classes, and therefore have an ambiguity. Until the C++
+mapping resolves this conflict, valuetypes supporting local interfaces
+cannot be used in omniORB.
 
 
 

Modified: trunk/omniorb4/include/omniconfig.h.in
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/include/omniconfig.h.in?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/include/omniconfig.h.in (original)
+++ trunk/omniorb4/include/omniconfig.h.in Thu Sep 20 20:19:25 2007
@@ -37,7 +37,6 @@
 #include <omniORB4/acconfig.h>
 
 #define @PLATFORM_DEFINE@ 1
-#define @PROCESSOR_DEFINE@ 1
 #define __OSVERSION__ @OSVERSION@
 
 #undef PACKAGE_BUGREPORT

Added: trunk/omniorb4/include/omnithread.h
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/include/omnithread.h?rev=9&op=file
==============================================================================
--- trunk/omniorb4/include/omnithread.h (added)
+++ trunk/omniorb4/include/omnithread.h Thu Sep 20 20:19:25 2007
@@ -1,0 +1,657 @@
+// -*- Mode: C++; -*-
+//				Package : omnithread
+// omnithread.h			Created : 7/94 tjr
+//
+//    Copyright (C) 1994,1995,1996, 1997 Olivetti & Oracle Research Laboratory
+//
+//    This file is part of the omnithread library
+//
+//    The omnithread library is free software; you can redistribute it and/or
+//    modify it under the terms of the GNU Library General Public
+//    License as published by the Free Software Foundation; either
+//    version 2 of the License, or (at your option) any later version.
+//
+//    This library is distributed in the hope that it will be useful,
+//    but WITHOUT ANY WARRANTY; without even the implied warranty of
+//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//    Library General Public License for more details.
+//
+//    You should have received a copy of the GNU Library General Public
+//    License along with this library; if not, write to the Free
+//    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+//    02111-1307, USA
+//
+
+//
+// Interface to OMNI thread abstraction.
+//
+// This file declares classes for threads and synchronisation objects
+// (mutexes, condition variables and counting semaphores).
+//
+// Wherever a seemingly arbitrary choice has had to be made as to the interface
+// provided, the intention here has been to be as POSIX-like as possible.  This
+// is why there is no semaphore timed wait, for example.
+//
+
+#ifndef __omnithread_h_
+#define __omnithread_h_
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+class omni_mutex;
+class omni_condition;
+class omni_semaphore;
+class omni_thread;
+
+//
+// OMNI_THREAD_EXPOSE can be defined as public or protected to expose the
+// implementation class - this may be useful for debugging.  Hopefully this
+// won't change the underlying structure which the compiler generates so that
+// this can work without recompiling the library.
+//
+
+#ifndef OMNI_THREAD_EXPOSE
+#define OMNI_THREAD_EXPOSE private
+#endif
+
+//
+// Include implementation-specific header file.
+//
+// This must define 4 CPP macros of the form OMNI_x_IMPLEMENTATION for mutex,
+// condition variable, semaphore and thread.  Each should define any
+// implementation-specific members of the corresponding classes.
+//
+
+
+#if defined(__arm__) && defined(__atmos__)
+#include <omnithread/posix.h>
+
+#elif defined(__osf1__)
+#include <omnithread/posix.h>
+
+#elif defined(__aix__)
+#include <omnithread/posix.h>
+
+#elif defined(__hpux__)
+#include <omnithread/posix.h>
+
+#elif defined(__vxWorks__)
+#include <omnithread/VxThread.h>
+
+#elif defined(__WIN32__)
+
+#if defined(__POSIX_NT__)
+#include <omnithread/posix.h>
+#else
+#include <omnithread/nt.h>
+#endif
+
+#if defined(_MSC_VER) || defined(__BCPLUSPLUS__)
+
+// Using MSVC++ or Borland C++ to compile. If compiling library as a
+// DLL, define _OMNITHREAD_DLL. If compiling as a static library,
+// define _WINSTATIC. If compiling an application that is to be
+// statically linked to omnithread, define _WINSTATIC (if the
+// application is to be dynamically linked, there is no need to define
+// any of these macros).
+
+#if defined (_OMNITHREAD_DLL) && defined(_WINSTATIC)
+#error "Both _OMNITHREAD_DLL and _WINSTATIC are defined."
+#elif defined(_OMNITHREAD_DLL)
+#define _OMNITHREAD_NTDLL_ __declspec(dllexport)
+#elif !defined(_WINSTATIC)
+#define _OMNITHREAD_NTDLL_ __declspec(dllimport)
+#elif defined(_WINSTATIC)
+#define _OMNITHREAD_NTDLL_
+#endif
+ // _OMNITHREAD_DLL && _WINSTATIC
+
+#else
+
+// Not using MSVC++ to compile
+#define _OMNITHREAD_NTDLL_
+
+#endif
+ // _MSC_VER
+ 
+#elif defined(__sunos__)
+#if __OSVERSION__ != 5
+// XXX Workaround for SUN C++ compiler (seen on 4.2) Template.DB code
+//     regeneration bug. See omniORB2/CORBA_sysdep.h for details.
+#if !defined(__SUNPRO_CC) || __OSVERSION__ != '5'
+#error "Only SunOS 5.x or later is supported."
+#endif
+#endif
+#ifdef UseSolarisThreads
+#include <omnithread/solaris.h>
+#else
+#include <omnithread/posix.h>
+#endif
+
+#elif defined(__linux__)
+#include <omnithread/posix.h>
+
+#elif defined(__GLIBC__)
+#include <omnithread/posix.h>
+
+#elif defined(__nextstep__)
+#include <omnithread/mach.h>
+
+#elif defined(__VMS)
+#include <omnithread/posix.h>
+
+#elif defined(__SINIX__)
+#include <omnithread/posix.h>
+
+#elif defined(__osr5__)
+#include <omnithread/posix.h>
+
+#elif defined(__uw7__)
+#include <omnithread/posix.h>
+
+#elif defined(__irix__)
+#include <omnithread/posix.h>
+
+#elif defined(__freebsd__)
+#include <omnithread/posix.h>
+
+#elif defined(__netbsd__)
+#include <omnithread/posix.h>
+
+#elif defined(__openbsd__)
+#include <omnithread/posix.h>
+
+#elif defined(__rtems__)
+#include <omnithread/posix.h>
+#include <sched.h>
+
+#elif defined(__darwin__)
+#include <omnithread/posix.h>
+
+#elif defined(__macos__)
+#include <omnithread/posix.h>
+#include <sched.h>
+
+#elif defined(__cygwin__)
+#include <omnithread/posix.h>
+
+#else
+#error "No implementation header file"
+#endif
+
+#if !defined(__WIN32__)
+#define _OMNITHREAD_NTDLL_
+#endif
+
+#if (!defined(OMNI_MUTEX_IMPLEMENTATION)        || \
+     !defined(OMNI_MUTEX_LOCK_IMPLEMENTATION)   || \
+     !defined(OMNI_MUTEX_UNLOCK_IMPLEMENTATION) || \
+     !defined(OMNI_CONDITION_IMPLEMENTATION)    || \
+     !defined(OMNI_SEMAPHORE_IMPLEMENTATION)    || \
+     !defined(OMNI_THREAD_IMPLEMENTATION))
+#error "Implementation header file incomplete"
+#endif
+
+
+//
+// This exception is thrown in the event of a fatal error.
+//
+
+class _OMNITHREAD_NTDLL_ omni_thread_fatal {
+public:
+    int error;
+    omni_thread_fatal(int e = 0) : error(e) {}
+};
+
+
+//
+// This exception is thrown when an operation is invoked with invalid
+// arguments.
+//
+
+class _OMNITHREAD_NTDLL_ omni_thread_invalid {};
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Mutex
+//
+///////////////////////////////////////////////////////////////////////////
+
+class _OMNITHREAD_NTDLL_ omni_mutex {
+
+public:
+    omni_mutex(void);
+    ~omni_mutex(void);
+
+    inline void lock(void)    { OMNI_MUTEX_LOCK_IMPLEMENTATION   }
+    inline void unlock(void)  { OMNI_MUTEX_UNLOCK_IMPLEMENTATION }
+    inline void acquire(void) { lock(); }
+    inline void release(void) { unlock(); }
+	// the names lock and unlock are preferred over acquire and release
+	// since we are attempting to be as POSIX-like as possible.
+
+    friend class omni_condition;
+
+private:
+    // dummy copy constructor and operator= to prevent copying
+    omni_mutex(const omni_mutex&);
+    omni_mutex& operator=(const omni_mutex&);
+
+OMNI_THREAD_EXPOSE:
+    OMNI_MUTEX_IMPLEMENTATION
+};
+
+//
+// As an alternative to:
+// {
+//   mutex.lock();
+//   .....
+//   mutex.unlock();
+// }
+//
+// you can use a single instance of the omni_mutex_lock class:
+//
+// {
+//   omni_mutex_lock l(mutex);
+//   ....
+// }
+//
+// This has the advantage that mutex.unlock() will be called automatically
+// when an exception is thrown.
+//
+
+class _OMNITHREAD_NTDLL_ omni_mutex_lock {
+    omni_mutex& mutex;
+public:
+    inline omni_mutex_lock(omni_mutex& m) : mutex(m) { mutex.lock(); }
+    inline ~omni_mutex_lock(void) { mutex.unlock(); }
+private:
+    // dummy copy constructor and operator= to prevent copying
+    omni_mutex_lock(const omni_mutex_lock&);
+    omni_mutex_lock& operator=(const omni_mutex_lock&);
+};
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Condition variable
+//
+///////////////////////////////////////////////////////////////////////////
+
+class _OMNITHREAD_NTDLL_ omni_condition {
+
+    omni_mutex* mutex;
+
+public:
+    omni_condition(omni_mutex* m);
+	// constructor must be given a pointer to an existing mutex. The
+	// condition variable is then linked to the mutex, so that there is an
+	// implicit unlock and lock around wait() and timed_wait().
+
+    ~omni_condition(void);
+
+    void wait(void);
+	// wait for the condition variable to be signalled.  The mutex is
+	// implicitly released before waiting and locked again after waking up.
+	// If wait() is called by multiple threads, a signal may wake up more
+	// than one thread.  See POSIX threads documentation for details.
+
+    int timedwait(unsigned long secs, unsigned long nanosecs = 0);
+	// timedwait() is given an absolute time to wait until.  To wait for a
+	// relative time from now, use omni_thread::get_time. See POSIX threads
+	// documentation for why absolute times are better than relative.
+	// Returns 1 (true) if successfully signalled, 0 (false) if time
+	// expired.
+
+    void signal(void);
+	// if one or more threads have called wait(), signal wakes up at least
+	// one of them, possibly more.  See POSIX threads documentation for
+	// details.
+
+    void broadcast(void);
+	// broadcast is like signal but wakes all threads which have called
+	// wait().
+
+private:
+    // dummy copy constructor and operator= to prevent copying
+    omni_condition(const omni_condition&);
+    omni_condition& operator=(const omni_condition&);
+
+OMNI_THREAD_EXPOSE:
+    OMNI_CONDITION_IMPLEMENTATION
+};
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Counting semaphore
+//
+///////////////////////////////////////////////////////////////////////////
+
+class _OMNITHREAD_NTDLL_ omni_semaphore {
+
+public:
+    omni_semaphore(unsigned int initial = 1);
+    ~omni_semaphore(void);
+
+    void wait(void);
+	// if semaphore value is > 0 then decrement it and carry on. If it's
+	// already 0 then block.
+
+    int trywait(void);
+	// if semaphore value is > 0 then decrement it and return 1 (true).
+	// If it's already 0 then return 0 (false).
+
+    void post(void);
+	// if any threads are blocked in wait(), wake one of them up. Otherwise
+	// increment the value of the semaphore.
+
+private:
+    // dummy copy constructor and operator= to prevent copying
+    omni_semaphore(const omni_semaphore&);
+    omni_semaphore& operator=(const omni_semaphore&);
+
+OMNI_THREAD_EXPOSE:
+    OMNI_SEMAPHORE_IMPLEMENTATION
+};
+
+//
+// A helper class for semaphores, similar to omni_mutex_lock above.
+//
+
+class _OMNITHREAD_NTDLL_ omni_semaphore_lock {
+    omni_semaphore& sem;
+public:
+    omni_semaphore_lock(omni_semaphore& s) : sem(s) { sem.wait(); }
+    ~omni_semaphore_lock(void) { sem.post(); }
+private:
+    // dummy copy constructor and operator= to prevent copying
+    omni_semaphore_lock(const omni_semaphore_lock&);
+    omni_semaphore_lock& operator=(const omni_semaphore_lock&);
+};
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Thread
+//
+///////////////////////////////////////////////////////////////////////////
+
+class _OMNITHREAD_NTDLL_ omni_thread {
+
+public:
+
+    enum priority_t {
+	PRIORITY_LOW,
+	PRIORITY_NORMAL,
+	PRIORITY_HIGH
+    };
+
+    enum state_t {
+	STATE_NEW,		// thread object exists but thread hasn't
+				// started yet.
+	STATE_RUNNING,		// thread is running.
+	STATE_TERMINATED	// thread has terminated but storage has not
+				// been reclaimed (i.e. waiting to be joined).
+    };
+
+    //
+    // Constructors set up the thread object but the thread won't start until
+    // start() is called. The create method can be used to construct and start
+    // a thread in a single call.
+    //
+
+    omni_thread(void (*fn)(void*), void* arg = NULL,
+		priority_t pri = PRIORITY_NORMAL);
+    omni_thread(void* (*fn)(void*), void* arg = NULL,
+		priority_t pri = PRIORITY_NORMAL);
+	// these constructors create a thread which will run the given function
+	// when start() is called.  The thread will be detached if given a
+	// function with void return type, undetached if given a function
+	// returning void*. If a thread is detached, storage for the thread is
+	// reclaimed automatically on termination. Only an undetached thread
+	// can be joined.
+
+    void start(void);
+	// start() causes a thread created with one of the constructors to
+	// start executing the appropriate function.
+
+protected:
+
+    omni_thread(void* arg = NULL, priority_t pri = PRIORITY_NORMAL);
+	// this constructor is used in a derived class.  The thread will
+	// execute the run() or run_undetached() member functions depending on
+	// whether start() or start_undetached() is called respectively.
+
+    void start_undetached(void);
+	// can be used with the above constructor in a derived class to cause
+	// the thread to be undetached.  In this case the thread executes the
+	// run_undetached member function.
+
+    virtual ~omni_thread(void);
+	// destructor cannot be called by user (except via a derived class).
+	// Use exit() instead. This also means a thread object must be
+	// allocated with new - it cannot be statically or automatically
+	// allocated. The destructor of a class that inherits from omni_thread
+	// shouldn't be public either (otherwise the thread object can be
+	// destroyed while the underlying thread is still running).
+
+public:
+
+    void join(void**);
+	// join causes the calling thread to wait for another's completion,
+	// putting the return value in the variable of type void* whose address
+	// is given (unless passed a null pointer). Only undetached threads
+	// may be joined. Storage for the thread will be reclaimed.
+
+    void set_priority(priority_t);
+	// set the priority of the thread.
+
+    static omni_thread* create(void (*fn)(void*), void* arg = NULL,
+			       priority_t pri = PRIORITY_NORMAL);
+    static omni_thread* create(void* (*fn)(void*), void* arg = NULL,
+			       priority_t pri = PRIORITY_NORMAL);
+	// create spawns a new thread executing the given function with the
+	// given argument at the given priority. Returns a pointer to the
+	// thread object. It simply constructs a new thread object then calls
+	// start.
+
+    static void exit(void* return_value = NULL);
+	// causes the calling thread to terminate.
+
+    static omni_thread* self(void);
+	// returns the calling thread's omni_thread object.  If the
+	// calling thread is not the main thread and is not created
+	// using this library, returns 0. (But see create_dummy()
+	// below.)
+
+    static void yield(void);
+	// allows another thread to run.
+
+    static void sleep(unsigned long secs, unsigned long nanosecs = 0);
+	// sleeps for the given time.
+
+    static void get_time(unsigned long* abs_sec, unsigned long* abs_nsec,
+			 unsigned long rel_sec = 0, unsigned long rel_nsec=0);
+	// calculates an absolute time in seconds and nanoseconds, suitable for
+	// use in timed_waits on condition variables, which is the current time
+	// plus the given relative offset.
+
+
+    static void stacksize(unsigned long sz);
+    static unsigned long stacksize();
+        // Use this value as the stack size when spawning a new thread.
+        // The default value (0) means that the thread library default is
+        // to be used.
+
+
+    // Per-thread data
+    //
+    // These functions allow you to attach additional data to an
+    // omni_thread. First allocate a key for yourself with
+    // allocate_key(). Then you can store any object whose class is
+    // derived from value_t. Any values still stored in the
+    // omni_thread when the thread exits are deleted.
+    //
+    // These functions are NOT thread safe, so you should be very
+    // careful about setting/getting data in a different thread to the
+    // current thread.
+
+    typedef unsigned int key_t;
+    static key_t allocate_key();
+
+    class value_t {
+    public:
+      virtual ~value_t() {}
+    };
+
+    value_t* set_value(key_t k, value_t* v);
+        // Sets a value associated with the given key. The key must
+        // have been allocated with allocate_key(). If a value has
+        // already been set with the specified key, the old value_t
+        // object is deleted and replaced. Returns the value which was
+        // set, or zero if the key is invalid.
+
+    value_t* get_value(key_t k);
+        // Returns the value associated with the key. If the key is
+        // invalid, or there is no value for the key, returns zero.
+
+    value_t* remove_value(key_t k);
+        // Removes the value associated with the key and returns it.
+        // If the key is invalid, or there is no value for the key,
+        // returns zero.
+
+
+    // Dummy omni_thread
+    //
+    // Sometimes, an application finds itself with threads created
+    // outside of omnithread which must interact with omnithread
+    // features such as the per-thread data. In this situation,
+    // omni_thread::self() would normally return 0. These functions
+    // allow the application to create a suitable dummy omni_thread
+    // object.
+
+    static omni_thread* create_dummy(void);
+        // creates a dummy omni_thread for the calling thread. Future
+        // calls to self() will return the dummy omni_thread. Throws
+        // omni_thread_invalid if this thread already has an
+        // associated omni_thread (real or dummy).
+
+    static void release_dummy();
+        // release the dummy omni_thread for this thread. This
+        // function MUST be called before the thread exits. Throws
+        // omni_thread_invalid if the calling thread does not have a
+        // dummy omni_thread.
+
+    // class ensure_self should be created on the stack. If created in
+    // a thread without an associated omni_thread, it creates a dummy
+    // thread which is released when the ensure_self object is deleted.
+
+    class ensure_self {
+    public:
+      inline ensure_self() : _dummy(0)
+      {
+	_self = omni_thread::self();
+	if (!_self) {
+	  _dummy = 1;
+	  _self  = omni_thread::create_dummy();
+	}
+      }
+      inline ~ensure_self()
+      {
+	if (_dummy)
+	  omni_thread::release_dummy();
+      }
+      inline omni_thread* self() { return _self; }
+    private:
+      omni_thread* _self;
+      int          _dummy;
+    };
+
+
+private:
+
+    virtual void run(void* /*arg*/) {}
+    virtual void* run_undetached(void* /*arg*/) { return NULL; }
+	// can be overridden in a derived class.  When constructed using the
+	// the constructor omni_thread(void*, priority_t), these functions are
+	// called by start() and start_undetached() respectively.
+
+    void common_constructor(void* arg, priority_t pri, int det);
+	// implements the common parts of the constructors.
+
+    omni_mutex mutex;
+	// used to protect any members which can change after construction,
+	// i.e. the following 2 members.
+
+    state_t _state;
+    priority_t _priority;
+
+    static omni_mutex* next_id_mutex;
+    static int next_id;
+    int _id;
+
+    void (*fn_void)(void*);
+    void* (*fn_ret)(void*);
+    void* thread_arg;
+    int detached;
+    int _dummy;
+    value_t**     _values;
+    unsigned long _value_alloc;
+
+    omni_thread(const omni_thread&);
+    omni_thread& operator=(const omni_thread&);
+    // Not implemented
+
+public:
+
+    priority_t priority(void) {
+
+	// return this thread's priority.
+
+	omni_mutex_lock l(mutex);
+	return _priority;
+    }
+
+    state_t state(void) {
+
+	// return thread state (invalid, new, running or terminated).
+
+	omni_mutex_lock l(mutex);
+	return _state;
+    }
+
+    int id(void) { return _id; }
+	// return unique thread id within the current process.
+
+
+    // This class plus the instance of it declared below allows us to execute
+    // some initialisation code before main() is called.
+
+    class _OMNITHREAD_NTDLL_ init_t {
+    public:
+	init_t(void);
+        ~init_t(void);
+    };
+
+    friend class init_t;
+    friend class omni_thread_dummy;
+
+OMNI_THREAD_EXPOSE:
+    OMNI_THREAD_IMPLEMENTATION
+};
+
+#ifndef __rtems__
+static omni_thread::init_t omni_thread_init;
+#else
+// RTEMS calls global Ctor/Dtor in a context that is not
+// a posix thread. Calls to functions to pthread_self() in
+// that context returns NULL. 
+// So, for RTEMS we will make the thread initialization at the
+// beginning of the Init task that has a posix context.
+#endif
+
+#endif

Modified: trunk/omniorb4/mk/beforeauto.mk.in
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/mk/beforeauto.mk.in?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/mk/beforeauto.mk.in (original)
+++ trunk/omniorb4/mk/beforeauto.mk.in Thu Sep 20 20:19:25 2007
@@ -502,11 +502,13 @@
 
 
 # omniORB SSL transport
-OMNIORB_SSL_VERSION = $(OMNIORB_MAJOR_VERSION).$(OMNIORB_MINOR_VERSION)
+OMNIORB_SSL_VERSION = $(OMNIORB_VERSION)
 OMNIORB_SSL_MAJOR_VERSION = $(word 1,$(subst ., ,$(OMNIORB_SSL_VERSION)))
 OMNIORB_SSL_MINOR_VERSION = $(word 2,$(subst ., ,$(OMNIORB_SSL_VERSION)))
-OMNIORB_SSL_LIB = $(patsubst %,$(LibSearchPattern),omnisslTP)
-lib_depend := $(patsubst %,$(LibPattern),omnisslTP)
+OMNIORB_SSL_LIB = $(patsubst %,$(LibSearchPattern),\
+                    omnisslTP$(OMNIORB_SSL_MAJOR_VERSION))
+
+lib_depend := $(patsubst %,$(LibPattern),omnisslTP$(OMNIORB_SSL_MAJOR_VERSION))
 OMNIORB_SSL_LIB_DEPEND := $(GENERATE_LIB_DEPEND)
 
 OMNIORB_SSL_LIB += $(OPEN_SSL_LIB)
@@ -662,17 +664,16 @@
 CC              = @CC@
 CXX             = @CXX@
 RANLIB		= @RANLIB@
-MKDIRHIER	= $(BASE_OMNI_TREE)/bin/scripts/omkdirhier
+MKDIRHIER	= mkdir -p
 INSTLIBFLAGS	= -m 0644
 INSTEXEFLAGS	= -m 0755
 CP		= cp
 MV		= mv -f
 CPP		= @CPP@
-OMKDEPEND	= $(TOOLBINDIR)/omkdepend
 RMDIRHIER	= $(RM) -rf
 
-CXXMAKEDEPEND   = $(OMKDEPEND) -D__cplusplus
-CMAKEDEPEND     = $(OMKDEPEND)
+CXXMAKEDEPEND   = @CXX@ -M -MD -MG
+CMAKEDEPEND     = @CC@ -M -MD -MG
 
 
 #
@@ -724,8 +725,6 @@
 #
 
 ifdef Compiler_GCC
-CMAKEDEPEND     += -D__GNUC__
-CXXMAKEDEPEND   += -D__GNUG__ -D__GNUC__
 CXXOPTIONS       = -Wall -Wno-unused -fexceptions @EXTRA_GCC_CXXFLAGS@
 EgcsMajorVersion = 1
 EgcsMinorVersion = 1
@@ -745,6 +744,13 @@
 IMPORT_CPPFLAGS += -D__linux__
 OMNITHREAD_POSIX_CPPFLAGS = -DNoNanoSleep -DPthreadDraftVersion=10
 OMNITHREAD_CPPFLAGS = -D_REENTRANT
+OMNITHREAD_LIB += -lpthread
+endif
+
+###################
+ifdef kFreeBSD
+OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=10
+OMNITHREAD_CPPFLAGS = -D_REENTRANT -pthread
 OMNITHREAD_LIB += -lpthread
 endif
 
@@ -852,7 +858,13 @@
 )
 endef
 
+ifdef ia64Processor
+SHAREDLIB_SUFFIX = so
+endif
+
+ifndef ia64Processor
 SHAREDLIB_SUFFIX = sl
+endif
 
 ifdef Compiler_KCC
 AR = KCC --thread_safe -o
@@ -870,15 +882,15 @@
 #                    /opt/aCC/lbin/ld: Unsatisfied symbols:
 #                    fstreambase::cma_close(void)(code)
 CXXOPTIONS    =  -fhandle-exceptions -Wall -Wno-unused \
-                 -D_CMA_NOWRAPPERS_
+                 -D_CMA_NOWRAPPERS_ @EXTRA_GCC_CXXFLAGS@
 endif
 
 ifdef Compiler_aCC
 CXXDEBUGFLAGS     = -O
-CXXOPTIONS       += -w +inst_v +DAportable -mt
+CXXOPTIONS       += -w +inst_v -mt
 CXXLINKOPTIONS   += -Wl,+s
 CDEBUGFLAGS       = -O
-COPTIONS          = -w -Aa -D_HPUX_SOURCE +DAportable
+COPTIONS          = -w -Aa -D_HPUX_SOURCE
 CLINKOPTIONS      = -Wl,+s
 
 SHAREDLIB_CPPFLAGS += +Z
@@ -958,7 +970,7 @@
 OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=10 \
                             -DPthreadSupportThreadPriority -DNoNanoSleep
 
-CXXOPTIONS = -fno-common -bind_at_load
+CXXOPTIONS = -fno-common -bind_at_load @EXTRA_GCC_CXXFLAGS@
 SHAREDLIB_SUFFIX = dylib
 
 SharedLibraryFullNameTemplate = lib$$1$$2.$$3.$$4.$(SHAREDLIB_SUFFIX)
@@ -1030,8 +1042,9 @@
 
 ###################
 ifdef Cygwin
+MKDIRHIER = mkdir -p
 CXXLINKOPTIONS += -Wl,--enable-auto-import
-IMPORT_CPPFLAGS += -D__linux__ -D__cygwin__
+IMPORT_CPPFLAGS += -D__cygwin__
 SHAREDLIB_CPPFLAGS =
 OMNITHREAD_POSIX_CPPFLAGS = -DNoNanoSleep -DPthreadDraftVersion=10
 OMNITHREAD_CPPFLAGS = -D_REENTRANT

Modified: trunk/omniorb4/sample.cfg
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/sample.cfg?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/sample.cfg (original)
+++ trunk/omniorb4/sample.cfg Thu Sep 20 20:19:25 2007
@@ -45,6 +45,15 @@
 traceInvocations = 0
 
 ############################################################################
+# Trace Invocation returns
+#     If true, then each local and remote invocation will generate a trace 
+#     message as it returns.
+#
+#     Valid values = 0 or 1
+#
+traceInvocationReturns = 0
+
+############################################################################
 # Trace thread id
 #     If true, all trace messages include the thread id of the thread doing
 #     the logging.
@@ -54,6 +63,14 @@
 traceThreadId = 0
 
 ############################################################################
+# Trace time
+#     If true, all trace messages include the current time.
+#
+#     Valid values = 0 or 1
+#
+traceTime = 0
+
+############################################################################
 # dumpConfiguration
 #     Set to 1 to cause the ORB to dump the current set of configuration
 #     parameters.
@@ -82,7 +99,6 @@
 #    Valid values = (n >= 8192)
 #
 giopMaxMsgSize = 2097152    # 2 MBytes.
-
 
 ############################################################################
 # strictIIOP flag
@@ -165,7 +181,6 @@
 #    Valid values = 0 or 1
 acceptMisalignedTcIndirections = 0
 
-
 ############################################################################
 # scanGranularity
 #
@@ -178,7 +193,6 @@
 #
 scanGranularity = 5
 
-
 ############################################################################
 # nativeCharCodeSet
 #
@@ -192,27 +206,6 @@
 #   set the native code set for wchar and wstring
 #
 nativeWCharCodeSet = UTF-16
-
-############################################################################
-# omniORB_27_CompatibleAnyExtraction
-#
-#   In omniORB pre-2.8.0 versions, the CORBA::Any extraction operator for
-#     1. unbounded string operator>>=(char*&)
-#     2. bounded string   operator>>=(to_string)
-#     3. object reference operator>>=(A_ptr&) for interface A
-#   Return a copy of the value. The caller must free the returned
-#   value later.
-#
-#   With 2.8.0 and later, the semantics becomes non-copy, i.e. the Any
-#   still own the storage of the returned value.
-#   This would cause a problem in a program that is written to use the
-#   pre-2.8.0 semantics. To make it easier for the transition,
-#   set omniORB_27_CompatibleAnyExtraction to 1.
-#   This would revert the semantics to the pre-2.8.0 versions.
-#
-#   Valid values = 0 or 1
-#
-omniORB_27_CompatibleAnyExtraction = 0
 
 ############################################################################
 # abortOnInternalError
@@ -227,6 +220,64 @@
 #   Valid values = 0 or 1
 #
 abortOnInternalError = 0
+
+############################################################################
+# abortOnNativeException
+#
+#   On Windows, "native" exceptions such as segmentation faults and
+#   divide by zero appear as C++ exceptions that can be caught with
+#   catch (...). Setting this parameter to TRUE causes such exceptions
+#   to abort the process instead.
+#
+#   This parameter has no effect on other platforms.
+#
+#   Valid values = 0 or 1
+#
+abortOnNativeException = 0
+
+############################################################################
+# maxSocketSend
+# maxSocketRecv
+#
+#   On some platforms, calls to send() and recv() have a limit on the
+#   buffer size that can be used. These parameters set the limits in
+#   bytes that omniORB uses when sending / receiving bulk data.
+#
+#   The default values are platform specific. It is unlikely that you
+#   will need to change the values from the defaults.
+#
+#   The minimum valid limit is 8KB, 8192 bytes.
+#
+#   e.g. to limit to 64KB sends / receives:
+#
+#     maxSocketSend = 65536
+#     maxSocketRecv = 65536
+
+############################################################################
+# sslCAFile
+# sslKeyFile
+# sslKeyPassword
+# sslVerifyMode
+#
+#   SSL transport options
+#
+#   sslCAFile specifies the file containing the SSL Certificate
+#   Authority certificate.
+#
+#   sslKeyFile specifies the file containing the SSL key.
+#
+#   sslKeyPassword specifies the password to unlock the key.
+#
+#   sslVerifyMode specifies the verify mode, as given to
+#   SSL_CTX_set_verify. Valid values are "none", representing
+#   SSL_VERIFY_NONE, and "peer", representing SSL_VERIFY_PEER. If peer
+#   is selected, additional options "fail" and "once" can also be
+#   specified, corresponding to SSL_VERIFY_FAIL_IF_NO_PEER_CERT and
+#   SSL_VERIFY_CLIENT_ONCE respectively. e.g.
+#
+#     sslVerifyMode = peer,fail
+#
+#   These options are only available if the SSL transport is linked.
 
 
 ############################################################################
@@ -282,7 +333,7 @@
 #   A call to resolve_initial_references("MyService") will return the object
 #   reference denoted by `corbaloc::myhost.example.com/MyService'.
 #
-#   The default is empty.
+DefaultInitRef = corbaloc::
 
 
 ############################################################################
@@ -362,9 +413,30 @@
 clientCallTimeOutPeriod = 0
 
 ############################################################################
+# clientConnectTimeOutPeriod
+#
+#    Connect timeout. When a client has no existing connection to
+#    communicate with a server, it must open a new connection before
+#    performing the call. If this parameter is non-zero, it sets a
+#    timeout specifically for establishing the connection. If the
+#    timeout specified here is shorter than the overall timeout for
+#    the call (set with clientCallTimeOutPeriod or per-object or
+#    per-thread timeouts), the connect timeout is used for
+#    establishing the connection, then additional time is permitted
+#    for the call to complete. If the connect timeout is longer than
+#    the normal call timeout, the deadline for the entire call is
+#    extended to match the connect timeout.
+# 
+#    If this parameter is zero, the normal call timeout applies to the
+#    total time taken to perform the connect and the subsequent call.
+# 
+#    Valid values = (n >= 0 in milliseconds) 
+#                    0 --> same timeout (if any) as other calls
+clientConnectTimeOutPeriod = 0
+
+############################################################################
 # supportPerThreadTimeOut
 #
-
 #    If true, each client thread may have its own timeout. This adds
 #    some overhead to each call, so it is off by default.
 #
@@ -409,7 +481,6 @@
 #
 oneCallPerConnection = 1
 
-
 ############################################################################
 # offerBiDirectionalGIOP
 #
@@ -478,7 +549,6 @@
 #
 bootstrapAgentPort = 900
 
-
 ############################################################################
 # principal
 #
@@ -500,14 +570,19 @@
 ############################################################################
 # endPoint
 # endPointNoPublish
-# endPointNoListen
-# endPointPublishAllIFs
-#
-#    There are 3 possible way to specify the endpoints a server should create.
-#    The 3 forms differ in the following ways:
+#
+#    These options cause the server to listen on specific endpoints,
+#    and provide endpoints to be published in IORs..
+#
+#    There are two possible ways to specify the endpoints a server
+#    should create.
+#
+#    The two forms differ in the following ways:
 #         endPoint - create, listen on the connection and publish it in IORs
 #         endPointNoPublish - same as endPoint but do not publish it in IORs
-#         endPointNoListen - only publish it in IORs
+#
+#    See the endPointPublish parameter for further options about
+#    details to publish in IORs.
 #
 #    There can be more than one configuration line defining endPoints.
 #    Each line adds one endpoint to the server.
@@ -529,7 +604,7 @@
 #               both are missing, the ORB fills in the blank. For example,
 #               "giop:tcp::" will cause the ORB to pick an arbitrary tcp port
 #               as the endpoint and it will pick one IP address of the host
-#               as the host name.
+#               as the host address.
 #
 #         2. giop:ssl:[<host>]:[<port>]
 #               Similar to the tcp transport except that SSL is run on top
@@ -538,10 +613,10 @@
 #         3. giop:unix:[<filename>]
 #               Create a unix domain socket and bind to the file with pathname
 #               <filename>. If <filename> is not specified, e.g. "giop:unix:",
-#               the ORB would pick a file name based on the process ID and 
-#               the current timestamp.
+#               the ORB picks a file name based on the process ID and the
+#               current timestamp.
 #               Therefore, if one wants to write an application that always
-#               restarts to use the same file to bind to its unix domain 
+#               restarts using the same file to bind to its unix domain 
 #               socket, a filename should be specified in the transport string.
 #
 #   It is possible to use the ORB's transport extension framework to add
@@ -578,13 +653,73 @@
 #                     = giop:unix:
 #                     = giop:ssl::
 #
-#   endPointNoListen = giop:tcp:192.168.1.1:12345
-#
-#
-#   If the endPointPublishAllIFs boolean parameter is set to true, all
-#   non-loopback IP network interfaces are published in IORs, rather
-#   than just the first one.
-
+
+############################################################################
+# endPointPublish
+#
+#    Servers listen on a number of endpoints, controlled by the
+#    endPoint and endPointNoPublish parameters. For clients to be able
+#    to connect to the server, details about the endpoints must be
+#    published in the server's IORs. Endpoints to be published are
+#    chosen according to the endPointPublish parameter.
+#
+#    endPointPublish contains a comma-separated list of publish rules.
+#    The rules are applied in turn to each of the configured
+#    endpoints; if a rule matches an endpoint, it causes one or more
+#    endpoints to be published.
+#
+#    The following core rules are supported:
+#
+#        addr      -- the first natural address of the endpoint
+#        ipv4      -- the first IPv4 address of a TCP or SSL endpoint
+#        ipv6      -- the first IPv6 address of a TCP or SSL endpoint
+#        name      -- the first address that can be resolved to a name
+#        hostname  -- the result of the gethostname() system call
+#        fqdn      -- the fully-qualified domain name
+#
+#    The core rules can be combined using the vertical bar operator to
+#    try several rules in turn until one succeeds. e.g:
+#
+#        name|ipv6|ipv4
+#                  -- the name of the endpoint if it has one;
+#                     failing that, its first IPv6 address;
+#                     failing that, its first IPv4 address.
+#
+#    Multiple rules can be combined using the comma operator to
+#    publish more than one endpoint. e.g.
+#
+#        name,addr -- the name of the endpoint (if it has one),
+#                     followed by its first address.
+#
+#    For endpoints with multiple addresses (e.g. TCP endpoints on
+#    multi-homed machines), the all() manipulator causes all addresses
+#    to be published. e.g.:
+#
+#        all(addr) -- all addresses are published
+#        all(name) -- all addresses that resolve to names are published
+#
+#        all(name|addr)
+#                  -- all addresses are published by name if they have
+#                     one, address otherwise.
+#
+#        all(name,addr)
+#                  -- all addresses are published by name (if they
+#                     have one), and by address.
+#
+#        all(name),all(addr)
+#                  -- first the names of all addresses are published,
+#                     followed by all the addresses.
+#
+#    A specific endpoint can be published by giving its endpoint URI,
+#    even if the server is not listening on that endpoint. e.g.:
+#
+#        giop:tcp:not.my.host:12345
+#        giop:unix:/not/my/socket-file
+#
+#    If the host or port number for a TCP or SSL URI are missed out,
+#    they are filled in with the details from each listening TCP/SSL
+#    endpoint. This can be used to publish a different name for a
+#    TCP/SSL endpoint that is using an ephemeral port.
 
 ############################################################################
 # serverTransportRule
@@ -604,7 +739,9 @@
 #            1. localhost            if the address is this machine
 #            2. w.x.y.z/m1.m2.m3.m4  IPv4 address with the bits selected by
 #                                    the mask. e.g. 172.16.0.0/255.240.0.0
-#            3. *                    the wildcard that matches any address
+#            3. w.x.y.z/len          IPv4 address with len significant bits.
+#            4. a:b:c:d:e:f:g:h/len  IPv6 address with len significant bits.
+#            5. *                    the wildcard that matches any address
 #
 #        <action>+ can be one or more of the following:
 #            1. none              Do not accept this connection.
@@ -660,7 +797,6 @@
 #
 inConScanPeriod = 180
 
-
 ############################################################################
 # threadPerConnectionPolicy
 #
@@ -681,7 +817,6 @@
 #   Valid values = (n >= 1) 
 #
 maxServerThreadPerConnection = 100
-
 
 ############################################################################
 # maxServerThreadPoolSize
@@ -735,6 +870,41 @@
 threadPoolWatchConnection = 1
 
 ############################################################################
+# connectionWatchPeriod
+#
+#   For each endpoint, the ORB allocates a thread to watch for new
+#   connections and to monitor existing connections for calls that
+#   should be handed by the thread pool. The thread blocks in select()
+#   or similar for a period, after which it re-scans the lists of
+#   connections it should watch. This parameter is specified in
+#   microseconds.
+#
+#   Valid values = (n >= 0 in microseconds)
+#
+connectionWatchPeriod = 50000
+
+############################################################################
+# connectionWatchImmediate
+#
+#   When a thread handles an incoming call, it unmarshals the
+#   arguments then marks the connection as watchable by the connection
+#   watching thread, in case the client sends a concurrent call on the
+#   same connection. If this parameter is set to the default false,
+#   the connection is not actually watched until the next connection
+#   watch period (determined by the connectionWatchPeriod parameter).
+#   If connectionWatchImmediate is set true, the connection watching
+#   thread is immediately signalled to watch the connection. That
+#   leads to faster interactive response to clients that multiplex
+#   calls, but adds significant overhead along the call chain.
+#
+#   Note that this setting has no effect on Windows, since it has no
+#   mechanism for signalling the connection watching thread.
+#
+#   Valid values = 0 or 1
+#
+connectionWatchImmediate = 0
+
+############################################################################
 # acceptBiDirectionalGIOP
 #
 #   Applies to the server side. Set to 1 to indicate that the
@@ -774,10 +944,21 @@
 #   If the value of this variable is TRUE, per-thread information is
 #   made available through the Current interfaces, e.g.
 #   PortableServer::Current. If you do not need this information, you
-#   can set the value to 0, resulting in a small performance
+#   can set the value to FALSE, resulting in a small performance
 #   improvement.
 #
 supportCurrent = 1
+
+############################################################################
+# copyValuesInLocalCalls
+#
+#   If the value of this variable is TRUE, valuetypes used in local
+#   calls are properly copied, to retain local/remote transparency.
+#   This involves copying all operation parameters / return values,
+#   and is thus quite time consuming. If this parameter is set to
+#   FALSE, valuetypes in local calls are not copied.
+#
+copyValuesInLocalCalls = 1
 
 ############################################################################
 # objectTableSize

Added: trunk/omniorb4/src/lib/omnithread/posix.cc
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/src/lib/omnithread/posix.cc?rev=9&op=file
==============================================================================
--- trunk/omniorb4/src/lib/omnithread/posix.cc (added)
+++ trunk/omniorb4/src/lib/omnithread/posix.cc Thu Sep 20 20:19:25 2007
@@ -1,0 +1,991 @@
+//				Package : omnithread
+// omnithread/posix.cc		Created : 7/94 tjr
+//
+//    Copyright (C) 1994-1999 AT&T Laboratories Cambridge
+//
+//    This file is part of the omnithread library
+//
+//    The omnithread library is free software; you can redistribute it and/or
+//    modify it under the terms of the GNU Library General Public
+//    License as published by the Free Software Foundation; either
+//    version 2 of the License, or (at your option) any later version.
+//
+//    This library is distributed in the hope that it will be useful,
+//    but WITHOUT ANY WARRANTY; without even the implied warranty of
+//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//    Library General Public License for more details.
+//
+//    You should have received a copy of the GNU Library General Public
+//    License along with this library; if not, write to the Free
+//    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+//    02111-1307, USA
+//
+
+//
+// Implementation of OMNI thread abstraction for posix threads
+//
+// The source below tests for the definition of the macros:
+//     PthreadDraftVersion
+//     PthreadSupportThreadPriority
+//     NoNanoSleep
+//     NeedPthreadInit
+//
+// As different draft versions of the pthread standard P1003.4a/P1003.1c
+// define slightly different APIs, the macro 'PthreadDraftVersion'
+// identifies the draft version supported by this particular platform.
+//
+// Some unix variants do not support thread priority unless a real-time
+// kernel option is installed. The macro 'PthreadSupportThreadPriority',
+// if defined, enables the use of thread priority. If it is not defined,
+// setting or changing thread priority will be silently ignored.
+//
+// nanosleep() is defined in Posix P1003.4 since Draft 9 (?).
+// Not all platforms support this standard. The macro 'NoNanoSleep'
+// identifies platform that don't.
+//
+
+#ifdef __VMS
+# define pthread_attr_destroy PTHREAD_ATTR_DESTROY
+# define pthread_attr_init PTHREAD_ATTR_INIT
+# define pthread_attr_setschedparam PTHREAD_ATTR_SETSCHEDPARAM
+# define pthread_attr_setstacksize PTHREAD_ATTR_SETSTACKSIZE
+# define pthread_cond_broadcast PTHREAD_COND_BROADCAST
+# define pthread_cond_destroy PTHREAD_COND_DESTROY
+# define pthread_cond_init PTHREAD_COND_INIT
+# define pthread_cond_signal PTHREAD_COND_SIGNAL
+# define pthread_cond_timedwait PTHREAD_COND_TIMEDWAIT
+# define pthread_cond_wait PTHREAD_COND_WAIT
+# define pthread_create PTHREAD_CREATE
+# define pthread_delay_np PTHREAD_DELAY_NP
+# define pthread_detach PTHREAD_DETACH
+# define pthread_exit PTHREAD_EXIT
+# define pthread_get_expiration_np PTHREAD_GET_EXPIRATION_NP
+# define pthread_getspecific PTHREAD_GETSPECIFIC
+# define pthread_join32 PTHREAD_JOIN32
+# define pthread_key_create PTHREAD_KEY_CREATE
+# define pthread_mutex_destroy PTHREAD_MUTEX_DESTROY
+# define pthread_mutex_init PTHREAD_MUTEX_INIT
+# define pthread_mutex_lock PTHREAD_MUTEX_LOCK
+# define pthread_mutex_unlock PTHREAD_MUTEX_UNLOCK
+# define pthread_self PTHREAD_SELF
+# define pthread_setschedparam PTHREAD_SETSCHEDPARAM
+# define pthread_setspecific PTHREAD_SETSPECIFIC
+# define pthread_yield_np PTHREAD_YIELD_NP
+#endif
+
+#include <stdlib.h>
+#include <errno.h>
+#include <time.h>
+#include <omnithread.h>
+
+#if (defined(__GLIBC__) && __GLIBC__ >= 2) || defined(__SCO_VERSION__) || defined(__aix__) || defined (__cygwin__) || defined(__darwin__) || defined(__macos__)
+// typedef of struct timeval and gettimeofday();
+#include <sys/time.h>
+#include <unistd.h>
+#endif
+
+#if defined(__linux__) && defined(_MIT_POSIX_THREADS)
+#include <pthread/mit/sys/timers.h>
+#endif
+
+#if defined(__irix__) && defined(PthreadSupportThreadPriority)
+#if _POSIX_THREAD_PRIORITY_SCHEDULING
+#include <sched.h>
+#endif
+#endif
+
+#define DB(x) // x
+//#include <iostream.h> or #include <iostream> if DB is on.
+
+#if (PthreadDraftVersion <= 6)
+#define ERRNO(x) (((x) != 0) ? (errno) : 0)
+#ifdef __VMS
+// pthread_setprio returns old priority on success (draft version 4:
+// OpenVms version < 7)
+#define THROW_ERRORS(x) { if ((x) == -1) throw omni_thread_fatal(errno); }
+#else
+#define THROW_ERRORS(x) { if ((x) != 0) throw omni_thread_fatal(errno); }
+#endif
+#else
+#define ERRNO(x) (x)
+#define THROW_ERRORS(x) { int rc = (x); \
+			  if (rc != 0) throw omni_thread_fatal(rc); }
+#endif
+
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Mutex
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+omni_mutex::omni_mutex(void)
+{
+#if (PthreadDraftVersion == 4)
+    THROW_ERRORS(pthread_mutex_init(&posix_mutex, pthread_mutexattr_default));
+#else
+    THROW_ERRORS(pthread_mutex_init(&posix_mutex, 0));
+#endif
+}
+
+omni_mutex::~omni_mutex(void)
+{
+    THROW_ERRORS(pthread_mutex_destroy(&posix_mutex));
+}
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Condition variable
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+omni_condition::omni_condition(omni_mutex* m) : mutex(m)
+{
+#if (PthreadDraftVersion == 4)
+    THROW_ERRORS(pthread_cond_init(&posix_cond, pthread_condattr_default));
+#else
+    THROW_ERRORS(pthread_cond_init(&posix_cond, 0));
+#endif
+}
+
+omni_condition::~omni_condition(void)
+{
+    THROW_ERRORS(pthread_cond_destroy(&posix_cond));
+}
+
+void
+omni_condition::wait(void)
+{
+    THROW_ERRORS(pthread_cond_wait(&posix_cond, &mutex->posix_mutex));
+}
+
+int
+omni_condition::timedwait(unsigned long secs, unsigned long nanosecs)
+{
+    timespec rqts = { secs, nanosecs };
+
+again:
+    int rc = ERRNO(pthread_cond_timedwait(&posix_cond,
+					  &mutex->posix_mutex, &rqts));
+    if (rc == 0)
+	return 1;
+
+#if (PthreadDraftVersion <= 6)
+    if (rc == EAGAIN)
+	return 0;
+#endif
+
+    // Some versions of unix produces this errno when the wait was
+    // interrupted by a unix signal or fork.
+    // Some versions of the glibc 2.0.x produces this errno when the 
+    // program is debugged under gdb. Straightly speaking this is non-posix
+    // compliant. We catch this here to make debugging possible.
+    if (rc == EINTR)
+      goto again;
+
+    if (rc == ETIMEDOUT)
+	return 0;
+
+    throw omni_thread_fatal(rc);
+#ifdef _MSC_VER
+    return 0;
+#endif
+}
+
+void
+omni_condition::signal(void)
+{
+    THROW_ERRORS(pthread_cond_signal(&posix_cond));
+}
+
+void
+omni_condition::broadcast(void)
+{
+    THROW_ERRORS(pthread_cond_broadcast(&posix_cond));
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Counting semaphore
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+omni_semaphore::omni_semaphore(unsigned int initial) : c(&m)
+{
+    value = initial;
+}
+
+omni_semaphore::~omni_semaphore(void)
+{
+}
+
+void
+omni_semaphore::wait(void)
+{
+    omni_mutex_lock l(m);
+
+    while (value == 0)
+	c.wait();
+
+    value--;
+}
+
+int
+omni_semaphore::trywait(void)
+{
+    omni_mutex_lock l(m);
+
+    if (value == 0)
+	return 0;
+
+    value--;
+    return 1;
+}
+
+void
+omni_semaphore::post(void)
+{
+    omni_mutex_lock l(m);
+    value++;
+    c.signal();
+}
+
+
+
+///////////////////////////////////////////////////////////////////////////
+//
+// Thread
+//
+///////////////////////////////////////////////////////////////////////////
+
+
+//
+// static variables
+//
+
+omni_mutex* omni_thread::next_id_mutex;
+int omni_thread::next_id = 0;
+
+static pthread_key_t self_key;
+
+#ifdef PthreadSupportThreadPriority
+static int lowest_priority;
+static int normal_priority;
+static int highest_priority;
+#endif
+
+#if defined(__osf1__) && defined(__alpha__) || defined(__VMS)
+// omniORB requires a larger stack size than the default (21120) on OSF/1
+static size_t stack_size = 32768;
+#elif defined(__rtems__)
+static size_t stack_size = ThreadStackSize;
+#elif defined(__aix__)
+static size_t stack_size = 262144;
+#else
+static size_t stack_size = 0;
+#endif
+
+//
+// Initialisation function (gets called before any user code).
+//
+
+static int& count() {
+  static int the_count = 0;
+  return the_count;
+}
+
+omni_thread::init_t::init_t(void)
+{
+    if (count()++ != 0)	// only do it once however many objects get created.
+	return;
+
+    DB(cerr << "omni_thread::init: posix 1003.4a/1003.1c (draft "
+       << PthreadDraftVersion << ") implementation initialising\n");
+
+#ifdef NeedPthreadInit
+
+    pthread_init();
+
+#endif
+
+#if (PthreadDraftVersion == 4)
+    THROW_ERRORS(pthread_keycreate(&self_key, NULL));
+#else
+    THROW_ERRORS(pthread_key_create(&self_key, NULL));
+#endif
+
+#ifdef PthreadSupportThreadPriority
+
+#if defined(__osf1__) && defined(__alpha__) || defined(__VMS)
+
+    lowest_priority = PRI_OTHER_MIN;
+    highest_priority = PRI_OTHER_MAX;
+
+#elif defined(__hpux__)
+
+    lowest_priority = PRI_OTHER_MIN;
+    highest_priority = PRI_OTHER_MAX;
+
+#elif defined(__sunos__) && (__OSVERSION__ == 5)
+
+    // a bug in pthread_attr_setschedparam means lowest priority is 1 not 0
+
+    lowest_priority  = 1;
+    highest_priority = 3;
+
+#else
+
+    lowest_priority = sched_get_priority_min(SCHED_FIFO);
+    highest_priority = sched_get_priority_max(SCHED_FIFO);
+
+#endif
+
+    switch (highest_priority - lowest_priority) {
+
+    case 0:
+    case 1:
+	normal_priority = lowest_priority;
+	break;
+
+    default:
+	normal_priority = lowest_priority + 1;
+	break;
+    }
+
+#endif   /* PthreadSupportThreadPriority */
+
+    next_id_mutex = new omni_mutex;
+
+    //
+    // Create object for this (i.e. initial) thread.
+    //
+
+    omni_thread* t = new omni_thread;
+
+    t->_state = STATE_RUNNING;
+
+    t->posix_thread = pthread_self ();
+
+    DB(cerr << "initial thread " << t->id() << endl);
+
+    THROW_ERRORS(pthread_setspecific(self_key, (void*)t));
+
+#ifdef PthreadSupportThreadPriority
+
+#if (PthreadDraftVersion == 4)
+
+    THROW_ERRORS(pthread_setprio(t->posix_thread,
+				 posix_priority(PRIORITY_NORMAL)));
+
+#elif (PthreadDraftVersion == 6)
+
+    pthread_attr_t attr;
+    pthread_attr_init(&attr);
+
+    THROW_ERRORS(pthread_attr_setprio(&attr, posix_priority(PRIORITY_NORMAL)));
+
+    THROW_ERRORS(pthread_setschedattr(t->posix_thread, attr));
+
+#else
+
+    struct sched_param sparam;
+
+    sparam.sched_priority = posix_priority(PRIORITY_NORMAL);
+
+    THROW_ERRORS(pthread_setschedparam(t->posix_thread, SCHED_OTHER, &sparam));
+
+#endif   /* PthreadDraftVersion */
+
+#endif   /* PthreadSupportThreadPriority */
+}
+
+omni_thread::init_t::~init_t(void)
+{
+    if (--count() != 0) return;
+
+    omni_thread* self = omni_thread::self();
+    if (!self) return;
+
+    pthread_setspecific(self_key, 0);
+    delete self;
+
+    delete next_id_mutex;
+}
+
+//
+// Wrapper for thread creation.
+//
+
+extern "C" void* 
+omni_thread_wrapper(void* ptr)
+{
+    omni_thread* me = (omni_thread*)ptr;
+
+    DB(cerr << "omni_thread_wrapper: thread " << me->id()
+       << " started\n");
+
+    THROW_ERRORS(pthread_setspecific(self_key, me));
+
+    //
+    // Now invoke the thread function with the given argument.
+    //
+
+    if (me->fn_void != NULL) {
+	(*me->fn_void)(me->thread_arg);
+	omni_thread::exit();
+    }
+
+    if (me->fn_ret != NULL) {
+	void* return_value = (*me->fn_ret)(me->thread_arg);
+	omni_thread::exit(return_value);
+    }
+
+    if (me->detached) {
+	me->run(me->thread_arg);
+	omni_thread::exit();
+    } else {
+	void* return_value = me->run_undetached(me->thread_arg);
+	omni_thread::exit(return_value);
+    }
+
+    // should never get here.
+
+    return NULL;
+}
+
+
+//
+// Constructors for omni_thread - set up the thread object but don't
+// start it running.
+//
+
+// construct a detached thread running a given function.
+
+omni_thread::omni_thread(void (*fn)(void*), void* arg, priority_t pri)
+{
+    common_constructor(arg, pri, 1);
+    fn_void = fn;
+    fn_ret = NULL;
+}
+
+// construct an undetached thread running a given function.
+
+omni_thread::omni_thread(void* (*fn)(void*), void* arg, priority_t pri)
+{
+    common_constructor(arg, pri, 0);
+    fn_void = NULL;
+    fn_ret = fn;
+}
+
+// construct a thread which will run either run() or run_undetached().
+
+omni_thread::omni_thread(void* arg, priority_t pri)
+{
+    common_constructor(arg, pri, 1);
+    fn_void = NULL;
+    fn_ret = NULL;
+}
+
+// common part of all constructors.
+
+void
+omni_thread::common_constructor(void* arg, priority_t pri, int det)
+{
+    _state = STATE_NEW;
+    _priority = pri;
+
+    next_id_mutex->lock();
+    _id = next_id++;
+    next_id_mutex->unlock();
+
+    thread_arg = arg;
+    detached = det;	// may be altered in start_undetached()
+
+    _dummy       = 0;
+    _values      = 0;
+    _value_alloc = 0;
+    // posix_thread is set up in initialisation routine or start().
+}
+
+
+//
+// Destructor for omni_thread.
+//
+
+omni_thread::~omni_thread(void)
+{
+    DB(cerr << "destructor called for thread " << id() << endl);
+    if (_values) {
+        for (key_t i=0; i < _value_alloc; i++) {
+	    if (_values[i]) {
+	        delete _values[i];
+	    }
+        }
+	delete [] _values;
+    }
+}
+
+
+//
+// Start the thread
+//
+
+void
+omni_thread::start(void)
+{
+    omni_mutex_lock l(mutex);
+
+    if (_state != STATE_NEW)
+	throw omni_thread_invalid();
+
+    pthread_attr_t attr;
+
+#if (PthreadDraftVersion == 4)
+    pthread_attr_create(&attr);
+#else
+    pthread_attr_init(&attr);
+#endif
+
+#if (PthreadDraftVersion == 8)
+    pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
+#endif
+
+#ifdef PthreadSupportThreadPriority
+
+#if (PthreadDraftVersion <= 6)
+
+    THROW_ERRORS(pthread_attr_setprio(&attr, posix_priority(_priority)));
+
+#else
+
+    struct sched_param sparam;
+
+    sparam.sched_priority = posix_priority(_priority);
+
+    THROW_ERRORS(pthread_attr_setschedparam(&attr, &sparam));
+
+#endif	/* PthreadDraftVersion */
+
+#endif	/* PthreadSupportThreadPriority */
+
+    if (stack_size) {
+      THROW_ERRORS(pthread_attr_setstacksize(&attr, stack_size));
+    }
+
+#if (PthreadDraftVersion == 4)
+    THROW_ERRORS(pthread_create(&posix_thread, attr, omni_thread_wrapper,
+				(void*)this));
+    pthread_attr_delete(&attr);
+#else
+    THROW_ERRORS(pthread_create(&posix_thread, &attr, omni_thread_wrapper,
+				(void*)this));
+    pthread_attr_destroy(&attr);
+#endif
+
+    _state = STATE_RUNNING;
+
+    if (detached) {
+
+#if (PthreadDraftVersion <= 6)
+	THROW_ERRORS(pthread_detach(&posix_thread));
+#else
+	THROW_ERRORS(pthread_detach(posix_thread));
+#endif
+    }
+}
+
+
+//
+// Start a thread which will run the member function run_undetached().
+//
+
+void
+omni_thread::start_undetached(void)
+{
+    if ((fn_void != NULL) || (fn_ret != NULL))
+	throw omni_thread_invalid();
+
+    detached = 0;
+    start();
+}
+
+
+//
+// join - simply check error conditions & call pthread_join.
+//
+
+void
+omni_thread::join(void** status)
+{
+    mutex.lock();
+
+    if ((_state != STATE_RUNNING) && (_state != STATE_TERMINATED)) {
+	mutex.unlock();
+	throw omni_thread_invalid();
+    }
+
+    mutex.unlock();
+
+    if (this == self())
+	throw omni_thread_invalid();
+
+    if (detached)
+	throw omni_thread_invalid();
+
+    DB(cerr << "omni_thread::join: doing pthread_join\n");
+
+    THROW_ERRORS(pthread_join(posix_thread, status));
+
+    DB(cerr << "omni_thread::join: pthread_join succeeded\n");
+
+#if (PthreadDraftVersion == 4)
+    // With draft 4 pthreads implementations (HPUX 10.x and
+    // Digital Unix 3.2), have to detach the thread after 
+    // join. If not, the storage for the thread will not be
+    // be reclaimed.
+    THROW_ERRORS(pthread_detach(&posix_thread));
+#endif
+
+    delete this;
+}
+
+
+//
+// Change this thread's priority.
+//
+
+void
+omni_thread::set_priority(priority_t pri)
+{
+    omni_mutex_lock l(mutex);
+
+    if (_state != STATE_RUNNING)
+	throw omni_thread_invalid();
+
+    _priority = pri;
+
+#ifdef PthreadSupportThreadPriority
+
+#if (PthreadDraftVersion == 4)
+
+    THROW_ERRORS(pthread_setprio(posix_thread, posix_priority(pri)));
+
+#elif (PthreadDraftVersion == 6)
+
+    pthread_attr_t attr;
+    pthread_attr_init(&attr);
+
+    THROW_ERRORS(pthread_attr_setprio(&attr, posix_priority(pri)));
+
+    THROW_ERRORS(pthread_setschedattr(posix_thread, attr));
+
+#else
+
+    struct sched_param sparam;
+
+    sparam.sched_priority = posix_priority(pri);
+
+    THROW_ERRORS(pthread_setschedparam(posix_thread, SCHED_OTHER, &sparam));
+
+#endif   /* PthreadDraftVersion */
+
+#endif   /* PthreadSupportThreadPriority */
+}
+
+
+//
+// create - construct a new thread object and start it running.  Returns thread
+// object if successful, null pointer if not.
+//
+
+// detached version
+
+omni_thread*
+omni_thread::create(void (*fn)(void*), void* arg, priority_t pri)
+{
+    omni_thread* t = new omni_thread(fn, arg, pri);
+
+    t->start();
+
+    return t;
+}
+
+// undetached version
+
+omni_thread*
+omni_thread::create(void* (*fn)(void*), void* arg, priority_t pri)
+{
+    omni_thread* t = new omni_thread(fn, arg, pri);
+
+    t->start();
+
+    return t;
+}
+
+
+//
+// exit() _must_ lock the mutex even in the case of a detached thread.  This is
+// because a thread may run to completion before the thread that created it has
+// had a chance to get out of start().  By locking the mutex we ensure that the
+// creating thread must have reached the end of start() before we delete the
+// thread object.  Of course, once the call to start() returns, the user can
+// still incorrectly refer to the thread object, but that's their problem.
+//
+
+void
+omni_thread::exit(void* return_value)
+{
+    omni_thread* me = self();
+
+    if (me)
+      {
+	me->mutex.lock();
+
+	me->_state = STATE_TERMINATED;
+
+	me->mutex.unlock();
+
+	DB(cerr << "omni_thread::exit: thread " << me->id() << " detached "
+	   << me->detached << " return value " << return_value << endl);
+
+	if (me->_values) {
+	  for (key_t i=0; i < me->_value_alloc; i++) {
+	    if (me->_values[i]) {
+	      delete me->_values[i];
+	    }
+	  }
+	  delete [] me->_values;
+	  me->_values = 0;
+	}
+
+	if (me->detached)
+	  delete me;
+      }
+    else
+      {
+	DB(cerr << "omni_thread::exit: called with a non-omnithread. Exit quietly." << endl);
+      }
+
+    pthread_exit(return_value);
+}
+
+
+omni_thread*
+omni_thread::self(void)
+{
+    omni_thread* me;
+
+#if (PthreadDraftVersion <= 6)
+
+    THROW_ERRORS(pthread_getspecific(self_key, (void**)&me));
+
+#else
+
+    me = (omni_thread *)pthread_getspecific(self_key);
+
+#endif
+
+    if (!me) {
+      // This thread is not created by omni_thread::start because it
+      // doesn't has a class omni_thread instance attached to its key.
+      DB(cerr << "omni_thread::self: called with a non-omnithread. NULL is returned." << endl);
+    }
+
+    return me;
+}
+
+
+void
+omni_thread::yield(void)
+{
+#if (PthreadDraftVersion == 6)
+
+    pthread_yield(NULL);
+
+#elif (PthreadDraftVersion < 9)
+
+    pthread_yield();
+
+#else
+
+    THROW_ERRORS(sched_yield());
+
+#endif
+}
+
+
+void
+omni_thread::sleep(unsigned long secs, unsigned long nanosecs)
+{
+    timespec rqts = { secs, nanosecs };
+
+#ifndef NoNanoSleep
+
+    timespec remain;
+    while (nanosleep(&rqts, &remain)) {
+      if (errno == EINTR) {
+	rqts.tv_sec  = remain.tv_sec;
+	rqts.tv_nsec = remain.tv_nsec;
+	continue;
+      }
+      else
+	throw omni_thread_fatal(errno);
+    }
+#else
+
+#if defined(__osf1__) && defined(__alpha__) || defined(__hpux__) && (__OSVERSION__ == 10) || defined(__VMS) || defined(__SINIX__) || defined (__POSIX_NT__)
+
+    if (pthread_delay_np(&rqts) != 0)
+	throw omni_thread_fatal(errno);
+
+#elif defined(__linux__) || defined(__aix__)
+
+    if (secs > 2000) {
+      while ((secs = ::sleep(secs))) ;
+    } else {
+	usleep(secs * 1000000 + (nanosecs / 1000));
+    }
+
+#elif defined(__darwin__) || defined(__macos__)
+
+    // Single UNIX Specification says argument of usleep() must be
+    // less than 1,000,000.
+    secs += nanosecs / 1000000000;
+    nanosecs %= 1000000000;
+    while ((secs = ::sleep(secs))) ;
+    usleep(nanosecs / 1000);
+
+#else
+
+    throw omni_thread_invalid();
+
+#endif
+#endif	/* NoNanoSleep */
+}
+
+
+void
+omni_thread::get_time(unsigned long* abs_sec, unsigned long* abs_nsec,
+		      unsigned long rel_sec, unsigned long rel_nsec)
+{
+    timespec abs;
+
+#if defined(__osf1__) && defined(__alpha__) || defined(__hpux__) && (__OSVERSION__ == 10) || defined(__VMS) || defined(__SINIX__) || defined(__POSIX_NT__)
+
+    timespec rel;
+    rel.tv_sec = rel_sec;
+    rel.tv_nsec = rel_nsec;
+    THROW_ERRORS(pthread_get_expiration_np(&rel, &abs));
+
+#else
+
+#if defined(__linux__) || defined(__GLIBC__) || defined(__aix__) || defined(__SCO_VERSION__) || defined(__darwin__) || defined(__macos__)
+
+    struct timeval tv;
+    gettimeofday(&tv, NULL); 
+    abs.tv_sec = tv.tv_sec;
+    abs.tv_nsec = tv.tv_usec * 1000;
+
+#else	/* __linux__ || __aix__ */
+
+    clock_gettime(CLOCK_REALTIME, &abs);
+
+#endif	/* __linux__ || __aix__ */
+
+    abs.tv_nsec += rel_nsec;
+    abs.tv_sec += rel_sec + abs.tv_nsec / 1000000000;
+    abs.tv_nsec = abs.tv_nsec % 1000000000;
+
+#endif	/* __osf1__ && __alpha__ */
+
+    *abs_sec = abs.tv_sec;
+    *abs_nsec = abs.tv_nsec;
+}
+
+
+int
+omni_thread::posix_priority(priority_t pri)
+{
+#ifdef PthreadSupportThreadPriority
+    switch (pri) {
+
+    case PRIORITY_LOW:
+	return lowest_priority;
+
+    case PRIORITY_NORMAL:
+	return normal_priority;
+
+    case PRIORITY_HIGH:
+	return highest_priority;
+
+    }
+#endif
+
+    throw omni_thread_invalid();
+#if defined(_MSC_VER ) || defined(__HP_aCC)
+    return 0;
+#endif
+}
+
+void
+omni_thread::stacksize(unsigned long sz)
+{
+  stack_size = sz;
+}
+
+unsigned long
+omni_thread::stacksize()
+{
+  return stack_size;
+}
+
+//
+// Dummy thread
+//
+
+class omni_thread_dummy : public omni_thread {
+public:
+  inline omni_thread_dummy() : omni_thread()
+  {
+    _dummy = 1;
+    _state = STATE_RUNNING;
+    posix_thread = pthread_self();
+    THROW_ERRORS(pthread_setspecific(self_key, (void*)this));
+  }
+  inline ~omni_thread_dummy()
+  {
+    THROW_ERRORS(pthread_setspecific(self_key, 0));
+  }
+};
+
+omni_thread*
+omni_thread::create_dummy()
+{
+  if (omni_thread::self())
+    throw omni_thread_invalid();
+
+  return new omni_thread_dummy;
+}
+
+void
+omni_thread::release_dummy()
+{
+  omni_thread* self = omni_thread::self();
+  if (!self || !self->_dummy)
+    throw omni_thread_invalid();
+
+  omni_thread_dummy* dummy = (omni_thread_dummy*)self;
+  delete dummy;
+}
+
+
+#define INSIDE_THREAD_IMPL_CC
+#include "threaddata.cc"
+#undef INSIDE_THREAD_IMPL_CC

Added: trunk/omniorb4/src/services/mklib/libdefs.mk
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/src/services/mklib/libdefs.mk?rev=9&op=file
==============================================================================
--- trunk/omniorb4/src/services/mklib/libdefs.mk (added)
+++ trunk/omniorb4/src/services/mklib/libdefs.mk Thu Sep 20 20:19:25 2007
@@ -1,0 +1,21 @@
+# Edit COS_INTERFACES to select which COS idl to build into the stub library.
+#
+# All the interfaces:
+COS_INTERFACES = $(COS_ALL_INT)
+# Or just the Notification interfaces:
+#COS_INTERFACES = $(TIMEBASE_INT) $(COS_EVT_INT) $(COS_NFY_INT) $(COS_LCB_INT)
+# Or pick your own subset
+# COS_INTERFACES = <pick you own subset from cosinterfaces.mk>
+
+
+DIR_IDLFLAGS  += -Wbuse_quotes -I$(BASE_OMNI_TREE)/idl
+
+# omniORB now properly supports long long, so we don't need to turn it off...
+#DIR_IDLFLAGS  += -DNOLONGLONG
+
+DIR_CPPFLAGS = $(CORBA_CPPFLAGS) -D_COS_LIBRARY -DENABLE_CLIENT_IR_SUPPORT
+
+%.DynSK.cc %SK.cc: %.idl
+	$(CORBA_IDL) $(DIR_IDLFLAGS) $^	
+
+.PRECIOUS: %.DynSK.cc %SK.cc

Modified: trunk/omniorb4/src/tool/dir.mk
URL: http://svn.debian.org/wsvn/pkg-corba/trunk/omniorb4/src/tool/dir.mk?rev=9&op=diff
==============================================================================
--- trunk/omniorb4/src/tool/dir.mk (original)
+++ trunk/omniorb4/src/tool/dir.mk Thu Sep 20 20:19:25 2007
@@ -7,7 +7,7 @@
 endif
 
 ifdef UnixPlatform
-SUBDIRS = omkdepend omniidl
+SUBDIRS = omniidl
 endif
 
 ifdef Win32Platform




More information about the Pkg-corba-commits mailing list