summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/AVStreams/mpeg/source/server
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/tests/AVStreams/mpeg/source/server')
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Machine_Properties.cpp291
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Machine_Properties.h97
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Makefile97
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Makefile.am73
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Property_Exporter.cpp423
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Property_Exporter.h211
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.cpp159
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.h90
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.idl32
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/as.cpp79
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/as.h59
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/augmented_server.cpp731
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/augmented_server.h301
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/server.cpp482
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/server.h196
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/svc.conf6
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vcrs.cpp264
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vs.cpp79
-rw-r--r--TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vs.h60
19 files changed, 0 insertions, 3730 deletions
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Machine_Properties.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Machine_Properties.cpp
deleted file mode 100644
index 9b0685ecf89..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Machine_Properties.cpp
+++ /dev/null
@@ -1,291 +0,0 @@
-// $Id$
-
-#include "Machine_Properties.h"
-
-ACE_RCSID(server, Machine_Properties, "$Id$")
-
-const int TAO_Machine_Properties::NUM_PROPERTIES = 10;
-
-const int DEFAULT_TIMEOUT_SEC = 1;
-const int DEFAULT_TIMEOUT_USEC = 0;
-
-const char* TAO_Machine_Properties::PROP_NAMES[] =
-{
- "CPU",
- "Disk",
- "Pages",
- "Swaps",
- "Packets",
- "Errors",
- "Context_Switches",
- "Collisions",
- "Interrupts",
- "Load"
-};
-
-// XXX:hack to avoid CC errors.
-// Redefine xdr_void. Always return true.
-int xdr_void (XDR *,void *)
-{
- return 1;
-}
-
-
-TAO_Machine_Properties::TAO_Machine_Properties (void)
- : timeout_ (ACE_Time_Value (DEFAULT_TIMEOUT_SEC, DEFAULT_TIMEOUT_USEC)),
- timestamp_ (0),
- sample_time_ (0)
-{
- this->init ();
-}
-
-
-TAO_Machine_Properties::
-TAO_Machine_Properties (const ACE_Time_Value& timeout)
- : timeout_ (timeout),
- timestamp_ (0),
- sample_time_ (0)
-{
- this->init ();
-}
-
-void
-TAO_Machine_Properties::init (void)
-{
- /*
- this->rstat_client_ =
- ::clnt_create("localhost", RSTATPROG, RSTATVERS_TIME, "udp");
-
- if (this->rstat_client_ == 0)
- {
- ACE_ERROR ((LM_ERROR, "(%P|%t) %s\n",
- ::clnt_spcreateerror ("localhost")));
- }
-
- ::memset (&this->old_stats_, 0, sizeof (statstime));
- */
- this->retrieve_stats ();
-}
-
-int
-TAO_Machine_Properties::retrieve_stats (void)
-{
- // initialize the handle everytime ??
- this->rstat_client_ =
- ::clnt_create("localhost", RSTATPROG, RSTATVERS_TIME, "udp");
-
- if (this->rstat_client_ == 0)
- {
- ACE_ERROR ((LM_ERROR, "(%P|%t) %s\n",
- ::clnt_spcreateerror ("localhost")));
- }
-
- ::memset (&this->old_stats_, 0, sizeof (statstime));
-
- // if (this->rstat_client_ == 0)
- // return -1;
-
- static struct timeval timeout = {25, 0};
- u_int result;
- if ((result =clnt_call (this->rstat_client_,
- RSTATPROC_STATS,
- xdr_void,
- 0,
- (xdrproc_t) xdr_statstime,
- (caddr_t) &this->stats_,
- timeout)) != RPC_SUCCESS)
- {
- ACE_DEBUG ((LM_DEBUG,"rpc-error:%d\n",result));
- ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) %s\n",
- ::clnt_sperror (this->rstat_client_, "localhost")), -1);
- }
- else
- ACE_DEBUG ((LM_DEBUG,"rpc client call worked\n"));
-
- this->sample_time_ = ACE_OS::gettimeofday () - this->timestamp_;
- this->timestamp_ = ACE_OS::gettimeofday ();
- return 0;
-}
-
-CORBA::Any*
-TAO_Machine_Properties::evalDP (const char* prop_name,
- CORBA::TypeCode_ptr returned_type,
- const CORBA::Any& extra_info,
- CORBA::Environment& TAO_IN_ENV)
- TAO_THROW_SPEC ((CosTradingDynamic::DPEvalFailure))
-{
- CORBA::Any* return_value;
-
- ACE_DEBUG ((LM_DEBUG, "Evaluating machine properties.\n"));
-
- ACE_NEW_RETURN (return_value, CORBA::Any, 0);
-
- if (ACE_OS::gettimeofday () - this->timestamp_ > this->timeout_)
- {
- if (this->retrieve_stats () == -1)
- return return_value;
- }
-
- CORBA::String_var prop_name_var (prop_name);
- int elapsed_seconds = this->sample_time_.sec () +
- (this->sample_time_.usec () > 500000) ? 1 : 0;
-
- if (ACE_OS::strcmp (prop_name, PROP_NAMES[CPU]) == 0)
- this->compute_cpu (*return_value, elapsed_seconds);
- else if (ACE_OS::strcmp (prop_name, PROP_NAMES[DISK]) == 0)
- this->compute_disk (*return_value, elapsed_seconds);
- else if (ACE_OS::strcmp (prop_name, PROP_NAMES[PAGES]) == 0)
- this->compute_pages (*return_value, elapsed_seconds);
- else if (ACE_OS::strcmp (prop_name, PROP_NAMES[SWAPS]) == 0)
- this->compute_swaps (*return_value, elapsed_seconds);
- else if (ACE_OS::strcmp (prop_name, PROP_NAMES[PACKETS]) == 0)
- this->compute_packets (*return_value, elapsed_seconds);
- else if (ACE_OS::strcmp (prop_name, PROP_NAMES[ERRORS]) == 0)
- this->compute_errors (*return_value, elapsed_seconds);
- else if (ACE_OS::strcmp (prop_name, PROP_NAMES[CONTEXT_SWITCHES]) == 0)
- this->compute_context (*return_value, elapsed_seconds);
- else if (ACE_OS::strcmp (prop_name, PROP_NAMES[COLLISIONS]) == 0)
- this->compute_collisions (*return_value, elapsed_seconds);
- else if (ACE_OS::strcmp (prop_name, PROP_NAMES[INTERRUPTS]) == 0)
- this->compute_interrupts (*return_value, elapsed_seconds);
- else if (ACE_OS::strcmp (prop_name, PROP_NAMES[LOAD]) == 0)
- this->compute_load (*return_value, elapsed_seconds);
-
- ::memcpy (&this->old_stats_, &this->stats_, sizeof (statstime));
-
- return return_value;
-}
-
-void
-TAO_Machine_Properties::
-export_properties (TAO_Property_Exporter& prop_exporter)
-{
- ACE_DEBUG ((LM_ERROR, "Adding machine properties.\n"));
- for (int i = 0; i < NUM_PROPERTIES; i++)
- {
- CORBA::Any extra_info;
- const char* name = PROP_NAMES[i];
- const CORBA::TypeCode_ptr prop_type = CORBA::_tc_float;
-
- CosTradingDynamic::DynamicProp* dp_struct =
- this->construct_dynamic_prop (name, prop_type, extra_info);
-
- prop_exporter.add_dynamic_property (name, dp_struct);
- }
-}
-
-int
-TAO_Machine_Properties::
-define_properties (CosTradingRepos::ServiceTypeRepository::PropStructSeq& prop_seq,
- CORBA::ULong offset) const
-{
- prop_seq.length (NUM_PROPERTIES + offset);
- for (int j = prop_seq.length () - offset - 1, i = offset; j >= 0; j--, i++)
- {
- prop_seq[i].name = PROP_NAMES[i - offset];
- prop_seq[i].value_type = CORBA::TypeCode::_duplicate (CORBA::_tc_float);
- prop_seq[i].mode = CosTradingRepos::ServiceTypeRepository::PROP_NORMAL;
- }
-
- return NUM_PROPERTIES;
-}
-
-void
-TAO_Machine_Properties::compute_cpu (CORBA::Any& value, int elapsed_seconds)
-{
-
- // The first three cpu stats are for user, kernal, iowait
- CORBA::ULong used = 0.0;
- for (int i = 0; i < RSTAT_CPUSTATES - 1; i++)
- used += (this->stats_.cp_time[i] - this->old_stats_.cp_time[i]);
-
- // The last is the amount idle.
- CORBA::ULong idle =
- this->stats_.cp_time[RSTAT_CPUSTATES - 1] -
- this->old_stats_.cp_time[RSTAT_CPUSTATES - 1];
-
- // The CPU usage is the amount used over the total available.
- value <<= (CORBA::Float) ((((CORBA::Float) used) / (used + idle)) * 100.0);
-}
-
-void
-TAO_Machine_Properties::compute_disk (CORBA::Any& value, int elapsed_seconds)
-{
- CORBA::Float used = 0.0;
- for (int i = 0; i < RSTAT_DK_NDRIVE; i++)
- used += (this->stats_.dk_xfer[i] - this->old_stats_.dk_xfer[i]);
-
- value <<= (CORBA::Float)(used / (float) elapsed_seconds);
-}
-
-void
-TAO_Machine_Properties::compute_pages (CORBA::Any& value, int elapsed_seconds)
-{
- CORBA::Float pages =
- (this->stats_.v_pgpgin - this->old_stats_.v_pgpgin) +
- (this->stats_.v_pgpgout - this->old_stats_.v_pgpgout);
-
- value <<= (CORBA::Float) (pages / elapsed_seconds);
-}
-
-void
-TAO_Machine_Properties::compute_swaps (CORBA::Any& value, int elapsed_seconds)
-{
- CORBA::Float swaps =
- (this->stats_.v_pswpin - this->old_stats_.v_pswpin) +
- (this->stats_.v_pswpout - this->old_stats_.v_pswpout);
-
- value <<= (CORBA::Float) (swaps / elapsed_seconds);
-}
-
-void
-TAO_Machine_Properties::compute_packets (CORBA::Any& value, int elapsed_seconds)
-{
- CORBA::Float packets =
- (this->stats_.if_ipackets - this->old_stats_.if_ipackets) +
- (this->stats_.if_opackets - this->old_stats_.if_opackets);
-
- value <<= (CORBA::Float) (packets / elapsed_seconds);
-}
-
-void
-TAO_Machine_Properties::compute_errors (CORBA::Any& value, int elapsed_seconds)
-{
- CORBA::Float packets =
- (this->stats_.if_ipackets - this->old_stats_.if_ipackets) +
- (this->stats_.if_opackets - this->old_stats_.if_opackets);
-
- value <<= (CORBA::Float) (packets / elapsed_seconds);
-}
-
-void
-TAO_Machine_Properties::
-compute_context (CORBA::Any& value, int elapsed_seconds)
-{
- CORBA::Float switches = (this->stats_.v_swtch - this->old_stats_.v_swtch);
- value <<= (CORBA::Float) (switches / elapsed_seconds);
-}
-
-void
-TAO_Machine_Properties::
-compute_collisions (CORBA::Any& value, int elapsed_seconds)
-{
- CORBA::Float cols =
- (this->stats_.if_collisions - this->old_stats_.if_collisions);
- value <<= (CORBA::Float) (cols / elapsed_seconds);
-}
-
-void
-TAO_Machine_Properties::
-compute_interrupts (CORBA::Any& value, int elapsed_seconds)
-{
- CORBA::Float intr = (this->stats_.v_intr - this->old_stats_.v_intr);
- value <<= (CORBA::Float) (intr / elapsed_seconds);
-}
-
-void
-TAO_Machine_Properties::compute_load (CORBA::Any& value, int elapsed_seconds)
-{
- CORBA::Float load = ((CORBA::Float) this->stats_.avenrun[0]) / FSCALE;
- value <<= load;
-}
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Machine_Properties.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Machine_Properties.h
deleted file mode 100644
index 99c6079a419..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Machine_Properties.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- C++ -*- */
-
-// ============================================================================
-// $Id$
-//
-// = FILENAME
-// Machine_Properties.h
-//
-// = DESCRIPTION
-// As a trading service dynamic property, retrieves machine
-// statistics from the rstatd using Sun RPC.
-//
-// = AUTHORS
-// Seth Widoff <sbw1@cs.wustl.edu>
-//
-// ============================================================================
-
-#if (! defined TAO_MACHINE_PROPERTIES)
-#define TAO_MACHINE_PROPERTIES
-
-#include "orbsvcs/Trader/Trader_Utils.h"
-#include "Property_Exporter.h"
-
-//RPC related includes
-#include <rpc/rpc.h>
-#include <rpcsvc/rstat.h>
-
-class TAO_Machine_Properties :
- public TAO_Dynamic_Property,
- public TAO_Exportable
-{
-public:
-
- enum PROP_TYPES
- {
- CPU,
- DISK,
- PAGES,
- SWAPS,
- PACKETS,
- ERRORS,
- CONTEXT_SWITCHES,
- COLLISIONS,
- INTERRUPTS,
- LOAD
- };
-
- static const int NUM_PROPERTIES;
- static const char* PROP_NAMES[];
-
- TAO_Machine_Properties (void);
-
- TAO_Machine_Properties (const ACE_Time_Value& timeout);
-
- virtual CORBA::Any* evalDP (const char* name,
- CORBA::TypeCode_ptr returned_type,
- const CORBA::Any& extra_info,
- CORBA::Environment& _env)
- TAO_THROW_SPEC ((CosTradingDynamic::DPEvalFailure));
- // Return the value of a machine performance property whose name is
- // contained in <extra_info>, which in essence is another
- // demultiplexing key.
-
- virtual void export_properties (TAO_Property_Exporter& prop_exporter);
-
- virtual int define_properties
- (CosTradingRepos::ServiceTypeRepository::PropStructSeq& prop_seq,
- CORBA::ULong offset = 0) const;
-
-private:
-
- void init (void);
-
- int retrieve_stats (void);
-
- void compute_cpu (CORBA::Any& value, int elapsed_time);
- void compute_disk (CORBA::Any& value, int elapsed_time);
- void compute_pages (CORBA::Any& value, int elapsed_time);
- void compute_swaps (CORBA::Any& value, int elapsed_time);
- void compute_packets (CORBA::Any& value, int elapsed_time);
- void compute_errors (CORBA::Any& value, int elapsed_time);
- void compute_context (CORBA::Any& value, int elapsed_time);
- void compute_collisions (CORBA::Any& value, int elapsed_time);
- void compute_interrupts (CORBA::Any& value, int elapsed_time);
- void compute_load (CORBA::Any& value, int elapsed_time);
-
- const ACE_Time_Value timeout_;
- ACE_Time_Value timestamp_;
- ACE_Time_Value sample_time_;
-
- statstime stats_;
- statstime old_stats_;
- CLIENT* rstat_client_;
-
-};
-
-#endif /* TAO_MACHINE_PROPERTIES */
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Makefile b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Makefile
deleted file mode 100644
index 2e259de641a..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Makefile
+++ /dev/null
@@ -1,97 +0,0 @@
-#----------------------------------------------------------------------------
-#
-# $Id$
-#
-#----------------------------------------------------------------------------
-
-MAKEFILE = Makefile
-
-ifndef TAO_ROOT
-TAO_ROOT = $(ACE_ROOT)/TAO
-endif
-
-AV_SERVER_OBJS = server.o
-AV_AUGSERVER_OBJS = Video_RepositoryC.o augmented_server.o \
- Property_Exporter.o Machine_Properties.o \
- Video_Repository.o
-AV_VS_OBJS = vs.o
-AV_AS_OBJS = as.o
-
-# On non-Windows environment, we should at least define
-# the export_include IDL flag.
-override TAO_IDLFLAGS += \
- -I$(TAO_ROOT)/orbsvcs/orbsvcs
-
-IDL_FILES = Video_RepositoryC Video_RepositoryS
-
-FILES = augmented_server server vs as Property_Exporter Machine_Properties $(IDL_FILES)
-
-DEFS = $(addsuffix .h,$(FILES))
-LSRC = $(addsuffix .cpp,$(FILES))
-
-
-LIBS += -lTAO -lACE -lorbsvcs -lmpeg_server -lmpeg_shared -lrpcsvc
-
-MPEG_ROOT = $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source
-CPPFLAGS += -I$(MPEG_ROOT) -I$(TAO_ROOT)/orbsvcs/orbsvcs
-
-BIN2 = augmented_server server vs as
-
-#### If the TAO orbsvcs library wasn't built with sufficient components,
-#### don't try to build here.
-TAO_ORBSVCS := $(shell sh $(ACE_ROOT)/bin/ace_components --orbsvcs)
-ifeq (AV,$(findstring AV,$(TAO_ORBSVCS)))
- BIN = $(BIN2)
-endif # AV
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(ACE_ROOT)/include/makeinclude/macros.GNU
-include $(TAO_ROOT)/rules.tao.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU
-#include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU
-include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
-
-#----------------------------------------------------------------------------
-# Local targets (and local hacks)
-#----------------------------------------------------------------------------
-
-CPPFLAGS += -DSH_MEM -DNDEBUG
-CPPFLAGS += -I$(TAO_ROOT) -I$(TAO_ROOT)/orbsvcs $(TSS_ORB_FLAG)
-
-.PRECIOUS: Video_RepositoryC.cpp
-
-idl_stubs: $(addsuffix .h, $(IDL_FILES))
-
-
-ifdef stat
-CPPFLAGS += -DSTAT
-endif
-
-server:$(addprefix $(VDIR),$(AV_SERVER_OBJS))
- $(LINK.cc) $(LDFAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK)
-
-augmented_server:$(addprefix $(VDIR),$(AV_AUGSERVER_OBJS))
- $(LINK.cc) $(LDFAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK)
-
-vs:$(addprefix $(VDIR),$(AV_VS_OBJS))
- $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK)
-
-as:$(addprefix $(VDIR),$(AV_AS_OBJS))
- $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK)
-
-realclean: clean
- -$(RM) $(addsuffix .h, $(IDL_FILES)) $(addsuffix .i, $(IDL_FILES)) $(addsuffix .cpp, $(IDL_FILES)) \
- $(addsuffix _T.h, $(IDL_FILES)) $(addsuffix _T.i, $(IDL_FILES)) $(addsuffix _T.cpp, $(IDL_FILES))
-
-# DO NOT DELETE THIS LINE -- g++dep uses it.
-# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-
-
-
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Makefile.am b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Makefile.am
deleted file mode 100644
index 1241d67df59..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Makefile.am
+++ /dev/null
@@ -1,73 +0,0 @@
-##---------------------------------------------------------------------------
-## $Id$
-##
-## Makefile for TAO's AVStreams Tests -- mpeg/source/server directory
-##
-##---------------------------------------------------------------------------
-
-##
-## Process this file with automake to create Makefile.in
-##
-
-## The number in AUTOMAKE_OPTIONS is the minimum required version automake
-## needed to process this file.
-AUTOMAKE_OPTIONS = 1.4
-
-INCLUDES = -I$(top_builddir) -I$(top_srcdir)
-
-noinst_PROGRAMS = augmented_server server vs as
-
-augmented_server_LDADD = \
- $(top_builddir)/ace/libACE.la $(top_builddir)/TAO/tao/libTAO.la
-
-augmented_server_SOURCES = \
- Video_RepositoryC.cpp \
- augmented_server.cpp \
- Property_Exporter.cpp \
- Machine_Properties.cpp \
- Video_Repository.cpp
-
-server_LDADD = \
- $(top_builddir)/ace/libACE.la $(top_builddir)/TAO/tao/libTAO.la
-
-server_SOURCES = \
- server.cpp
-
-vs_LDADD = \
- $(top_builddir)/ace/libACE.la $(top_builddir)/TAO/tao/libTAO.la
-
-vs_SOURCES = \
- vs.cpp
-
-as_LDADD = \
- $(top_builddir)/ace/libACE.la $(top_builddir)/TAO/tao/libTAO.la
-
-as_SOURCES = \
- as.cpp
-
-noinst_HEADERS = \
- Machine_Properties.h \
- Property_Exporter.h \
- Video_Repository.h \
- as.h \
- augmented_server.h \
- server.h \
- vs.h
-
-IDL_SOURCES = \
- Video_Repository.idl
-
-BUILT_SOURCES = \
- Video_RepositoryS.cpp
- Video_RepositoryS.h
- Video_RepositoryC.cpp
- Video_RepositoryC.h
-
-EXTRA_DIST = $(IDL_SOURCES)
-
-## Clean up some additional files/directories possibly created during
-## the configure script tests.
-clean-local:
- -rm -f *.bak *.rpo *.sym lib*.*_pure_* Makefile.old core
- -rm -rf ptrepository Templates.DB gcctemp.c gcctemp so_locations
-
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Property_Exporter.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Property_Exporter.cpp
deleted file mode 100644
index d74d1bd998d..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Property_Exporter.cpp
+++ /dev/null
@@ -1,423 +0,0 @@
-// $Id$
-
-#include "Property_Exporter.h"
-
-ACE_RCSID(server, Property_Exporter, "$Id$")
-
-// *************************************************************
-// DP_Adapter
-// *************************************************************
-
-class DP_Adapter : public TAO_Dynamic_Property
-// = TITLE
-// This class links the a dynamic property in a Trading Service
-// Offer with its value in a CosPropertyService::PropertySet.
-{
-public:
-
- DP_Adapter (const char* prop_name,
- CosPropertyService::PropertySet_ptr prop_set);
-
- ~DP_Adapter (void);
-
- virtual CORBA::Any* evalDP (const char* name,
- CORBA::TypeCode_ptr returned_type,
- const CORBA::Any& extra_info,
- CORBA::Environment& TAO_IN_ENV)
- TAO_THROW_SPEC ((CosTradingDynamic::DPEvalFailure));
- // Call back to the Property Service interface. The Property
- // Service reference is contained in the extra_info -- an
- // Asynchronous Completion Token.
-
-private:
-
- const char* prop_name_;
- CosPropertyService::PropertySet_var prop_set_;
-};
-
-DP_Adapter::DP_Adapter (const char* prop_name,
- CosPropertyService::PropertySet_ptr prop_set)
- : prop_name_ (prop_name),
- prop_set_ (prop_set)
-{
-}
-
-DP_Adapter::~DP_Adapter (void)
-{
-}
-
-CORBA::Any*
-DP_Adapter::evalDP (const char* name,
- CORBA::TypeCode_ptr returned_type,
- const CORBA::Any& extra_info,
- CORBA::Environment& TAO_IN_ENV)
- TAO_THROW_SPEC ((CosTradingDynamic::DPEvalFailure))
-{
- TAO_TRY
- {
- CORBA::Any* return_value =
- this->prop_set_->get_property_value (this->prop_name_,
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- return return_value;
- }
- TAO_CATCHANY
- {
- TAO_THROW_RETURN (CosTradingDynamic::DPEvalFailure
- (this->prop_name_, returned_type, extra_info),
- 0);
- }
- TAO_ENDTRY;
-}
-
-// *************************************************************
-// TAO_Property_Exporter
-// *************************************************************
-
-TAO_Property_Exporter::
-TAO_Property_Exporter (CosTrading::Lookup_var lookup_if,
- CosPropertyService::PropertySet_ptr prop_set,
- CORBA::ULong initial_size)
- : increment_ (initial_size),
- lookup_ (lookup_if),
- prop_set_ (prop_set),
- tprops_ (initial_size),
- pprops_ (initial_size),
- pcount_ (0),
- tcount_ (0)
-{
-}
-
-TAO_Property_Exporter::~TAO_Property_Exporter (void)
-{
-}
-
-void
-TAO_Property_Exporter::add_static_property (const char* name,
- const CORBA::Any& value)
-{
- CORBA::ULong plength = this->pprops_.length (),
- tlength = this->tprops_.length ();
-
- if (tlength == this->tcount_)
- this->tprops_.length (tlength + this->increment_);
-
- if (plength == this->pcount_)
- this->pprops_.length (plength + this->increment_);
-
- // Add the value to the property service sequence.
- this->tprops_[this->tcount_].name = name;
- this->tprops_[this->tcount_].value = value;
- this->tcount_++;
-
- // Add the value to the trading service sequence.
- this->pprops_[this->pcount_].property_name = name;
- this->pprops_[this->pcount_].property_value = value;
- this->pcount_++;
-}
-
-
-void
-TAO_Property_Exporter::
-add_dynamic_property (const char* name,
- const CORBA::Any& value,
- TAO_Dynamic_Property& dynamic_prop)
-{
- // Add a property to the PropSet and a dynamic property to the
- // Offer. Have the dynamic property connect to the PropSet accessor
- // for that name.
- DP_Adapter* dp_adapter;
- ACE_NEW_RETURN (dp_adapter, DP_Adapter (name, this->prop_set_),);
-
- CORBA::ULong plength = this->pprops_.length (),
- tlength = this->tprops_.length ();
-
- if (tlength == this->tcount_)
- this->tprops_.length (tlength + this->increment_);
-
- if (plength == this->pcount_)
- this->pprops_.length (plength + this->increment_);
-
- CORBA::Any extra_info;
-
- CosTradingDynamic::DynamicProp_var dp_struct =
- dynamic_prop.construct_dynamic_prop (name, value.type (), extra_info);
-
- // Copy the dynamic property struct into the property value
- this->tprops_[this->tcount_].name = name;
- this->tprops_[this->tcount_].value <<= dp_struct.in ();
- this->tcount_++;
-
- this->pprops_[this->pcount_].property_name = name;
- this->pprops_[this->pcount_].property_value = value;
- this->pcount_++;
-}
-
-void
-TAO_Property_Exporter::
-add_dynamic_property (const char* name,
- CosTradingDynamic::DynamicProp& dp_struct)
-{
- CORBA::ULong tlength = this->tprops_.length ();
-
- if (tlength == this->tcount_)
- this->tprops_.length (tlength + this->increment_);
-
- this->tprops_[this->tcount_].name = name;
- this->tprops_[this->tcount_].value <<= dp_struct;
- this->tcount_++;
-}
-
-void
-TAO_Property_Exporter::
-add_dynamic_property (const char* name,
- CosTradingDynamic::DynamicProp* dp_struct)
-{
- CORBA::ULong tlength = this->tprops_.length ();
-
- if (tlength == this->tcount_)
- this->tprops_.length (tlength + this->increment_);
-
- this->tprops_[this->tcount_].name = name;
- this->tprops_[this->tcount_].value <<= dp_struct;
- this->tcount_++;
-}
-
-
-CosTrading::OfferId
-TAO_Property_Exporter::_cxx_export (const CORBA::Object_ptr object_ref,
- const CosTrading::ServiceTypeName type,
- CORBA::Environment& TAO_IN_ENV)
- TAO_THROW_SPEC ((CORBA::SystemException,
- CosTrading::Register::InvalidObjectRef,
- CosTrading::IllegalServiceType,
- CosTrading::UnknownServiceType,
- CosTrading::Register::InterfaceTypeMismatch,
- CosTrading::IllegalPropertyName,
- CosTrading::PropertyTypeMismatch,
- CosTrading::ReadonlyDynamicProperty,
- CosTrading::MissingMandatoryProperty,
- CosTrading::DuplicatePropertyName))
-{
- CosTrading::Register_var reg = this->lookup_->register_if (TAO_IN_ENV);
- TAO_CHECK_ENV_RETURN (TAO_IN_ENV, 0);
-
- // Export the offer to the trader under the given type.
- CosTrading::OfferId offer_id = 0;
- this->tprops_.length (this->tcount_);
- offer_id = reg->_cxx_export (object_ref, type, this->tprops_, TAO_IN_ENV);
- TAO_CHECK_ENV_RETURN (TAO_IN_ENV, 0);
-
- this->pprops_.length (this->pcount_);
- this->prop_set_->define_properties (this->pprops_, TAO_IN_ENV);
- TAO_CHECK_ENV_RETURN (TAO_IN_ENV, offer_id);
-
- return offer_id;
-}
-
-CosTrading::OfferId
-TAO_Property_Exporter::_cxx_export (const CORBA::Object_ptr object_ref,
- const CosTrading::ServiceTypeName type,
- const TRADING_REPOS::PropStructSeq& props,
- const TRADING_REPOS::ServiceTypeNameSeq& stypes,
- CORBA::Environment& TAO_IN_ENV)
- TAO_THROW_SPEC ((CORBA::SystemException,
- CosTrading::IllegalServiceType,
- TRADING_REPOS::ServiceTypeExists,
- TRADING_REPOS::InterfaceTypeMismatch,
- CosTrading::IllegalPropertyName,
- CosTrading::DuplicatePropertyName,
- TRADING_REPOS::ValueTypeRedefinition,
- TRADING_REPOS::DuplicateServiceTypeName,
- CosTrading::Register::InvalidObjectRef,
- CosTrading::Register::InterfaceTypeMismatch,
- CosTrading::ReadonlyDynamicProperty,
- CosTrading::MissingMandatoryProperty,
- CosTrading::DuplicatePropertyName))
-{
- CosTrading::Register_var reg;
- CosTrading::OfferId offer_id = 0;
-
- TAO_TRY
- {
- reg = this->lookup_->register_if (TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- this->pprops_.length (this->pcount_);
- this->prop_set_->define_properties (this->pprops_, TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
-
-
- /***************** UTTER HACK: REMOVE WHEN EXCEPTIONS WORK! ****
- CosTrading::TypeRepository_ptr obj = this->lookup_->type_repos (_env);
-
- ACE_DEBUG ((LM_DEBUG, "Attempting add_type.\n"));
- CosTradingRepos::ServiceTypeRepository_var str =
-
- CosTradingRepos::ServiceTypeRepository::_narrow (obj, _env);
- TAO_CHECK_ENV_RETURN (_env, 0);
-
- str->add_type (type,
-
- object_ref->_interface_repository_id (),
- props,
- stypes,
-
- _env);
- TAO_CHECK_ENV_RETURN (_env, 0);
- ***************** UTTER HACK: REMOVE WHEN EXCEPTIONS WORK! ****/
-
-
- // Attempt to export the offer.
- ACE_DEBUG ((LM_DEBUG, "Attempting export.\n"));
- this->tprops_.length (this->tcount_);
- offer_id = reg->_cxx_export (object_ref,
- type,
- this->tprops_,
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
- }
- TAO_CATCH (CosTrading::UnknownServiceType, excp)
- {
-
-
- cout<<"Within the UnknownServiceType exception"<<endl;
- CosTrading::TypeRepository_ptr obj = this->lookup_->type_repos (TAO_IN_ENV);
- TAO_CHECK_ENV_RETURN (TAO_IN_ENV, 0);
-
- ACE_DEBUG ((LM_DEBUG, "Export failed. Attempting add_type.\n"));
- CosTradingRepos::ServiceTypeRepository_var str =
- CosTradingRepos::ServiceTypeRepository::_narrow (obj, TAO_IN_ENV);
- TAO_CHECK_ENV_RETURN (TAO_IN_ENV, 0);
-
- // If the ServiceTypeName wasn't found, we'll have to add the
- // type to the Service Type repository ourselves.
- str->add_type (type,
- object_ref->_interface_repository_id (),
- props,
- stypes,
- TAO_IN_ENV);
- TAO_CHECK_ENV_RETURN (TAO_IN_ENV, 0);
-
- // Now we'll try again to register the offer.
- ACE_DEBUG ((LM_DEBUG, "Attempting export again.\n"));
-
- this->tprops_.length (this->tcount_);
- offer_id = reg->_cxx_export (object_ref,
- type,
- this->tprops_,
- TAO_IN_ENV);
- TAO_CHECK_ENV_RETURN (TAO_IN_ENV, 0);
- cout<<"It reached here"<<endl;
-
- }
- /*
- TAO_CATCHANY
- {
- // Sigh, all our efforts were for naight.
- TAO_RETHROW_RETURN (0);
- }
- */
- TAO_ENDTRY;
-
- return offer_id;
-}
-
-// *************************************************************
-// TAO_Property_Modifier
-// *************************************************************
-
-TAO_Property_Modifier::
-TAO_Property_Modifier (CosTrading::Lookup_var lookup_if,
- CosPropertyService::PropertySet_ptr prop_set,
- CORBA::ULong initial_size)
- : increment_ (initial_size),
- lookup_ (lookup_if),
- prop_set_ (prop_set),
- pdelete_ (initial_size),
- pmodify_ (initial_size),
- tdelete_ (initial_size),
- tmodify_ (initial_size),
- pdcount_ (0),
- pmcount_ (0),
- tdcount_ (0),
- tmcount_ (0)
-{
-}
-
-void
-TAO_Property_Modifier::delete_property (const char* name)
-{
- CORBA::ULong plength = this->pdelete_.length (),
- tlength = this->tdelete_.length ();
-
- if (tlength == this->tdcount_)
- this->tdelete_.length (tlength + this->increment_);
-
- if (plength == this->pdcount_)
- this->pdelete_.length (plength + this->increment_);
-
- this->tdelete_[this->tdcount_] = name;
- this->tdcount_++;
-
- this->pdelete_[this->pdcount_] = name;
- this->pdcount_++;
-}
-
-void
-TAO_Property_Modifier::modify_property (const char* name, const CORBA::Any& value)
-{
- CORBA::ULong plength = this->pmodify_.length (),
- tlength = this->tmodify_.length ();
-
- if (tlength == this->tmcount_)
- this->tmodify_.length (tlength + this->increment_);
-
- if (plength == this->pmcount_)
- this->pmodify_.length (plength + this->increment_);
-
- this->tmodify_[this->tmcount_].name = name;
- this->tmodify_[this->tmcount_].value = value;
- this->tdcount_++;
-
- this->pmodify_[this->pmcount_].property_name = name;
- this->pmodify_[this->pmcount_].property_value = value;
- this->pdcount_++;
-}
-
-void
-TAO_Property_Modifier::commit (CosTrading::OfferId id,
- CORBA::Environment& TAO_IN_ENV)
- TAO_THROW_SPEC ((CORBA::SystemException,
- CosPropertyService::MultipleExceptions,
- CosTrading::NotImplemented,
- CosTrading::IllegalOfferId,
- CosTrading::UnknownOfferId,
- CosTrading::Register::ProxyOfferId,
- CosTrading::IllegalPropertyName,
- CosTrading::Register::UnknownPropertyName,
- CosTrading::PropertyTypeMismatch,
- CosTrading::ReadonlyDynamicProperty,
- CosTrading::Register::MandatoryProperty,
- CosTrading::Register::ReadonlyProperty,
- CosTrading::DuplicatePropertyName))
-{
- this->tdelete_.length (this->tdcount_);
- this->tmodify_.length (this->tmcount_);
- this->pdelete_.length (this->pdcount_);
- this->pmodify_.length (this->pmcount_);
-
- CosTrading::Register_var reg = this->lookup_->register_if (TAO_IN_ENV);
- TAO_CHECK_ENV_RETURN (TAO_IN_ENV,);
-
- reg->modify (id, this->tdelete_, this->tmodify_, TAO_IN_ENV);
- TAO_CHECK_ENV_RETURN (TAO_IN_ENV,);
-
- this->prop_set_->define_properties (this->pmodify_, TAO_IN_ENV);
- TAO_CHECK_ENV_RETURN (TAO_IN_ENV,);
-
- this->prop_set_->delete_properties (this->pdelete_, TAO_IN_ENV);
- TAO_CHECK_ENV_RETURN (TAO_IN_ENV,);
-}
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Property_Exporter.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Property_Exporter.h
deleted file mode 100644
index 273461d4bd5..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Property_Exporter.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/* -*- C++ -*- */
-
-// ========================================================================
-// $Id$
-//
-// = LIBRARY
-// TAO/orbsvcs/orbsvcs
-//
-// = FILENAME
-// Property_Exporter.h
-//
-// = DESCRIPTION
-// Allows a service to export properties to both a Property Set and
-// a Trading Service simulatenously.
-//
-// = AUTHORS
-// Seth Widoff <sbw1@cs.wustl.edu>
-//
-// ========================================================================
-
-#ifndef TAO_PROPERTY_EXPORTER_H
-#define TAO_PROPERTY_EXPORTER_H
-
-#include "orbsvcs/CosTradingC.h"
-#include "orbsvcs/CosPropertyServiceC.h"
-#include "orbsvcs/Trader/Trader_Utils.h"
-
-class TAO_Property_Exporter;
-
-class TAO_Exportable
-// = DESCRIPTION
-// Interface that allows property containers to export their
-// properties to a TAO_Property_Exporter instance.
-{
-public:
-
- virtual void
- export_properties (TAO_Property_Exporter& prop_exporter) {}
- // Insert exportable properties into the proper_exporter.
-
- virtual int define_properties
- (CosTradingRepos::ServiceTypeRepository::PropStructSeq& prop_seq,
- CORBA::ULong offset = 0) const = 0;
- // Append property definitions to the service type defintition
- // sequence. The <offset> is the point at which the method can begin
- // placing the PropStructures. define_properties returns the number
- // of properties inserted from the offset.
-};
-
-
-class TAO_Property_Exporter
-// = TITLE
-// Publish public properties of a servant to a
-// CosPropertyService::PropSet instance and a Trading Service
-// offer.
-//
-// Use this class in the following way:
-// 1. Instantiate.
-// 2. for (int i = 0; i < num_properties; i++) add_*_property ();
-// 3. export ()
-{
- public:
-
- TAO_Property_Exporter (CosTrading::Lookup_var lookup_if,
- CosPropertyService::PropertySet_ptr prop_set,
- CORBA::ULong initial_size = 10);
-
-
- ~TAO_Property_Exporter (void);
- // Delete all Dynamic Property adapters
-
- void add_static_property (const char* name,
- const CORBA::Any& value);
- // Add a property to the Offer and the PropSet.
-
- void add_dynamic_property (const char* name,
- const CORBA::Any& intial_value,
- TAO_Dynamic_Property& dp);
- // Add a property to the PropSet and a dynamic property to the
- // Offer. Have the dynamic property connect to the PropSet accessor
- // for that name.
-
- void add_dynamic_property (const char* name,
- CosTradingDynamic::DynamicProp& dp_struct);
-
- void add_dynamic_property (const char* name,
- CosTradingDynamic::DynamicProp* dp_struct);
-
- CosTrading::OfferId _cxx_export (const CORBA::Object_ptr object_ref,
- const CosTrading::ServiceTypeName type,
- CORBA::Environment& _env)
- TAO_THROW_SPEC ((CORBA::SystemException,
- CosPropertyService::MultipleExceptions,
- CosTrading::Register::InvalidObjectRef,
- CosTrading::IllegalServiceType,
- CosTrading::UnknownServiceType,
- CosTrading::Register::InterfaceTypeMismatch,
- CosTrading::IllegalPropertyName,
- CosTrading::PropertyTypeMismatch,
- CosTrading::ReadonlyDynamicProperty,
- CosTrading::MissingMandatoryProperty,
- CosTrading::DuplicatePropertyName));
- // Export the offer to the trader under the given type.
-
- typedef CosTradingRepos::ServiceTypeRepository TRADING_REPOS;
- CosTrading::OfferId _cxx_export (const CORBA::Object_ptr object_ref,
- const CosTrading::ServiceTypeName type,
- const TRADING_REPOS::PropStructSeq& props,
- const TRADING_REPOS::ServiceTypeNameSeq& stypes,
- CORBA::Environment& _env)
- TAO_THROW_SPEC ((CORBA::SystemException,
- CosPropertyService::MultipleExceptions,
- CosTrading::IllegalServiceType,
- TRADING_REPOS::ServiceTypeExists,
- TRADING_REPOS::InterfaceTypeMismatch,
- CosTrading::IllegalPropertyName,
- CosTrading::DuplicatePropertyName,
- TRADING_REPOS::ValueTypeRedefinition,
- TRADING_REPOS::DuplicateServiceTypeName,
- CosTrading::Register::InvalidObjectRef,
- CosTrading::Register::InterfaceTypeMismatch,
- CosTrading::ReadonlyDynamicProperty,
- CosTrading::MissingMandatoryProperty,
- CosTrading::DuplicatePropertyName));
- // Export the offer to the trader under the given type. Register the
- // type with the current definition if the type can't be found in
- // the service type repository.
-
-private:
-
- TAO_Property_Exporter (const TAO_Property_Exporter&);
- void operator= (const TAO_Property_Exporter&);
- // These don't make sense on this class.
-
- const int increment_;
-
- CosTrading::Lookup_var lookup_;
- CosPropertyService::PropertySet_var prop_set_;
-
- CORBA::ULong pcount_, tcount_;
- CosTrading::PropertySeq tprops_;
- CosPropertyService::Properties pprops_;
-};
-
-class TAO_Property_Modifier
-// = TITLE
-// Modify or delete properties published in a PropSet instance or as
-// an offer in a Trading Service instance.
-//
-// = DESCRIPTION
-// This interface is primarily for properties registered as static
-// with the trading service, yet periodically change. The change
-// isn't frequent enough to warrant the constant overhead of dynamic
-// properties, which can affect the server performance.
-{
-public:
-
- TAO_Property_Modifier (CosTrading::Lookup_var lookup_if,
- CosPropertyService::PropertySet_ptr prop_set,
- CORBA::ULong initial_size = 10);
-
- // If no Lookup Interface is provided to the constructor, then
- // resolve_initial_references ("TradingService") will be used.
-
- void delete_property (const char* name);
- // Remove a property from the current prop_set/offer.
-
- void modify_property (const char* name, const CORBA::Any& value);
- // Modify a property from the current prop_set/offer.
-
- void commit (CosTrading::OfferId id, CORBA::Environment& _env)
- TAO_THROW_SPEC ((CORBA::SystemException,
- CosPropertyService::MultipleExceptions,
- CosTrading::NotImplemented,
- CosTrading::IllegalOfferId,
- CosTrading::UnknownOfferId,
- CosTrading::Register::ProxyOfferId,
- CosTrading::IllegalPropertyName,
- CosTrading::Register::UnknownPropertyName,
- CosTrading::PropertyTypeMismatch,
- CosTrading::ReadonlyDynamicProperty,
- CosTrading::Register::MandatoryProperty,
- CosTrading::Register::ReadonlyProperty,
- CosTrading::DuplicatePropertyName));
- // Commit your changes to the trading service.
-
- private:
-
- const int increment_;
-
- int pdcount_;
- int pmcount_;
-
- int tdcount_;
- int tmcount_;
-
- CosTrading::Lookup_var lookup_;
- CosPropertyService::PropertySet_var prop_set_;
-
- CosPropertyService::PropertyNames pdelete_;
- CosPropertyService::Properties pmodify_;
-
- CosTrading::PropertyNameSeq tdelete_;
- CosTrading::PropertySeq tmodify_;
-
- TAO_Property_Modifier (const TAO_Property_Modifier&);
- void operator= (const TAO_Property_Modifier&);
- // These don't make sense on this class.
-};
-
-#endif /* TAO_PROPERTY_EXPORTER_H */
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.cpp
deleted file mode 100644
index 27db11ebe94..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-// $Id$
-
-#include "Video_Repository.h"
-#include "ace/Read_Buffer.h"
-
-ACE_RCSID(server, Video_Repository, "$Id$")
-
-
-const char* TAO_Video_Repository::MOVIE_INFO = "Movie_Info";
-
-TAO_Video_Repository::TAO_Video_Repository (const char* file_name)
- : filename_ (file_name),
- movie_info_ (0),
- num_movies_ (0),
- lastchanged_ (0)
-{
- cout<<"The movie file is "<<filename_<<endl;
-}
-
-TAO_Video_Repository::~TAO_Video_Repository (void)
-{
- TAO_VR::Movie_Info::freebuf (this->movie_info_);
-}
-
-CORBA::Any*
-TAO_Video_Repository::evalDP (const char* name,
- CORBA::TypeCode_ptr returned_type,
- const CORBA::Any& extra_info,
- CORBA::Environment& TAO_IN_ENV)
- TAO_THROW_SPEC ((CosTradingDynamic::DPEvalFailure))
-{
- ACE_DEBUG ((LM_DEBUG,"TAO_Video_Repository::evalDP:%s\n",name));
- CORBA::Any* return_value = 0;
- ACE_NEW_RETURN (return_value, CORBA::Any, 0);
-
- struct stat file_stat;
- if (ACE_OS::stat (this->filename_, &file_stat) == 0)
- {
- if (this->lastchanged_ < file_stat.st_mtime)
- {
- FILE* file = ACE_OS::fopen (this->filename_, "r");
-
- if (file != 0)
- {
- // Read the file into a buffer
- ACE_Read_Buffer read_file (file, 1);
- char* database = read_file.read (EOF, '\n', '%');
-
- // Parse the file into a sequence and insert it into an
- // Any (i.e., this->return_)
- TAO_Video_Repository::parse_file (database,
- read_file.replaced ());
-
- ACE_Allocator* alloc = ACE_Allocator::instance ();
- alloc->free (database);
-
- this->lastchanged_ = file_stat.st_mtime;
- }
- else cout<<"The movie_database.txt file does not exist"<<endl;
- }
-
- TAO_VR::Movie_Info* movie_info = 0;
- ACE_NEW_RETURN (movie_info,
- TAO_VR::Movie_Info (this->num_movies_,
- this->num_movies_,
- this->movie_info_,
- 0),
- 0);
-
- (*return_value) <<= movie_info;
- }
- else
- {
- ACE_DEBUG ((LM_DEBUG,"TAO_Video_Repository::evalDP::stat failed\n"));
- }
-
- return return_value;
-}
-
-void
-TAO_Video_Repository::parse_file (const char* database, int num_lines)
-{
- const char* delim = "%";
- CORBA::ULong i = 0;
- CORBA::Any* return_value = 0;
- char* current = (char *) database;
-
- ACE_DEBUG ((LM_DEBUG, "Recomputing the movie stats.\n"));
-
- TAO_VR::Movie_Info::freebuf (this->movie_info_);
-
- this->movie_info_ = TAO_VR::Movie_Info::allocbuf (num_lines);
-
- if (this->movie_info_ != 0)
- {
- current = ACE_OS::strtok (current, "%");
- while (current != 0)
- {
- TAO_VR::Movie& movie = this->movie_info_[i];
-
- movie.name_ = (const char*) current;
- movie.audio_filename_ = (const char*) ACE_OS::strtok (0, delim);
- movie.video_filename_ = (const char*) ACE_OS::strtok (0, delim);
- movie.description_ = (const char*) ACE_OS::strtok (0, delim);
-
- ACE_DEBUG ((LM_DEBUG,
- "Movie Name: %s\nFile Name: %s\nDescription: %s\n",
- (const char *) movie.name_,
- (const char *) movie.audio_filename_,
- (const char *) movie.video_filename_,
- (const char *) movie.description_));
-
- // From the actual movie file, extract the techincal information.
- TAO_Video_Repository::
- obtain_movie_info (movie.audio_filename_, movie);
-
- TAO_Video_Repository::
- obtain_movie_info (movie.video_filename_, movie);
-
-
- current = ACE_OS::strtok (0, delim);
- i++;
- }
- }
-
- this->num_movies_ = num_lines;
-}
-
-void
-TAO_Video_Repository::
-export_properties (TAO_Property_Exporter& prop_exporter)
-{
- CORBA::Any extra_info;
-
- extra_info <<= MOVIE_INFO;
- CosTradingDynamic::DynamicProp* dp_struct =
- this->construct_dynamic_prop (MOVIE_INFO,
- TAO_VR::_tc_Movie_Info,
- extra_info);
-
- prop_exporter.add_dynamic_property (MOVIE_INFO, dp_struct);
-}
-
-int
-TAO_Video_Repository::
-define_properties (CosTradingRepos::ServiceTypeRepository::PropStructSeq& prop_seq,
- CORBA::ULong offset) const
-{
- CORBA::ULong num_props = prop_seq.length ();
-
- if (num_props <= offset)
- prop_seq.length (offset + 1);
-
- prop_seq[offset].name = MOVIE_INFO;
- prop_seq[offset].value_type = CORBA::TypeCode::_duplicate (TAO_VR::_tc_Movie_Info);
- prop_seq[offset].mode = CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY;
-
- return 1;
-}
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.h
deleted file mode 100644
index 88dda6f6a5e..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- C++ -*- */
-
-// ============================================================================
-// $Id$
-//
-//
-// = FILENAME
-// Video_Repository.h
-//
-// = DESCRIPTION
-// As a trading service dynamic property, creates a sequence of
-// structures, each structure describing a movie in the video
-// repository.
-//
-// = AUTHORS
-// Seth Widoff <sbw1@cs.wustl.edu>
-//
-// ============================================================================
-
-#if (! defined TAO_VIDEO_REPOSITORY_H)
-#define TAO_VIDEO_REPOSITORY_H
-
-#include "orbsvcs/Trader/Trader_Utils.h"
-
-#include "ace/OS.h"
-
-#if !defined (ACE_LACKS_PRAGMA_ONCE)
-# pragma once
-#endif /* ACE_LACKS_PRAGMA_ONCE */
-
-#include "Video_RepositoryC.h"
-#include "Property_Exporter.h"
-
-class TAO_Video_Repository :
- public TAO_Dynamic_Property,
- public TAO_Exportable
-// = DESCRIPTION
-// When evalDP is invoked by the Dynamic Property Dispatcher, the
-// TAO_Video_Repository parses the database file and creates a Movie
-// Sequence, each structure of which describes a movie in the
-// database. The evalDP then crams the sequence into a dynamically
-// allocated Any, which it returns to the dispatcher.
-//
-// The format of the database file is the following:
-//
-// <file name>%<Movie Name>%<URL for description>
-{
-public:
-
- static const char* MOVIE_INFO;
-
- TAO_Video_Repository (const char* filename);
- // TAO_Video_Repository requires the pathname of the video
- // repository database.
-
- ~TAO_Video_Repository (void);
-
- virtual CORBA::Any* evalDP (const char* name,
- CORBA::TypeCode_ptr returned_type,
- const CORBA::Any& extra_info,
- CORBA::Environment& _env)
- TAO_THROW_SPEC ((CosTradingDynamic::DPEvalFailure));
-
- virtual void export_properties (TAO_Property_Exporter& prop_exporter);
-
- virtual int define_properties
- (CosTradingRepos::ServiceTypeRepository::PropStructSeq& prop_seq,
- CORBA::ULong offet = 0) const;
-
-private:
-
- void parse_file (const char* database, int num_lines);
-
- static void obtain_movie_info (const char* file_name,
- TAO_VR::Movie& movie) {}
- // Extract the techincal information from the actual MPEG file.
-
- TAO_Video_Repository (void) {}
- TAO_Video_Repository& operator= (const TAO_Video_Repository& rep)
- { return *this; }
- // TAO_Video_Repository requires the path of the video repository
- // database.
-
- const char* filename_;
- TAO_VR::Movie* movie_info_;
- int num_movies_;
- time_t lastchanged_;
-};
-
-#endif /* TAO_VIDEO_REPOSITORY_H */
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.idl b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.idl
deleted file mode 100644
index e7e93b2b7df..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.idl
+++ /dev/null
@@ -1,32 +0,0 @@
-// ============================================================================
-// $Id$
-//
-// = FILENAME
-// Video_Repository.idl
-//
-// = DESCRIPTION
-// Data Structures used by the Video_Repository to describe movies in
-// the Video Repository.
-//
-// = AUTHORS
-// Seth Widoff <sbw1@cs.wustl.edu>
-//
-// ============================================================================
-
-module TAO_VR
-{
- struct Movie
- {
- string name_;
- string audio_filename_;
- string video_filename_;
- string description_;
- // string movie_format_;
- // unsigned long filesize_;
- // unsigned long duration_;
- // unsigned long framerate_;
- // unsigned long framesize_;
- };
-
- typedef sequence<Movie> Movie_Info;
-};
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/as.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/as.cpp
deleted file mode 100644
index a50f5a09d64..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/as.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-// $Id$
-
-#include "mpeg_server/Audio_Server.h"
-#include "as.h"
-
-ACE_RCSID(server, as, "$Id$")
-
-int
-Audio_Child_Process::init (int argc,
- char **argv)
-{
- if (TAO_AV_Child_Process_B<Audio_Server_StreamEndPoint,TAO_VDev,Audio_Control_i>::init (argc,argv) == -1)
- return -1;
-
- int max_pkt_size = -INET_SOCKET_BUFFER_SIZE;
- AUDIO_GLOBAL::instance ()->serviceSocket = -1;
-
- AUDIO_GLOBAL::instance ()->conn_tag = max_pkt_size;
-
- if (max_pkt_size < 0)
- max_pkt_size = -max_pkt_size;
- else if (max_pkt_size == 0)
- max_pkt_size = 1024 * 1024;
-
- AUDIO_GLOBAL::instance ()->start_time =ACE_OS::time (NULL);
-
- AUDIO_GLOBAL::instance ()->fbpara = (AudioFeedBackPara *)ACE_OS::malloc(FBBUF_SIZE);
- if (AUDIO_GLOBAL::instance ()->fbpara == NULL) {
- ACE_OS::perror ("AS failed to allocate mem for fbpara");
- return (-1);
- }
-
- AUDIO_GLOBAL::instance ()->databuf_size = max_pkt_size - sizeof(AudioPacket);
- if (AUDIO_GLOBAL::instance ()->databuf_size > DATABUF_SIZE)
- AUDIO_GLOBAL::instance ()->databuf_size = DATABUF_SIZE;
-
- AUDIO_GLOBAL::instance ()->pktbuf = (AudioPacket *)ACE_OS::malloc(sizeof(AudioPacket) +
- AUDIO_GLOBAL::instance ()->databuf_size);
- if (AUDIO_GLOBAL::instance ()->pktbuf == NULL) {
- ACE_OS::perror ("AS failed to allocate mem for pktbuf");
- return(-1);
- }
-}
-
-int
-Audio_Child_Process::make_mediactrl (Audio_Control_i *& media_ctrl)
-{
- ACE_DEBUG ((LM_DEBUG,"(%P|%t) Audio_Child_Process::make_mediactrl ()\n"));
- media_ctrl = AUDIO_CONTROL_I::instance ();
- return 0;
-}
-
-
-int
-main (int argc,char **argv)
-{
- Audio_Child_Process audio_child;
-
-
- if (audio_child.init (argc,argv) == -1)
- return 1;
-// while (1)
-// {
- int result = audio_child.run () ;
-// if (errno == EINTR)
-// continue;
-// else
-// break;
-// }
- return 0;
-}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class TAO_AV_Child_Process<Audio_Server_StreamEndPoint, TAO_VDev, Audio_Control_i>;
-template class TAO_AV_Child_Process_B<Audio_Server_StreamEndPoint, TAO_VDev, Audio_Control_i>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate TAO_AV_Child_Process<Audio_Server_StreamEndPoint, TAO_VDev, Audio_Control_i>
-#pragma instantiate TAO_AV_Child_Process_B<Audio_Server_StreamEndPoint, TAO_VDev, Audio_Control_i>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/as.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/as.h
deleted file mode 100644
index 754917b3a75..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/as.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* $Id$ */
-
-// ============================================================================
-//
-// = LIBRARY
-// as
-//
-// = FILENAME
-// as.h
-//
-// = DESCRIPTION
-// @@ Please add a synopsis of this file.
-//
-// = AUTHORS
-// Sumedh Mungee (sumedh@cs.wustl.edu)
-// Nagarajan Surendran (naga@cs.wustl.edu)
-//
-// ============================================================================
-
-#ifndef TAO_AV_AS_H
-#define TAO_AV_AS_H
-
-#include "ace/Get_Opt.h"
-
-#if !defined (ACE_LACKS_PRAGMA_ONCE)
-# pragma once
-#endif /* ACE_LACKS_PRAGMA_ONCE */
-
-#include "ace/Acceptor.h"
-#include "ace/Svc_Handler.h"
-#include "ace/SOCK_Acceptor.h"
-#include "ace/INET_Addr.h"
-#include "ace/SOCK_CODgram.h"
-#include "ace/Select_Reactor.h"
-
-#include "include/common.h"
-#include "mpeg_server/server_proto.h"
-#include "mpeg_shared/fileio.h"
-#include "mpeg_shared/routine.h"
-#include "mpeg_shared/com.h"
-#include "mpeg_server/Audio_Control_i.h"
-#include "orbsvcs/orbsvcs/Naming/Naming_Utils.h"
-
-#include "mpeg_server/Audio_Server.h"
-#include "orbsvcs/AV/AVStreams_i.h"
-
-class Audio_Child_Process
- :public TAO_AV_Child_Process_B <Audio_Server_StreamEndPoint,TAO_VDev,Audio_Control_i>
-{
-public:
- int init (int argc,
- char **argv);
- // init the Video Singleton.
-
- int make_mediactrl (Audio_Control_i *&media_ctrl);
-};
-
-
-#endif /* TAO_AV_AS_H */
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/augmented_server.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/augmented_server.cpp
deleted file mode 100644
index 1d838c128ca..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/augmented_server.cpp
+++ /dev/null
@@ -1,731 +0,0 @@
-// $Id$
-
-#include "augmented_server.h"
-#include "ace/Process.h"
-
-ACE_RCSID(server, augmented_server, "$Id$")
-
-int AV_Server::done_;
-pid_t AV_Server::current_pid_ = -1;
-
-const char* MMDevice_Exporter_i::NUMBER_OF_CONNECTIONS = "Number_Of_Connections";
-const char* MMDevice_Exporter_i::MAX_CONNECTIONS = "Max_Connections";
-const char* MMDevice_Exporter_i::SERVER_NAME = "Server_Name";
-
-MMDevice_Exporter_i::MMDevice_Exporter_i ()
- : audio_mmdevice_ (0),
- video_mmdevice_ (0),
- connections_ (0),
- max_connections_ (10)
-{
-}
-
-CORBA::ULong
-MMDevice_Exporter_i::connections (void) const
-{
- return this->connections_;
-}
-
-// CORBA::Object_ptr
-// MMDevice_Exporter_i::
-// audio_mmdevice_reference_ (CORBA_Environment &TAO_IN_ENV)
-// {
-// return this->audio_mmdevice_;
-// }
-
-// CORBA::Object_ptr
-// MMDevice_Exporter_i::
-// video_mmdevice_reference_ (CORBA_Environment &TAO_IN_ENV)
-// {
-// return this->video_mmdevice_;
-// }
-
- CORBA::Object_ptr
-MMDevice_Exporter_i::get_audio_mmdevice (CORBA_Environment &TAO_IN_ENV)
-{
- return CORBA::Object::_duplicate (this->audio_mmdevice_);
-}
-
-CORBA::Object_ptr
-MMDevice_Exporter_i::get_video_mmdevice (CORBA_Environment &TAO_IN_ENV)
-{
- return CORBA::Object::_duplicate (this->video_mmdevice_);
-}
-
-void
-MMDevice_Exporter_i::
-export_properties (TAO_Property_Exporter& prop_exporter)
-{
- CORBA::Any connections, max_connections, server_name;
-
- connections <<= (CORBA::ULong) this->connections_;
- prop_exporter.add_static_property (NUMBER_OF_CONNECTIONS, connections);
-
- max_connections <<= (CORBA::ULong) this->max_connections_;
- prop_exporter.add_static_property (MAX_CONNECTIONS, max_connections);
-
- char* hostname = ACE_OS::getenv ("HOST");
- server_name <<= hostname;
- prop_exporter.add_static_property (SERVER_NAME, server_name);
-}
-
-int
-MMDevice_Exporter_i::
-define_properties (CosTradingRepos::ServiceTypeRepository::PropStructSeq& prop_seq,
- CORBA::ULong offset) const
-{
- CORBA::ULong num_props = prop_seq.length ();
-
- if (num_props <= offset + 2)
- prop_seq.length (offset + 3);
-
- prop_seq[offset].name = NUMBER_OF_CONNECTIONS;
- prop_seq[offset].value_type = CORBA::TypeCode::_duplicate (CORBA::_tc_ulong);
- prop_seq[offset].mode = CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY;
- prop_seq[offset + 1].name = MAX_CONNECTIONS;
- prop_seq[offset + 1].value_type = CORBA::TypeCode::_duplicate (CORBA::_tc_ulong);
- prop_seq[offset + 1].mode = CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY;
- prop_seq[offset + 2].name = SERVER_NAME;
- prop_seq[offset + 2].value_type = CORBA::TypeCode::_duplicate (CORBA::_tc_string);
- prop_seq[offset + 2].mode = CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY_READONLY;
-
- return 3;
-}
-
-AV_Audio_MMDevice::
-AV_Audio_MMDevice (TAO_AV_Endpoint_Process_Strategy *endpoint_strategy)
- :TAO_MMDevice (endpoint_strategy)
-
-{
-}
-
-AVStreams::StreamEndPoint_B_ptr
-AV_Audio_MMDevice::
-create_B (AVStreams::StreamCtrl_ptr the_requester,
- AVStreams::VDev_out the_vdev,
- AVStreams::streamQoS &the_qos,
- CORBA::Boolean_out met_qos,
- char *&named_vdev,
- const AVStreams::flowSpec &the_spec,
- CORBA::Environment &env)
-{
- ACE_DEBUG ((LM_DEBUG,"(%P|%t) Audio_MMDevice::create_B called \n"));
- AVStreams::StreamEndPoint_B_ptr stream_ptr;
- stream_ptr = TAO_MMDevice::create_B (the_requester,
- the_vdev,
- the_qos,
- met_qos,
- named_vdev,
- the_spec,
- env);
-
- /* NOT CLEAR ABOUT THIS
- if (stream_ptr != 0)
- this->connections_;
- */
- return stream_ptr;
-
-}
-
-
-AV_Video_MMDevice::
-AV_Video_MMDevice (TAO_AV_Endpoint_Process_Strategy *endpoint_strategy)
- :TAO_MMDevice (endpoint_strategy)
-
-{
-}
-
-AVStreams::StreamEndPoint_B_ptr
-AV_Video_MMDevice::
-create_B (AVStreams::StreamCtrl_ptr the_requester,
- AVStreams::VDev_out the_vdev,
- AVStreams::streamQoS &the_qos,
- CORBA::Boolean_out met_qos,
- char *&named_vdev,
- const AVStreams::flowSpec &the_spec,
- CORBA::Environment &env)
-{
- ACE_DEBUG ((LM_DEBUG,"(%P|%t) Video_MMDevice::create_B called \n"));
- AVStreams::StreamEndPoint_B_ptr stream_ptr;
- stream_ptr = TAO_MMDevice::create_B (the_requester,
- the_vdev,
- the_qos,
- met_qos,
- named_vdev,
- the_spec,
- env);
- /*NEED TO CHECK THIS
- if (stream_ptr != 0)
- this->connections_;
- */
- return stream_ptr;
-}
-
-
-// AV_Server_Sig_Handler routines
-AV_Server_Sig_Handler::AV_Server_Sig_Handler (const AV_Server& av_server)
- : av_server_ (av_server)
-{
-}
-
-int
-AV_Server_Sig_Handler::register_handler (void)
-{
- // Assign the Sig_Handler a dummy I/O descriptor. Note that even
- // though we open this file "Write Only" we still need to use the
- // ACE_Event_Handler::NULL_MASK when registering this with the
- // ACE_Reactor (see below).
- this->handle_ = ACE_OS::open (ACE_DEV_NULL, O_WRONLY);
- ACE_ASSERT (this->handle_ != -1);
- // ACE_DEBUG ((LM_DEBUG,"(%P|%t) sig_handler == %d\n",this->handle_));
-
- // Register signal handler object. Note that NULL_MASK is used to
- // keep the ACE_Reactor from calling us back on the "/dev/null"
- // descriptor.
-
- if (TAO_ORB_Core_instance ()->reactor ()->register_handler
- (this, ACE_Event_Handler::NULL_MASK) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "register_handler"),
- -1);
-
- // handles these signals.
- // this->sig_set.fill_set ();
- this->sig_set.sig_add (SIGCHLD);
- // this->sig_set.sig_add (SIGBUS);
- this->sig_set.sig_add (SIGINT);
- this->sig_set.sig_add (SIGTERM);
-
- // Register the signal handler object to catch the signals. if
- if (TAO_ORB_Core_instance ()->reactor ()->register_handler
- (this->sig_set, this) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "register_handler"),
- -1);
- return 0;
-}
-
-// Called by the ACE_Reactor to extract the fd.
-ACE_HANDLE
-AV_Server_Sig_Handler::get_handle (void) const
-{
- return this->handle_;
-}
-
-int
-AV_Server_Sig_Handler::handle_input (ACE_HANDLE)
-{
- ACE_DEBUG ((LM_DEBUG, "(%t) handling asynchonrous input...\n"));
- return 0;
-}
-
-int
-AV_Server_Sig_Handler::shutdown (ACE_HANDLE, ACE_Reactor_Mask)
-{
- ACE_DEBUG ((LM_DEBUG, "(%t) closing down Sig_Handler...\n"));
- return 0;
-}
-
-// This method handles all the signals that are being caught by this
-// object.
-
-int
-AV_Server_Sig_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *)
-{
- // ACE_DEBUG ((LM_DEBUG, "(%P|%t) received signal %S\n", signum));
-
- switch (signum)
- {
- case SIGCHLD:
- // Handle the death of child signal.
- this->clear_child (SIGCHLD);
- break;
- // case SIGBUS:
- // Handle the Bus error signal
- // exit (2);
- case SIGINT:
- // Handle the interrupt signal
- case SIGTERM:
- // Handle the process termination signal.
- this->int_handler (signum);
- break;
- default:
- // ACE_DEBUG ((LM_DEBUG, "(%P|%t) %S: not handled, returning to program\n", signum));
- break;
- }
- return 0;
-}
-
-// SIGCHLD handler
-void
-AV_Server_Sig_Handler::clear_child (int sig)
-{
- int pid;
- int status;
-
- // ACE_DEBUG ((LM_DEBUG,"(%P|%t) AV_Server: Reaping the children\n"));
- // reap the children
- while ((pid = ACE_OS::waitpid (-1,
- &status,
- WNOHANG)) > 0)
- {
- if (pid == AV_Server::current_pid_)
- {
- cerr << "The child currently being waited for has died\n";
- // ACE_DEBUG ((LM_DEBUG,"(%P|%t) The child currently being waited for has died.\n"));
- AV_Server::done_ = 1;
- }
-
- // decrement the count of number of active children
- Mpeg_Global::session_num --;
-
- if (status == 0)
- continue;
-
- // ACE_DEBUG ((LM_DEBUG, "(%P|%t) AV_Server: child %d (status %d)\n", pid, status));
- }
- return;
-}
-
-int
-AV_Server_Sig_Handler::remove_names (void)
-{
- TAO_TRY
- {
- /*
- CORBA::Object_var naming_obj = TAO_ORB_Core_instance ()->orb ()->resolve_initial_references ("NameService");
- if (CORBA::is_nil (naming_obj.in ()))
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%P|%t) Unable to resolve the Name Service.\n"),
- -1);
-
- CosNaming::NamingContext_var naming_context =
- CosNaming::NamingContext::_narrow (naming_obj.in (),
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- // Unregister the video_mmdevice with the naming service.
-
- CosNaming::Name video_server_mmdevice_name (1);
- video_server_mmdevice_name.length (1);
- video_server_mmdevice_name [0].id = CORBA::string_dup ("Video_Server_MMDevice");
-
- // Register the video control object with the naming server.
- naming_context->unbind (video_server_mmdevice_name,
- TAO_TRY_ENV);
- // Unregister the audio_mmdevice with the naming service.
-
- CosNaming::Name audio_server_mmdevice_name (1);
- audio_server_mmdevice_name.length (1);
- audio_server_mmdevice_name [0].id = CORBA::string_dup ("Audio_Server_MMDevice");
-
- // Register the audio control object with the naming server.
- naming_context->unbind (audio_server_mmdevice_name,
- TAO_TRY_ENV);
- */
- this->av_server_.shutdown ();
- }
- TAO_CATCHANY
- {
- TAO_TRY_ENV.print_exception ("AV_Server_Sig_Handler::remove_names ()");
- return -1;
- }
- TAO_ENDTRY;
- return 0;
-}
-
-// ctrl-c, Bus error, interrupt sig handler
-void
-AV_Server_Sig_Handler::int_handler (int sig)
-{
- // unbind the names from the naming service.
-
- this->remove_names ();
- TAO_ORB_Core_instance ()->orb ()->shutdown ();
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) AV server killed by signal %d\n",
- sig));
-}
-
-AV_Server_Sig_Handler::~AV_Server_Sig_Handler (void)
-{
- TAO_ORB_Core_instance ()->reactor ()->remove_handler (this->sig_set);
-}
-
-// AV_Server routines
-
-const char* AV_Server::MMDEVICE_SERVICE_TYPE = "MMDevice";
-
-
-// Default Constructor
-AV_Server::AV_Server (void)
- : video_rep_ ("movie_database.txt"),
- signal_handler_ (*this),
- video_process_strategy_ (&video_process_options_),
- audio_process_strategy_ (&audio_process_options_)
-{
- this->video_process_options_.command_line ("./vs -ORBobjrefstyle url");
- this->audio_process_options_.command_line ("./as -ORBobjrefstyle url");
-}
-
-// %% move to the destructor or sig handler
-void
-AV_Server::on_exit_routine (void)
-{
- // %% what does the following do
- if (Mpeg_Global::parentpid != ACE_OS::getpid ())
- {
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) Process is exiting\n"));
- return;
- }
-
- // %% what does the following do
- if (Mpeg_Global::live_audio > 1)
- ExitLiveAudio ();
- if (Mpeg_Global::live_video > 1)
- ExitLiveVideo ();
- // ComCloseServer();
-
- // Remove the elements from the Naming service.
-}
-
-
-// Parses the command line arguments
-int
-AV_Server::parse_args (int argc,
- char **argv)
-{
- ACE_Get_Opt get_opts (argc, argv, "rd:s:vamh");
- int c;
-
- while ((c = get_opts ()) != -1)
- switch (c)
- {
- case 'r': // real time flag
- Mpeg_Global::rttag = 1;
- break;
- case 'd': // clock drift in ppm
- Mpeg_Global::drift_ppm = ACE_OS::atoi (get_opts.optarg);
- break;
- case 's':// limit on number of sessions
- Mpeg_Global::session_limit = ACE_OS::atoi (get_opts.optarg);
- break;
- case 'v':// live video flag
- Mpeg_Global::live_video = 1;
- break;
- case 'a':// live audio flag
- Mpeg_Global::live_audio = 1;
- break;
- case '?':
- case 'h':// help flag
- ACE_DEBUG ((LM_DEBUG,
- "Usage: %s [-r ] [-m]\n"
- " [-d#int(clock drift in ppm)]\n"
- " [-s#int(limit on number of sessions)]\n"
- " [-v] [-a] [-?] [-h]",
- argv [0]));
- return -1;
- }
- return 0;
-}
-
-
-// Initializes the mpeg server
-int
-AV_Server::init (int argc,
- char **argv,
- CORBA::Environment& env)
-{
- int result;
-
- // Initialize the orb_manager
- this->orb_manager_.init_child_poa (argc,
- argv,
- "child_poa",
- env);
- TAO_CHECK_ENV_RETURN (env,
- -1);
-
- CORBA::ORB_var orb =
- this->orb_manager_.orb ();
-
- PortableServer::POA_var child_poa =
- this->orb_manager_.child_poa ();
-
- result = this->parse_args (argc, argv);
- if (result < 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%P|%t) Error parsing arguments"),
- -1);
-
- // Resolve the Naming service reference.
- /*
- CORBA::Object_var naming_obj = orb->resolve_initial_references ("NameService");
- if (CORBA::is_nil (naming_obj.in ()))
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%P|%t) Unable to resolve the Name Service.\n"),
- -1);
-
- this->naming_context_ =
- CosNaming::NamingContext::_narrow (naming_obj.in (),
- env);
- TAO_CHECK_ENV_RETURN (env,-1);
- */
-
-
- ACE_NEW_RETURN (this->video_mmdevice_,
- AV_Video_MMDevice (&this->video_process_strategy_),
- -1);
-
- // Register the video mmdevice object with the ORB
- this->orb_manager_.activate_under_child_poa ("Video_Server_MMDevice",
- this->video_mmdevice_,
- env);
- // CORBA::String_var server_ior = this->orb_manager_.orb ()->object_to_string (mmdevice_reference,
- // TAO_TRY_ENV);
- TAO_CHECK_ENV_RETURN (env,-1);
-
- /*
- // Register the video_mmdevice with the naming service.
- CosNaming::Name video_server_mmdevice_name (1);
- video_server_mmdevice_name.length (1);
- video_server_mmdevice_name [0].id = CORBA::string_dup ("Video_Server_MMDevice");
-
- // Register the video control object with the naming server.
- this->naming_context_->bind (video_server_mmdevice_name,
- this->video_mmdevice_->_this (env),
- env);
-
- if (env.exception () != 0)
- {
- env.clear ();
- this->naming_context_->rebind (video_server_mmdevice_name,
- this->video_mmdevice_->_this (env),
- env);
- TAO_CHECK_ENV_RETURN (env,-1);
- }
-
- */
-
- ACE_NEW_RETURN (this->audio_mmdevice_,
- AV_Audio_MMDevice (&this->audio_process_strategy_),
- -1);
-
- // Register the audio mmdevice object with the ORB
- this->orb_manager_.activate_under_child_poa ("Audio_Server_MMDevice",
- this->audio_mmdevice_,
- env);
- TAO_CHECK_ENV_RETURN (env,-1);
-
-
- CORBA::Object_ptr audio_object_ptr = this->audio_mmdevice_->_this (env);
- TAO_CHECK_ENV_RETURN (env,-1);
-
- CORBA::Object_ptr video_object_ptr = this->video_mmdevice_->_this (env);
- TAO_CHECK_ENV_RETURN (env,-1);
-
- ACE_NEW_RETURN (this->mmdevice_exporter_,
- MMDevice_Exporter_i (),
- -1);
-
- this->mmdevice_exporter_->audio_mmdevice_ = audio_object_ptr;
- this->mmdevice_exporter_->video_mmdevice_ = video_object_ptr;
-
- // Register the audio mmdevice object with the ORB
- this->orb_manager_.activate_under_child_poa ("MMDevice_Exporter",
- this->mmdevice_exporter_,
- env);
- TAO_CHECK_ENV_RETURN (env,-1);
- /*
- // Register the audio_mmdevice with the naming service.
-
- CosNaming::Name audio_server_mmdevice_name (1);
- audio_server_mmdevice_name.length (1);
- audio_server_mmdevice_name [0].id = CORBA::string_dup ("Audio_Server_MMDevice");
-
- // Register the audio control object with the naming server.
- this->naming_context_->bind (audio_server_mmdevice_name,
- this->audio_mmdevice_->_this (env),
- env);
-
- if (env.exception () != 0)
- {
- env.clear ();
- this->naming_context_->rebind (audio_server_mmdevice_name,
- this->audio_mmdevice_->_this (env),
- env);
- TAO_CHECK_ENV_RETURN (env,-1);
- }
-
- */
- // Invoke this once, passing in an object for each trading service
- // service type.
-
-
-
- if (this->resolve_trader (env) != -1)
- {
- // Invoke this for each offer.
- this->export_properties (env);
- TAO_CHECK_ENV_RETURN (env, -1);
- }
-
- // Register the various signal handlers with the reactor.
- result = this->signal_handler_.register_handler ();
-
- if (result < 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%P|%t) Error registering signal handler"),
- -1);
-
- ::atexit (on_exit_routine);
- return 0;
-}
-
-// Runs the mpeg server
-int
-AV_Server::run (CORBA::Environment& env){
- int result;
- // Run the ORB event loop
- this->orb_manager_.run (env);
-
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) AV_Server::run () "
- "came out of the (ORB) "
- "event loop %p\n",
- "run_event_loop"));
- return 0;
-
-}
-
-void
-AV_Server::export_properties (CORBA::Environment& TAO_IN_ENV)
-{
- CORBA::Object_ptr mmdevice_object_ptr = this->mmdevice_exporter_->_this (TAO_IN_ENV);
- TAO_CHECK_ENV_RETURN_VOID (TAO_IN_ENV);
-
- CosPropertyService::PropertySet_ptr mmdevice_prop_set =
- CosPropertyService::PropertySet::_narrow (mmdevice_object_ptr, TAO_IN_ENV);
- TAO_CHECK_ENV_RETURN_VOID (TAO_IN_ENV);
-
- // Instantiate the property exporter helper class.
- TAO_Property_Exporter mmdevice_prop_exporter (this->trader_, mmdevice_prop_set);
-
- // Add properties to server description.
- this->mmdevice_exporter_->export_properties (mmdevice_prop_exporter);
- this->mach_props_.export_properties (mmdevice_prop_exporter);
- this->video_rep_.export_properties (mmdevice_prop_exporter);
-
- CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq mmdevice_super_types;
- this->mmdevice_offer_id_ =
- mmdevice_prop_exporter._cxx_export (mmdevice_object_ptr,
- (CosTrading::ServiceTypeName) MMDEVICE_SERVICE_TYPE,
- this->prop_seq_,
- mmdevice_super_types,
- TAO_IN_ENV);
- TAO_CHECK_ENV_RETURN_VOID (TAO_IN_ENV);
-
-
-
-}
-
-int
-AV_Server::resolve_trader (CORBA::Environment& TAO_IN_ENV)
-{
- if (this->trader_.ptr () == 0)
- {
- // Bootstrap to the Lookup interface.
- ACE_DEBUG ((LM_ERROR, "Bootstrap to the Lookup interface.\n"));
- CORBA::Object_var trading_obj =
- this->orb_manager_.orb ()->resolve_initial_references ("TradingService");
-
- if (CORBA::is_nil (trading_obj.in ()))
- {
- ACE_ERROR ((LM_ERROR,
- " (%P|%t) Unable to bootstrap to the Trading Service.\n"));
- return -1;
- }
-
- // Narrow the lookup interface.
- ACE_DEBUG ((LM_DEBUG, "Narrowing the lookup interface.\n"));
- this->trader_ = CosTrading::Lookup::_narrow (trading_obj.in (), TAO_IN_ENV);
- TAO_CHECK_ENV_RETURN (TAO_IN_ENV, -1);
-
- // Add property definitions to the service type.
- CORBA::ULong offset = this->mmdevice_exporter_->define_properties (this->prop_seq_);
- // TAO_CHECK_ENV_RETURN (TAO_IN_ENV,-1);
- offset += this->mach_props_.define_properties (this->prop_seq_, offset);
- this->video_rep_.define_properties (this->prop_seq_, offset);
- }
- ACE_DEBUG ((LM_DEBUG,"Trader IOR: %s\n",
- this->orb_manager_.orb ()->object_to_string (this->trader_.in (),TAO_IN_ENV)));
-
-}
-
-AV_Server::~AV_Server (void)
-{
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) AV_Server: Removing handlers from the Reactor\n"));
-
- if (this->video_mmdevice_ != 0)
- delete this->video_mmdevice_;
- if (this->audio_mmdevice_ != 0)
- delete this->audio_mmdevice_;
-
-}
-
-void
-AV_Server::shutdown (void) const
-{
- TAO_TRY
- {
- if (this->trader_.ptr () != 0)
- {
- CosTrading::Register_var reg = this->trader_->register_if (TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- ACE_DEBUG ((LM_DEBUG, "Withdrawing offer...\n"));
- reg->withdraw (this->mmdevice_offer_id_.in (), TAO_TRY_ENV);
- TAO_CHECK_ENV;
- }
- }
- TAO_CATCHANY
- {
- ACE_DEBUG ((LM_DEBUG, "Failed to withdraw offer."));
- }
- TAO_ENDTRY;
-}
-
-int
-main (int argc, char **argv)
-{
- TAO_TRY
- {
- int return_value =
- AV_SERVER::instance ()->init (argc, argv, TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- if (return_value != -1)
- {
- AV_SERVER::instance ()->run (TAO_TRY_ENV);
- TAO_CHECK_ENV;
- }
- }
- TAO_CATCHANY
- {
- TAO_TRY_ENV.print_exception ("Exception");
- return -1;
- }
- TAO_ENDTRY;
-
- return 0;
-}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Singleton<AV_Server,ACE_Null_Mutex>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate ACE_Singleton<AV_Server,ACE_Null_Mutex>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/augmented_server.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/augmented_server.h
deleted file mode 100644
index 48062e494c4..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/augmented_server.h
+++ /dev/null
@@ -1,301 +0,0 @@
-/* -*- c++ -*- */
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// server
-//
-// = FILENAME
-// server.h
-//
-// = DESCRIPTION
-// This defines the Audio/Video Server using TAO'S Audio/Video streaming service.
-//
-// = AUTHORS
-// Sumedh Mungee (sumedh@cs.wustl.edu)
-// Nagarajan Surendran (naga@cs.wustl.edu)
-//
-// ============================================================================
-
-#ifndef TAO_AV_SERVER_H
-#define TAO_AV_SERVER_H
-
-#include "ace/Get_Opt.h"
-
-#if !defined (ACE_LACKS_PRAGMA_ONCE)
-# pragma once
-#endif /* ACE_LACKS_PRAGMA_ONCE */
-
-#include "ace/Acceptor.h"
-#include "ace/Svc_Handler.h"
-#include "ace/SOCK_Acceptor.h"
-#include "ace/INET_Addr.h"
-#include "ace/SOCK_CODgram.h"
-#include "ace/Select_Reactor.h"
-
-#include "include/common.h"
-#include "mpeg_server/server_proto.h"
-#include "mpeg_shared/fileio.h"
-#include "mpeg_shared/routine.h"
-#include "mpeg_shared/com.h"
-#include "mpeg_server/Video_Control_i.h"
-#include "orbsvcs/orbsvcs/Naming/Naming_Utils.h"
-
-#if defined (NATIVE_ATM)
-#include "atmcom.h"
-#endif /* NATIVE_ATM */
-
-#include "mpeg_server/Video_Server.h"
-#include "mpeg_server/Audio_Server.h"
-#include "orbsvcs/AV/AVStreams_i.h"
-#include "orbsvcs/AV/Endpoint_Strategy.h"
-#include "vs.h"
-
-#include "Property_Exporter.h"
-#include "Machine_Properties.h"
-#include "Video_Repository.h"
-
-#include "mpeg_shared/MMDevice_ExporterS.h"
-
-
-
-class AV_Audio_MMDevice
- : public TAO_MMDevice
-{
-public:
-
- static const char* NUMBER_OF_CONNECTIONS;
- static const char* MAX_CONNECTIONS;
- static const char* SERVER_NAME;
-
- AV_Audio_MMDevice (TAO_AV_Endpoint_Process_Strategy *endpoint_strategy);
- // Default constructor
-
- virtual AVStreams::StreamEndPoint_B_ptr
- create_B (AVStreams::StreamCtrl_ptr the_requester,
- AVStreams::VDev_out the_vdev,
- AVStreams::streamQoS &the_qos,
- CORBA::Boolean_out met_qos,
- char *&named_vdev,
- const AVStreams::flowSpec &the_spec,
- CORBA::Environment &env);
- // Called by StreamCtrl to create a "B" type streamandpoint and vdev
-
-
-};
-
-class AV_Video_MMDevice
- : public TAO_MMDevice//,
- // public TAO_Exportable
-{
-public:
-
- AV_Video_MMDevice (TAO_AV_Endpoint_Process_Strategy *endpoint_strategy);
- // Default constructor
-
- virtual AVStreams::StreamEndPoint_B_ptr
- create_B (AVStreams::StreamCtrl_ptr the_requester,
- AVStreams::VDev_out the_vdev,
- AVStreams::streamQoS &the_qos,
- CORBA::Boolean_out met_qos,
- char *&named_vdev,
- const AVStreams::flowSpec &the_spec,
- CORBA::Environment &env);
- // Called by StreamCtrl to create a "B" type streamandpoint and vdev
-
-
-};
-
-class MMDevice_Exporter_i
- : public POA_MMDevice_Exporter,
- public TAO_Exportable,
- public TAO_PropertySet
-{
-public:
- CORBA_Object_ptr audio_mmdevice_;
- CORBA_Object_ptr video_mmdevice_;
-
- static const char* NUMBER_OF_CONNECTIONS;
- static const char* MAX_CONNECTIONS;
- static const char* SERVER_NAME;
-
- MMDevice_Exporter_i();
-
- CORBA::ULong connections (void) const;
- // Retrieve the number of connections.
-
- // virtual CORBA::Object_ptr audio_mmdevice_reference_ (CORBA_Environment &_env = CORBA_Environment::default_environment ());
-
- // virtual CORBA::Object_ptr video_mmdevice_reference_ (CORBA_Environment &_env = CORBA_Environment::default_environment ());
-
- virtual CORBA::Object_ptr get_audio_mmdevice (CORBA_Environment &_env = CORBA_Environment::default_environment ());
- virtual CORBA::Object_ptr get_video_mmdevice (CORBA_Environment &_env = CORBA_Environment::default_environment ());
-
- virtual void export_properties (TAO_Property_Exporter& prop_exporter);
-
- virtual int define_properties (CosTradingRepos::ServiceTypeRepository::PropStructSeq& prop_seq,
- CORBA::ULong offset = 0) const;
-private:
-
- CORBA::ULong connections_;
- // Number of active connections
-
- CORBA::ULong max_connections_;
-
-};
-
-class AV_Server;
-
-class AV_Server_Sig_Handler
- : public virtual ACE_Event_Handler
-{
-public:
- AV_Server_Sig_Handler (const AV_Server& av_server);
-
- virtual ACE_HANDLE get_handle (void) const;
-
- int register_handler (void);
- // this will register this sig_handler
- // with the reactor for SIGCHLD,SIGTERM,SIGINT
-
- virtual int shutdown (ACE_HANDLE,
- ACE_Reactor_Mask);
-
- virtual int handle_input (ACE_HANDLE);
- // handle input on the dummy handle.
-
- virtual int handle_signal (ACE_HANDLE signum,
- siginfo_t * = 0,
- ucontext_t* = 0);
- // handles the SIGCHLD,SIGTERM,SIGINT for the parent process i.e
- // the main thread..
-
- void int_handler (int sig);
- // Signal handler function for SIGTERM,SIGBUS,SIGINT
-
- int remove_names (void);
- // Removes the audio server mmdevice and video server mmdevice from the naming service.
-
- void clear_child (int sig);
- // Signal handler function for SIGCHLD
-
- ~AV_Server_Sig_Handler (void);
- // Destructor
-
-private:
- const AV_Server& av_server_;
-
- ACE_HANDLE handle_;
- // dummy handle for the sig handler.
- ACE_Sig_Set sig_set;
-};
-
-class AV_Server
-{
- // = TITLE
- // Defines a class that abstracts the functionality of a
- // video and audio server.
- //
- // = DESCRIPTION
- // Using the class is as simple as calling init () first and then
- // run. It uses an acceptor with the default ACE_Reactor::instance ().
-public:
-
- static const char* MMDEVICE_SERVICE_TYPE;
-
- AV_Server (void);
- // constructor
-
- int init (int argc,
- char **argv,
- CORBA::Environment& env);
- // Initialize the AV_Server
-
- int run (CORBA::Environment& env);
- // Run the AV_Server
-
- void shutdown (void) const;
-
- static void on_exit_routine (void);
- // Routine called when this process exits.
-
- static pid_t current_pid_;
- // %% the pid the server is currently waiting on
-
- static int done_;
- // %% the done flag, set by the signal handler
-
- ~AV_Server (void);
- // Destructor
- //private:
-private:
- int parse_args (int argcs,
- char **argv);
- // Parse the arguments.
-
- void export_properties (CORBA::Environment& _env);
-
- int resolve_trader (CORBA::Environment& _env);
-
- TAO_ORB_Manager orb_manager_;
- // the TAO ORB manager.
-
- TAO_Machine_Properties mach_props_;
- // Dynamic properties concerning the server's performance.
-
- TAO_Video_Repository video_rep_;
- // Dynamic property that assesses the contents of the sever's video
- // repository.
-
- CosTrading::Lookup_var trader_;
- // Reference to the Lookup interface of the trading service.
-
- // CosTrading::OfferId_var audio_offer_id_;
- // Server offer id.
-
- CosTrading::OfferId_var mmdevice_offer_id_;
- // Server offer id.
-
- CosTradingRepos::ServiceTypeRepository::PropStructSeq prop_seq_;
- // Service type definition.
-
- CosNaming::NamingContext_var naming_context_;
- // The root naming context of the naming service
-
- AV_Server_Sig_Handler signal_handler_;
- // Signal handler for SIGCHLD,SIGINT,SIGTERM,SIGBUS
-
- ACE_INET_Addr server_control_addr_;
- // Control (TCP) Address of this server.
-
- ACE_Process_Options video_process_options_;
- // The process options for the process to be spawned by the process strategy
-
- TAO_AV_Endpoint_Process_Strategy_B video_process_strategy_;
- // The proces strategy for the video.
-
- // TAO_MMDevice *video_mmdevice_;
- // The video server multimedia device
-
- ACE_Process_Options audio_process_options_;
- // The process options for the process to be spawned by the process strategy
-
- TAO_AV_Endpoint_Process_Strategy_B audio_process_strategy_;
- // The proces strategy for the audio.
-
- // TAO_MMDevice *audio_mmdevice_;
- AV_Audio_MMDevice *audio_mmdevice_;
- // The audio server multimedia device
-
- AV_Video_MMDevice *video_mmdevice_;
- // The video server multimedia device
-
- MMDevice_Exporter_i *mmdevice_exporter_;
-};
-
-
-
-typedef ACE_Singleton<AV_Server,ACE_Null_Mutex> AV_SERVER;
-
-#endif /* TAO_AV_SERVER_H */
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/server.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/server.cpp
deleted file mode 100644
index a428f1164c8..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/server.cpp
+++ /dev/null
@@ -1,482 +0,0 @@
-// $Id$
-
-#include "server.h"
-#include "ace/Process.h"
-
-ACE_RCSID(server, server, "$Id$")
-
-int AV_Server::done_;
-pid_t AV_Server::current_pid_ = -1;
-
-
-Audio_MMDevice::Audio_MMDevice (TAO_AV_Endpoint_Process_Strategy *endpoint_strategy)
- :TAO_MMDevice (endpoint_strategy),
- connections_ (0)
-{
-}
-
-AVStreams::StreamEndPoint_B_ptr
-Audio_MMDevice::create_B (AVStreams::StreamCtrl_ptr the_requester,
- AVStreams::VDev_out the_vdev,
- AVStreams::streamQoS &the_qos,
- CORBA::Boolean_out met_qos,
- char *&named_vdev,
- const AVStreams::flowSpec &the_spec,
- CORBA::Environment &env)
-{
- ACE_DEBUG ((LM_DEBUG,"(%P|%t) Audio_MMDevice::create_B called \n"));
- AVStreams::StreamEndPoint_B_ptr stream_ptr;
- stream_ptr = TAO_MMDevice::create_B (the_requester,
- the_vdev,
- the_qos,
- met_qos,
- named_vdev,
- the_spec,
- env);
- if (stream_ptr != 0)
- this->connections_;
- return stream_ptr;
-}
-
-int
-Audio_MMDevice::connections (void)
-{
- return this->connections_;
-}
-
-// AV_Server_Sig_Handler routines
-
-AV_Server_Sig_Handler::AV_Server_Sig_Handler (void)
-{
-}
-
-int
-AV_Server_Sig_Handler::register_handler (void)
-{
- // Assign the Sig_Handler a dummy I/O descriptor. Note that even
- // though we open this file "Write Only" we still need to use the
- // ACE_Event_Handler::NULL_MASK when registering this with the
- // ACE_Reactor (see below).
- this->handle_ = ACE_OS::open (ACE_DEV_NULL, O_WRONLY);
- ACE_ASSERT (this->handle_ != -1);
- // ACE_DEBUG ((LM_DEBUG,"(%P|%t) sig_handler == %d\n",this->handle_));
-
- // Register signal handler object. Note that NULL_MASK is used to
- // keep the ACE_Reactor from calling us back on the "/dev/null"
- // descriptor.
-
- if (TAO_ORB_Core_instance ()->reactor ()->register_handler
- (this, ACE_Event_Handler::NULL_MASK) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "register_handler"),
- -1);
-
- // handles these signals.
- // this->sig_set.fill_set ();
- this->sig_set.sig_add (SIGCHLD);
- this->sig_set.sig_add (SIGBUS);
- this->sig_set.sig_add (SIGINT);
- this->sig_set.sig_add (SIGTERM);
-
- // Register the signal handler object to catch the signals. if
- if (TAO_ORB_Core_instance ()->reactor ()->register_handler
- (this->sig_set, this) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- "%p\n",
- "register_handler"),
- -1);
- return 0;
-}
-
-// Called by the ACE_Reactor to extract the fd.
-ACE_HANDLE
-AV_Server_Sig_Handler::get_handle (void) const
-{
- return this->handle_;
-}
-
-int
-AV_Server_Sig_Handler::handle_input (ACE_HANDLE)
-{
- ACE_DEBUG ((LM_DEBUG, "(%t) handling asynchonrous input...\n"));
- return 0;
-}
-
-int
-AV_Server_Sig_Handler::shutdown (ACE_HANDLE, ACE_Reactor_Mask)
-{
- ACE_DEBUG ((LM_DEBUG, "(%t) closing down Sig_Handler...\n"));
- return 0;
-}
-
-// This method handles all the signals that are being caught by this
-// object.
-
-int
-AV_Server_Sig_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *)
-{
- // ACE_DEBUG ((LM_DEBUG, "(%P|%t) received signal %S\n", signum));
-
- switch (signum)
- {
- case SIGCHLD:
- // Handle the death of child signal.
- this->clear_child (SIGCHLD);
- break;
- case SIGBUS:
- // Handle the Bus error signal
- case SIGINT:
- // Handle the interrupt signal
- case SIGTERM:
- // Handle the process termination signal.
- this->int_handler (signum);
- break;
- default:
- // ACE_DEBUG ((LM_DEBUG, "(%P|%t) %S: not handled, returning to program\n", signum));
- break;
- }
- return 0;
-}
-
-// SIGCHLD handler
-void
-AV_Server_Sig_Handler::clear_child (int sig)
-{
- int pid;
- int status;
-
- // ACE_DEBUG ((LM_DEBUG,"(%P|%t) AV_Server: Reaping the children\n"));
- // reap the children
- while ((pid = ACE_OS::waitpid (-1,
- &status,
- WNOHANG)) > 0)
- {
- if (pid == AV_Server::current_pid_)
- {
- cerr << "The child currently being waited for has died\n";
- // ACE_DEBUG ((LM_DEBUG,"(%P|%t) The child currently being waited for has died.\n"));
- AV_Server::done_ = 1;
- }
-
- // decrement the count of number of active children
- Mpeg_Global::session_num --;
-
- if (status == 0)
- continue;
-
- // ACE_DEBUG ((LM_DEBUG, "(%P|%t) AV_Server: child %d (status %d)\n", pid, status));
- }
- return;
-}
-
-int
-AV_Server_Sig_Handler::remove_names (void)
-{
- TAO_TRY
- {
- CORBA::Object_var naming_obj =
- TAO_ORB_Core_instance ()->orb ()->resolve_initial_references ("NameService");
- if (CORBA::is_nil (naming_obj.in ()))
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%P|%t) Unable to resolve the Name Service.\n"),
- -1);
-
- CosNaming::NamingContext_var naming_context =
- CosNaming::NamingContext::_narrow (naming_obj.in (),
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- // Unregister the video_mmdevice with the naming service.
-
- CosNaming::Name video_server_mmdevice_name (1);
- video_server_mmdevice_name.length (1);
- video_server_mmdevice_name [0].id = CORBA::string_dup ("Video_Server_MMDevice");
-
- // Register the video control object with the naming server.
- naming_context->unbind (video_server_mmdevice_name,
- TAO_TRY_ENV);
- // Unregister the audio_mmdevice with the naming service.
-
- CosNaming::Name audio_server_mmdevice_name (1);
- audio_server_mmdevice_name.length (1);
- audio_server_mmdevice_name [0].id = CORBA::string_dup ("Audio_Server_MMDevice");
-
- // Register the audio control object with the naming server.
- naming_context->unbind (audio_server_mmdevice_name,
- TAO_TRY_ENV);
-
- }
- TAO_CATCHANY
- {
- TAO_TRY_ENV.print_exception ("AV_Server_Sig_Handler::remove_names ()");
- return -1;
- }
- TAO_ENDTRY;
- return 0;
-}
-
-// ctrl-c, Bus error, interrupt sig handler
-void
-AV_Server_Sig_Handler::int_handler (int sig)
-{
- // unbind the names from the naming service.
-
- this->remove_names ();
- TAO_ORB_Core_instance ()->orb ()->shutdown ();
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) AV server killed by signal %d\n",
- sig));
-}
-
-AV_Server_Sig_Handler::~AV_Server_Sig_Handler (void)
-{
- // TAO_ORB_Core_instance ()->reactor ()->remove_handler (this->sig_set);
-}
-
-// AV_Server routines
-
-// Default Constructor
-AV_Server::AV_Server (void)
- :video_process_strategy_ (&video_process_options_),
- audio_process_strategy_ (&audio_process_options_)
-{
- this->video_process_options_.command_line ("./vs -ORBobjrefstyle url");
- this->audio_process_options_.command_line ("./as -ORBobjrefstyle url");
-}
-
-// %% move to the destructor or sig handler
-void
-AV_Server::on_exit_routine (void)
-{
- // %% what does the following do
- if (Mpeg_Global::parentpid != ACE_OS::getpid ())
- {
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) Process is exiting\n"));
- return;
- }
-
- // %% what does the following do
- if (Mpeg_Global::live_audio > 1)
- ExitLiveAudio ();
- if (Mpeg_Global::live_video > 1)
- ExitLiveVideo ();
- // ComCloseServer();
-
- // Remove the elements from the Naming service.
-}
-
-
-// Parses the command line arguments
-int
-AV_Server::parse_args (int argc,
- char **argv)
-{
- ACE_Get_Opt get_opts (argc, argv, "rd:s:vamh");
- int c;
-
- while ((c = get_opts ()) != -1)
- switch (c)
- {
- case 'r': // real time flag
- Mpeg_Global::rttag = 1;
- break;
- case 'd': // clock drift in ppm
- Mpeg_Global::drift_ppm = ACE_OS::atoi (get_opts.optarg);
- break;
- case 's':// limit on number of sessions
- Mpeg_Global::session_limit = ACE_OS::atoi (get_opts.optarg);
- break;
- case 'v':// live video flag
- Mpeg_Global::live_video = 1;
- break;
- case 'a':// live audio flag
- Mpeg_Global::live_audio = 1;
- break;
- case '?':
- case 'h':// help flag
- ACE_DEBUG ((LM_DEBUG,
- "Usage: %s [-r ] [-m]\n"
- " [-d#int(clock drift in ppm)]\n"
- " [-s#int(limit on number of sessions)]\n"
- " [-v] [-a] [-?] [-h]",
- argv [0]));
- return -1;
- }
- return 0;
-}
-
-
-// Initializes the mpeg server
-int
-AV_Server::init (int argc,
- char **argv,
- CORBA::Environment& env)
-{
- int result;
-
- // Initialize the orb_manager
- this->orb_manager_.init_child_poa (argc,
- argv,
- "child_poa",
- env);
- TAO_CHECK_ENV_RETURN (env,
- -1);
-
- CORBA::ORB_var orb =
- this->orb_manager_.orb ();
-
- PortableServer::POA_var child_poa =
- this->orb_manager_.child_poa ();
-
- result = this->parse_args (argc, argv);
- if (result < 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%P|%t) Error parsing arguments"),
- -1);
-
- // Initialize the naming services
- if (my_name_client_.init (this->orb_manager_.orb ()) != 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%P|%t) Unable to initialize "
- "the TAO_Naming_Client. \n"),
- -1);
-
- // Register the video mmdevice object with the ORB
- ACE_NEW_RETURN (this->video_mmdevice_,
- TAO_MMDevice (&this->video_process_strategy_),
- -1);
-
- // create the video server mmdevice with the naming service pointer.
- CORBA::String_var video_mmdevice_ior = this->orb_manager_.activate_under_child_poa ("Video_Server_MMDevice",
- this->video_mmdevice_,
- env);
- ACE_DEBUG ((LM_DEBUG,"(%P|%t) video_mmdevice_ior is :%s\n",video_mmdevice_ior.in ()));
-
- TAO_CHECK_ENV_RETURN (env,-1);
-
- // Register the video_mmdevice with the naming service.
- CosNaming::Name video_server_mmdevice_name (1);
- video_server_mmdevice_name.length (1);
- video_server_mmdevice_name [0].id = CORBA::string_dup ("Video_Server_MMDevice");
-
- // Register the video control object with the naming server.
- this->my_name_client_->bind (video_server_mmdevice_name,
- this->video_mmdevice_->_this (env),
- env);
-
- if (env.exception () != 0)
- {
- env.clear ();
- this->my_name_client_->rebind (video_server_mmdevice_name,
- this->video_mmdevice_->_this (env),
- env);
- TAO_CHECK_ENV_RETURN (env,-1);
- }
-
-
- // Register the audio mmdevice object with the ORB
- ACE_NEW_RETURN (this->audio_mmdevice_,
- Audio_MMDevice (&this->audio_process_strategy_),
- -1);
-
- // create the audio server mmdevice with the naming service pointer.
- CORBA::String_var audio_mmdevice_ior = this->orb_manager_.activate_under_child_poa ("Audio_Server_MMDevice",
- this->audio_mmdevice_,
- env);
- ACE_DEBUG ((LM_DEBUG,"Audio MMDevice ior is: %s\n",audio_mmdevice_ior.in ()));
- TAO_CHECK_ENV_RETURN (env,-1);
-
- // Register the audio_mmdevice with the naming service.
-
- CosNaming::Name audio_server_mmdevice_name (1);
- audio_server_mmdevice_name.length (1);
- audio_server_mmdevice_name [0].id = CORBA::string_dup ("Audio_Server_MMDevice");
-
- // Register the audio control object with the naming server.
- this->my_name_client_->bind (audio_server_mmdevice_name,
- this->audio_mmdevice_->_this (env),
- env);
-
- if (env.exception () != 0)
- {
- env.clear ();
- this->my_name_client_->rebind (audio_server_mmdevice_name,
- this->audio_mmdevice_->_this (env),
- env);
- TAO_CHECK_ENV_RETURN (env,-1);
- }
-
-
-
- // Register the various signal handlers with the reactor.
- result = this->signal_handler_.register_handler ();
-
- if (result < 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%P|%t) Error registering signal handler"),
- -1);
-
- ::atexit (on_exit_routine);
- return 0;
-}
-
-// Runs the mpeg server
-int
-AV_Server::run (CORBA::Environment& env){
- int result;
- // Run the ORB event loop
-// while (1)
-// {
- this->orb_manager_.run (env);
-// if (errno == EINTR)
-// continue;
-// else
-// break;
-// }
-
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) AV_Server::run () "
- "came out of the (ORB) "
- "event loop %p\n",
- "run_event_loop"));
- return 0;
-
-}
-
-AV_Server::~AV_Server (void)
-{
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) AV_Server: Removing handlers from the Reactor\n"));
- delete this->video_mmdevice_;
- delete this->audio_mmdevice_;
-}
-
-int
-main (int argc, char **argv)
-{
- TAO_TRY
- {
- if (AV_SERVER::instance ()->init (argc, argv, TAO_TRY_ENV) == -1)
- return 1;
- TAO_CHECK_ENV;
- AV_SERVER::instance ()->run (TAO_TRY_ENV);
- TAO_CHECK_ENV;
- }
- TAO_CATCHANY
- {
- TAO_TRY_ENV.print_exception ("Exception");
- return -1;
- }
- TAO_ENDTRY;
-
- return 0;
-}
-
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class ACE_Singleton<AV_Server,ACE_Null_Mutex>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate ACE_Singleton<AV_Server,ACE_Null_Mutex>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/server.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/server.h
deleted file mode 100644
index e263670efaa..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/server.h
+++ /dev/null
@@ -1,196 +0,0 @@
-/* -*- c++ -*- */
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// server
-//
-// = FILENAME
-// server.h
-//
-// = DESCRIPTION
-// This defines the Audio/Video Server using TAO'S Audio/Video streaming service.
-//
-// = AUTHORS
-// Sumedh Mungee (sumedh@cs.wustl.edu)
-// Nagarajan Surendran (naga@cs.wustl.edu)
-//
-// ============================================================================
-
-#ifndef TAO_AV_SERVER_H
-#define TAO_AV_SERVER_H
-
-#include "ace/Get_Opt.h"
-
-#if !defined (ACE_LACKS_PRAGMA_ONCE)
-# pragma once
-#endif /* ACE_LACKS_PRAGMA_ONCE */
-
-#include "ace/Acceptor.h"
-#include "ace/Svc_Handler.h"
-#include "ace/SOCK_Acceptor.h"
-#include "ace/INET_Addr.h"
-#include "ace/SOCK_CODgram.h"
-#include "ace/Select_Reactor.h"
-
-#include "include/common.h"
-#include "mpeg_server/server_proto.h"
-#include "mpeg_shared/fileio.h"
-#include "mpeg_shared/routine.h"
-#include "mpeg_shared/com.h"
-#include "mpeg_server/Video_Control_i.h"
-#include "orbsvcs/Naming/Naming_Utils.h"
-
-#if defined (NATIVE_ATM)
-#include "atmcom.h"
-#endif /* NATIVE_ATM */
-
-#include "mpeg_server/Video_Server.h"
-#include "mpeg_server/Audio_Server.h"
-#include "orbsvcs/AV/AVStreams_i.h"
-#include "orbsvcs/AV/Endpoint_Strategy.h"
-#include "vs.h"
-
-class Audio_MMDevice
- :public TAO_MMDevice
-{
-public:
- Audio_MMDevice (TAO_AV_Endpoint_Process_Strategy *endpoint_strategy_);
- // Default constructor
-
- virtual AVStreams::StreamEndPoint_B_ptr create_B (AVStreams::StreamCtrl_ptr the_requester,
- AVStreams::VDev_out the_vdev,
- AVStreams::streamQoS &the_qos,
- CORBA::Boolean_out met_qos,
- char *&named_vdev,
- const AVStreams::flowSpec &the_spec,
- CORBA::Environment &env);
- // Called by StreamCtrl to create a "B" type streamandpoint and vdev
-
- int connections (void);
-private:
- int connections_;
- // Number of active connections
-};
-
-class AV_Server_Sig_Handler
- : public virtual ACE_Event_Handler
-{
-public:
- AV_Server_Sig_Handler (void);
-
- virtual ACE_HANDLE get_handle (void) const;
-
- int register_handler (void);
- // this will register this sig_handler
- // with the reactor for SIGCHLD,SIGTERM,SIGINT
-
- virtual int shutdown (ACE_HANDLE,
- ACE_Reactor_Mask);
-
- virtual int handle_input (ACE_HANDLE);
- // handle input on the dummy handle.
-
- virtual int handle_signal (ACE_HANDLE signum,
- siginfo_t * = 0,
- ucontext_t* = 0);
- // handles the SIGCHLD,SIGTERM,SIGINT for the parent process i.e
- // the main thread..
-
- void int_handler (int sig);
- // Signal handler function for SIGTERM,SIGBUS,SIGINT
-
- int remove_names (void);
- // Removes the audio server mmdevice and video server mmdevice from the naming service.
-
- void clear_child (int sig);
- // Signal handler function for SIGCHLD
-
- ~AV_Server_Sig_Handler (void);
- // Destructor
-
-private:
- ACE_HANDLE handle_;
- // dummy handle for the sig handler.
- ACE_Sig_Set sig_set;
-
- TAO_Naming_Client my_name_client_;
- // Name_Client used for unregistering the audio and video
-
-};
-
-class AV_Server
-{
- // = TITLE
- // Defines a class that abstracts the functionality of a
- // video and audio server.
- //
- // = DESCRIPTION
- // Using the class is as simple as calling init () first and then
- // run. It uses an acceptor with the default ACE_Reactor::instance ().
-public:
- AV_Server (void);
- // constructor
-
- int init (int argc,
- char **argv,
- CORBA::Environment& env);
- // Initialize the AV_Server
-
- int run (CORBA::Environment& env);
- // Run the AV_Server
-
- static void on_exit_routine (void);
- // Routine called when this process exits.
-
- static pid_t current_pid_;
- // %% the pid the server is currently waiting on
-
- static int done_;
- // %% the done flag, set by the signal handler
-
- ~AV_Server (void);
- // Destructor
- //private:
-private:
- int parse_args (int argcs,
- char **argv);
- // Parse the arguments.
-
- TAO_ORB_Manager orb_manager_;
- // the TAO ORB manager.
-
- TAO_Naming_Client my_name_client_;
- // Name_Server used to bind audio and video controls
-
- AV_Server_Sig_Handler signal_handler_;
- // Signal handler for SIGCHLD,SIGINT,SIGTERM,SIGBUS
-
- ACE_INET_Addr server_control_addr_;
- // Control (TCP) Address of this server.
-
- ACE_Process_Options video_process_options_;
- // The process options for the process to be spawned by the process strategy
-
- TAO_AV_Endpoint_Process_Strategy_B video_process_strategy_;
- // The proces strategy for the video.
-
- TAO_MMDevice *video_mmdevice_;
- // The video server multimedia device
-
- ACE_Process_Options audio_process_options_;
- // The process options for the process to be spawned by the process strategy
-
- TAO_AV_Endpoint_Process_Strategy_B audio_process_strategy_;
- // The proces strategy for the audio.
-
- // TAO_MMDevice *audio_mmdevice_;
- Audio_MMDevice *audio_mmdevice_;
- // The audio server multimedia device
-
-};
-
-typedef ACE_Singleton<AV_Server,ACE_Null_Mutex> AV_SERVER;
-
-#endif /* TAO_AV_SERVER_H */
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/svc.conf b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/svc.conf
deleted file mode 100644
index 10de97f7b43..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/svc.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-# $Id$
-#
-static Resource_Factory "-ORBResources global"
-static Client_Strategy_Factory ""
-###static Server_Strategy_Factory "-ORBConcurrency reactive -ORBSystemidPolicyDemuxStrategy dynamic -ORBTableSize 128"
-static Server_Strategy_Factory "-ORBConcurrency reactive -ORBSystemidPolicyDemuxStrategy dynamic -ORBTableSize 128"
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vcrs.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vcrs.cpp
deleted file mode 100644
index c9f12cc847f..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vcrs.cpp
+++ /dev/null
@@ -1,264 +0,0 @@
-/* $Id$ */
-
-/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology
- * P.O.Box 91000-1000, Portland, OR 97291, USA;
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of O.G.I. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. O.G.I. makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Shanwei Cen
- * Department of Computer Science and Engineering
- * email: scen@cse.ogi.edu
- */
-#include <sys/types.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-#include <errno.h>
-#include <signal.h>
-#include <sys/wait.h>
-#include <time.h>
-#include <sys/time.h>
-#include "../include/common.h"
-#include "../mpeg_shared/com.h"
-#include "../mpeg_shared/routine.h"
-#include "../mpeg_server/proto.h"
-
-ACE_RCSID(server, vcrs, "$Id$")
-
-#define SESSION_NUM 4
-
-static int parentpid = -1;
-
-static int listenSocketIn = -1;
-static int listenSocketUn = -1;
-
-static struct linger linger = {1,1};
-
-static int live_audio = 0, live_video = 0; /* 0 - no, 1 - to open, 2 - opened */
-
-int drift_ppm = 0; /* clock drift in ppm */
-
-int session_limit = SESSION_NUM;
-int session_num = 0;
-
-static void int_handler(int sig)
-{
- /*
- fprintf(stderr, "process %d killed by sig %d\n",ACE_OS::getpid (), sig);
- */
- ACE_OS::exit (0);
-}
-
-static void on_exit_routine(void)
-{
- if (parentpid !=ACE_OS::getpid ()) {
- /*
- fprintf(stderr, "process %d exiting...\n",ACE_OS::getpid ());
- */
- return;
- }
- /*
- fprintf(stderr, "deamon exiting . . .\n");
- */
- if (live_audio > 1) ExitLiveAudio();
- if (live_video > 1) ExitLiveVideo();
- ComCloseServer();
-}
-
-static void clear_child(int sig)
-{
- int pid;
- int status;
-
- while ((pid = ACE_OS::waitpid (-1, &status, WNOHANG)) > 0)
- {
- session_num --;
-
- if (status == 0) {
- continue;
- }
- fprintf(stderr, "VCRS: child %d (status %d) ", pid, status);
- if (WIFEXITED(status)) {
- fprintf(stderr, "exited with status %d\n", WEXITSTATUS(status));
- }
- else if (WIFSIGNALED(status)) {
-#if defined(_HPUX_SOURCE) || defined(__svr4__) || defined(IRIX)
- fprintf(stderr, "terminated at signal %d%s.\n", WTERMSIG(status),
- WCOREDUMP(status) ? ", core dumped" : "");
-#else
- fprintf(stderr, "terminated at signal %d.\n", WTERMSIG(status));
-#endif
- }
- else if (WIFSTOPPED(status)) {
- fprintf(stderr, "stopped at signal %d\n", WSTOPSIG(status));
- }
-
- }
-}
-
-main(int argc, char *argv[])
-{
- int i, rttag = 0;
- int addrlen;
-
- for (i = 1; i < argc; i++) {
- if (!strcmp(argv[i], "-rt")) {
- rttag = 1;
- }
- else if (!strcmp(argv[i], "-nrt")) {
- rttag = 0;
- }
- else if (!strncmp(argv[i], "-d", 2)) {
- sscanf(&argv[i][2], "%d", &drift_ppm);
- }
- else if (!strncmp(argv[i], "-s", 2)) {
- sscanf(&argv[i][2], "%d", &session_limit);
- if (session_limit < 1)
- session_limit = SESSION_NUM;
- }
- else if (!strcmp(argv[i], "-lv")) {
- live_video = 1;
- }
- else if (!strcmp(argv[i], "-la")) {
- live_audio = 1;
- }
- else if (!strcmp(argv[i], "-rm")) {
- ACE_OS::unlink (VCR_UNIX_PORT);
- }
- else if (!strncmp(argv[i], "-he", 3)) {
- fprintf(stderr, "Usage: %s [-rt] [-nrt] [-rm]\n", argv[0]);
- fprintf(stderr, " [-d#int(clock drift in ppm)]\n");
- fprintf(stderr, " [-s#int(limit on number of sessions)]\n");
- ACE_OS::exit (1);
- }
- }
- if (drift_ppm) {
- fprintf(stderr, "Clock set to drift at %d ppm (positive is faster and neg. slower)\n",
- drift_ppm);
- }
-
- setsignal(SIGCHLD, clear_child);
- setsignal(SIGPIPE, SIG_IGN);
- setsignal(SIGBUS, int_handler);
- setsignal(SIGINT, int_handler);
- setsignal(SIGTERM, int_handler);
- setsignal(SIGALRM, SIG_IGN);
-
- parentpid =ACE_OS::getpid ();
-
- atexit(on_exit_routine);
-
- if (live_audio) {
- if (InitLiveAudio(argc, argv) == -1)
- live_audio = 0;
- else
- live_audio = 2;
- }
-
- if (live_video) {
- if (InitLiveVideo(argc, argv) == -1)
- live_video = 0;
- else
- live_video = 2;
- }
-
- ComInitServer(VCR_TCP_PORT, VCR_UNIX_PORT, VCR_ATM_PORT);
-
- /*
- setpgrp();
- */
- {
- char buf[100];
- sprintf(buf, "%s%s", LOG_DIR, "vcrsSession.log");
- if (freopen(buf, "a", stdout) == NULL) {
- freopen("/dev/null", "w", stdout);
- }
- }
-
- for (;;)
- {
- int val;
- unsigned char cmd;
- int serverpid = -1;
- int cfd, dfd;
- int max_pkt_size;
-
- if (ComGetConnPair(&cfd, &dfd, &max_pkt_size) == -1) continue;
-
- if ((serverpid = ACE_OS::fork ()) == -1)
- {
- ACE_OS::perror ("VCRS error on creating service process");
- ACE_OS::exit (1);
- }
- session_num ++;
- if (serverpid > 0) /* parent process for forking servers */
- {
- ComCloseFd(cfd);
- ComCloseFd(dfd);
- continue;
- }
- else
- {
- if (session_num > session_limit) {
- time_t t;
- char *buf;
- t =ACE_OS::time (NULL);
- buf = ACE_OS::ctime (&t);
- buf[strlen(buf) - 1] = 0;
- fprintf(stderr, "VCRS: %s, session_limit %d, session_number %d\n",
- buf, session_limit, session_num);
- }
-
- if ((val = ACE_OS::read (cfd, &cmd, 1)) < 0)
- {
- ACE_OS::perror ("VCRS fails to read command from service socket");
- ACE_OS::exit (1);
- }
- if (val == 0) {
- fprintf(stderr, "Remote client has closed connection.\n");
- ComCloseConn(cfd);
- ComCloseConn(dfd);
- /* continue; -- I don't know why I wrote this line? scen 5-12-96 */
- exit(0);
- }
- ComCloseListen();
- if (cmd == CmdINITvideo)
- {
- /*
- fprintf(stderr, "Server forked a VideoServer process.\n");
- */
- if (live_audio) LeaveLiveAudio();
- VideoServer(cfd, dfd, rttag, max_pkt_size);
- fprintf(stderr, "Weird: video server returned.\n");
- }
- else
- {
- /*
- fprintf(stderr, "Server forked a AudioServer process.\n");
- */
- if (live_video) LeaveLiveVideo();
- AudioServer(cfd, dfd, rttag, max_pkt_size);
- fprintf(stderr, "Weird: audio server returned.\n");
- }
- ACE_OS::exit (1);
- }
- }
-}
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vs.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vs.cpp
deleted file mode 100644
index 90c0ba39c9b..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vs.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-// $Id$
-
-#include "mpeg_server/Video_Server.h"
-#include "vs.h"
-
-ACE_RCSID(server, vs, "$Id$")
-
-int
-Video_Child_Process::init (int argc,
- char **argv)
-{
- if (TAO_AV_Child_Process_B<Video_Server_StreamEndPoint,TAO_VDev,Video_Control_i>::init (argc,argv) == -1)
- return -1;
-
- int max_pkt_size = -INET_SOCKET_BUFFER_SIZE;
- VIDEO_SINGLETON::instance ()->serviceSocket = -1;
-
- VIDEO_SINGLETON::instance ()->conn_tag = max_pkt_size;
-
- if (max_pkt_size > 0)
- VIDEO_SINGLETON::instance ()->msgsize
- = max_pkt_size;
- else
- if (max_pkt_size < 0)
- VIDEO_SINGLETON::instance ()->msgsize
- = - max_pkt_size;
- else
- VIDEO_SINGLETON::instance ()->msgsize
- = 1024 * 1024;
- /*
- SFprintf(stderr, "VS VIDEO_SINGLETON::instance ()->msgsize = %d\n", VIDEO_SINGLETON::instance ()->msgsize);
- */
- VIDEO_SINGLETON::instance ()->msgsize -= sizeof(VideoMessage);
-
- VIDEO_SINGLETON::instance ()->start_time =ACE_OS::time (NULL);
-
- VIDEO_SINGLETON::instance ()->lastRef [0]
- = VIDEO_SINGLETON::instance ()->lastRef[1]
- = -1;
-
- VIDEO_SINGLETON::instance ()->lastRefPtr = 0;
-
-
-}
-int
-Video_Child_Process::make_mediactrl (Video_Control_i *& media_ctrl)
-{
- ACE_DEBUG ((LM_DEBUG,"(%P|%t) Video_Child_Process::make_mediactrl ()\n"));
- media_ctrl = VIDEO_CONTROL_I::instance ();
- return 0;
-}
-
-int
-main (int argc, char **argv)
-{
- Video_Child_Process video_child;
-
- if (video_child.init (argc,argv) == -1)
- return 1;
-// while (1)
-// {
- video_child.run ();
-// if (errno == EINTR)
-// continue;
-// else
-// break;
-// }
-
- return 0;
-}
-
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
-template class TAO_AV_Child_Process<Video_Server_StreamEndPoint, TAO_VDev, Video_Control_i>;
-template class TAO_AV_Child_Process_B<Video_Server_StreamEndPoint, TAO_VDev, Video_Control_i>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-#pragma instantiate TAO_AV_Child_Process<Video_Server_StreamEndPoint, TAO_VDev, Video_Control_i>
-#pragma instantiate TAO_AV_Child_Process_B<Video_Server_StreamEndPoint, TAO_VDev, Video_Control_i>
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vs.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vs.h
deleted file mode 100644
index a8dc2a63f55..00000000000
--- a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vs.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- c++ -*- */
-/* $Id$ */
-
-// ============================================================================
-//
-// = LIBRARY
-// vs
-//
-// = FILENAME
-// vs.h
-//
-// = DESCRIPTION
-// @@ Please add a synopsis of this file.
-//
-// = AUTHORS
-// Sumedh Mungee (sumedh@cs.wustl.edu)
-// Nagarajan Surendran (naga@cs.wustl.edu)
-//
-// ============================================================================
-
-#ifndef TAO_AV_VS_H
-#define TAO_AV_VS_H
-
-#include "ace/Get_Opt.h"
-
-#if !defined (ACE_LACKS_PRAGMA_ONCE)
-# pragma once
-#endif /* ACE_LACKS_PRAGMA_ONCE */
-
-#include "ace/Acceptor.h"
-#include "ace/Svc_Handler.h"
-#include "ace/SOCK_Acceptor.h"
-#include "ace/INET_Addr.h"
-#include "ace/SOCK_CODgram.h"
-#include "ace/Select_Reactor.h"
-
-#include "include/common.h"
-#include "mpeg_server/server_proto.h"
-#include "mpeg_shared/fileio.h"
-#include "mpeg_shared/routine.h"
-#include "mpeg_shared/com.h"
-#include "mpeg_server/Video_Control_i.h"
-#include "orbsvcs/orbsvcs/Naming/Naming_Utils.h"
-
-#include "mpeg_server/Video_Server.h"
-#include "orbsvcs/AV/AVStreams_i.h"
-
-class Video_Child_Process
- :public TAO_AV_Child_Process_B <Video_Server_StreamEndPoint,TAO_VDev,Video_Control_i>
-{
-public:
- int init (int argc,
- char **argv);
- // init the Video Singleton.
-
- int make_mediactrl (Video_Control_i *&media_ctrl);
-};
-
-
-#endif /* TAO_AV_VS_H */