summaryrefslogtreecommitdiff
path: root/TAO/tests/Big_Request_Muxing
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:21 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2006-07-24 15:50:21 +0000
commit3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (patch)
tree197c810e5f5bce17b1233a7cb8d7b50c0bcd25e2 /TAO/tests/Big_Request_Muxing
parent6b846cf03c0bcbd8c276cb0af61a181e5f98eaae (diff)
downloadATCD-3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c.tar.gz
Repo restructuring
Diffstat (limited to 'TAO/tests/Big_Request_Muxing')
-rw-r--r--TAO/tests/Big_Request_Muxing/.cvsignore2
-rw-r--r--TAO/tests/Big_Request_Muxing/Big_Request_Muxing.mpc18
-rw-r--r--TAO/tests/Big_Request_Muxing/Client_Task.cpp134
-rw-r--r--TAO/tests/Big_Request_Muxing/Client_Task.h67
-rw-r--r--TAO/tests/Big_Request_Muxing/Payload_Receiver.cpp43
-rw-r--r--TAO/tests/Big_Request_Muxing/Payload_Receiver.h38
-rw-r--r--TAO/tests/Big_Request_Muxing/README24
-rw-r--r--TAO/tests/Big_Request_Muxing/Test.idl19
-rw-r--r--TAO/tests/Big_Request_Muxing/client.cpp143
-rwxr-xr-xTAO/tests/Big_Request_Muxing/run_test.pl61
-rw-r--r--TAO/tests/Big_Request_Muxing/server.cpp176
-rw-r--r--TAO/tests/Big_Request_Muxing/svc.conf4
-rw-r--r--TAO/tests/Big_Request_Muxing/svc.conf.xml8
13 files changed, 737 insertions, 0 deletions
diff --git a/TAO/tests/Big_Request_Muxing/.cvsignore b/TAO/tests/Big_Request_Muxing/.cvsignore
new file mode 100644
index 00000000000..f2ad85300eb
--- /dev/null
+++ b/TAO/tests/Big_Request_Muxing/.cvsignore
@@ -0,0 +1,2 @@
+client
+server
diff --git a/TAO/tests/Big_Request_Muxing/Big_Request_Muxing.mpc b/TAO/tests/Big_Request_Muxing/Big_Request_Muxing.mpc
new file mode 100644
index 00000000000..5d5b10de0c1
--- /dev/null
+++ b/TAO/tests/Big_Request_Muxing/Big_Request_Muxing.mpc
@@ -0,0 +1,18 @@
+// -*- MPC -*-
+// $Id$
+
+project(*Server): taoserver, messaging {
+ Source_Files {
+ Payload_Receiver.cpp
+ server.cpp
+ }
+}
+
+project(*Client): taoclient, messaging {
+ after += *Server
+ Source_Files {
+ TestC.cpp
+ Client_Task.cpp
+ client.cpp
+ }
+}
diff --git a/TAO/tests/Big_Request_Muxing/Client_Task.cpp b/TAO/tests/Big_Request_Muxing/Client_Task.cpp
new file mode 100644
index 00000000000..385bf7f0bc5
--- /dev/null
+++ b/TAO/tests/Big_Request_Muxing/Client_Task.cpp
@@ -0,0 +1,134 @@
+//
+// $Id$
+//
+
+#include "Client_Task.h"
+#include "tao/AnyTypeCode/Any.h"
+
+ACE_RCSID(Big_Request_Muxing, Client_Task, "$Id$")
+
+Client_Task::Client_Task (ACE_Thread_Manager *thr_mgr,
+ Test::Payload_Receiver_ptr payload_receiver,
+ CORBA::Long event_count,
+ CORBA::ULong event_size,
+ CORBA::ORB_ptr orb,
+ Messaging::SyncScope sync_scope,
+ const ACE_CString & ident)
+ : ACE_Task_Base (thr_mgr)
+ , payload_receiver_ (Test::Payload_Receiver::_duplicate (payload_receiver))
+ , event_count_ (event_count)
+ , event_size_ (event_size)
+ , orb_ (CORBA::ORB::_duplicate (orb))
+ , sync_scope_ (sync_scope)
+ , done_(false)
+ , id_ (ident)
+{
+}
+
+bool
+Client_Task::done(void) const
+{
+ return done_;
+}
+
+void
+Client_Task::do_invocations(Test::Payload& payload ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG((LM_DEBUG, "(%P|%t)Client_Task %s sending %d payloads.\n",
+ this->id_.c_str(), this->event_count_));
+
+ for (int i = 0; i != this->event_count_; ++i)
+ {
+ this->payload_receiver_->more_data (payload ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+}
+
+void
+Client_Task::do_sync_none_invocations(Test::Payload& payload ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_DEBUG((LM_DEBUG, "(%P|%t)Client_Task %s sending %d SYNC_NONE payloads.\n",
+ this->id_.c_str(), this->event_count_));
+
+ for (int i = 0; i != this->event_count_; ++i)
+ {
+ this->payload_receiver_->sync_none_more_data (payload ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+}
+
+int
+Client_Task::svc (void)
+{
+ ACE_DEBUG ((LM_DEBUG,"(%P|%t) Client_Task %s started\n",this->id_.c_str()));
+ Test::Payload payload (this->event_size_);
+ payload.length (this->event_size_);
+
+ for (CORBA::ULong j = 0; j != payload.length (); ++j)
+ payload[j] = (j % 256);
+
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ this->validate_connection (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var object =
+ this->orb_->resolve_initial_references ("PolicyCurrent"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ CORBA::PolicyCurrent_var policy_current =
+ CORBA::PolicyCurrent::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any scope_as_any;
+ scope_as_any <<= this->sync_scope_;
+
+
+ CORBA::PolicyList policy_list (1);
+ policy_list.length (1);
+ policy_list[0] =
+ this->orb_->create_policy (Messaging::SYNC_SCOPE_POLICY_TYPE,
+ scope_as_any
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ policy_current->set_policy_overrides (policy_list,
+ CORBA::ADD_OVERRIDE
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (this->sync_scope_ == Messaging::SYNC_NONE)
+ this->do_sync_none_invocations(payload ACE_ENV_SINGLE_ARG_PARAMETER);
+ else
+ this->do_invocations(payload ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_DEBUG((LM_DEBUG, "(%P|%t)Client_Task %s: ",
+ this->id_.c_str()));
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "");
+ done_ = true;
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_DEBUG((LM_DEBUG, "(%P|%t)Client_Task %s finished.\n", this->id_.c_str()));
+ done_ = true;
+ return 0;
+}
+
+void
+Client_Task::validate_connection (ACE_ENV_SINGLE_ARG_DECL)
+{
+ ACE_TRY
+ {
+ Test::Payload payload(0);
+ for (int i = 0; i != 100; ++i)
+ {
+ (void) this->payload_receiver_->more_data (payload ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY {} ACE_ENDTRY;
+}
diff --git a/TAO/tests/Big_Request_Muxing/Client_Task.h b/TAO/tests/Big_Request_Muxing/Client_Task.h
new file mode 100644
index 00000000000..81c8358c4a2
--- /dev/null
+++ b/TAO/tests/Big_Request_Muxing/Client_Task.h
@@ -0,0 +1,67 @@
+//
+// $Id$
+//
+
+#ifndef BIG_REQUEST_MUXING_CLIENT_TASK_H
+#define BIG_REQUEST_MUXING_CLIENT_TASK_H
+#include /**/ "ace/pre.h"
+
+#include "TestC.h"
+#include "tao/Messaging/Messaging.h"
+#include "ace/Task.h"
+#include "ace/SString.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+/// Implement a Task to run the experiments using multiple threads.
+class Client_Task : public ACE_Task_Base
+{
+public:
+ /// Constructor
+ Client_Task (ACE_Thread_Manager *thr_mgr,
+ Test::Payload_Receiver_ptr receiver,
+ CORBA::Long event_count,
+ CORBA::ULong event_size,
+ CORBA::ORB_ptr orb,
+ Messaging::SyncScope sync_scope,
+ const ACE_CString& ident);
+
+ /// Thread entry point
+ int svc (void);
+
+ bool done(void) const;
+
+private:
+ /// Make sure that all threads have connections available to
+ /// workaround bug 189
+ void validate_connection (ACE_ENV_SINGLE_ARG_DECL);
+
+ void do_invocations(Test::Payload& payload ACE_ENV_SINGLE_ARG_DECL);
+ void do_sync_none_invocations(Test::Payload& payload ACE_ENV_SINGLE_ARG_DECL);
+
+private:
+ /// Reference to the test interface
+ Test::Payload_Receiver_var payload_receiver_;
+
+ /// Total number of events
+ CORBA::Long event_count_;
+
+ /// Size of each message
+ CORBA::ULong event_size_;
+
+ /// Keep a reference to the ORB, used to initialize the SyncScope
+ /// policy
+ CORBA::ORB_var orb_;
+
+ /// The SyncScope used in this Task
+ Messaging::SyncScope sync_scope_;
+
+ bool done_;
+
+ ACE_CString id_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* BIG_REQUEST_MUXING_CLIENT_TASK_H */
diff --git a/TAO/tests/Big_Request_Muxing/Payload_Receiver.cpp b/TAO/tests/Big_Request_Muxing/Payload_Receiver.cpp
new file mode 100644
index 00000000000..e3203f20359
--- /dev/null
+++ b/TAO/tests/Big_Request_Muxing/Payload_Receiver.cpp
@@ -0,0 +1,43 @@
+//
+// $Id$
+//
+#include "Payload_Receiver.h"
+
+ACE_RCSID(Big_Request_Muxing, Payload_Receiver, "$Id$")
+
+Payload_Receiver::Payload_Receiver ()
+ : message_count_ (0),
+ sync_none_message_count_ (0)
+{
+}
+
+void
+Payload_Receiver::more_data (const Test::Payload& payload
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (payload.length() > 0)
+ {
+ ++this->message_count_;
+ }
+}
+
+void
+Payload_Receiver::sync_none_more_data (const Test::Payload& payload
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (payload.length() > 0)
+ {
+ ++this->sync_none_message_count_;
+ }
+}
+
+int
+Payload_Receiver::count(bool sync_none) const
+{
+ if (sync_none)
+ return sync_none_message_count_.value ();
+ else
+ return message_count_.value ();
+}
diff --git a/TAO/tests/Big_Request_Muxing/Payload_Receiver.h b/TAO/tests/Big_Request_Muxing/Payload_Receiver.h
new file mode 100644
index 00000000000..130ebba266e
--- /dev/null
+++ b/TAO/tests/Big_Request_Muxing/Payload_Receiver.h
@@ -0,0 +1,38 @@
+//
+// $Id$
+//
+
+#ifndef BIG_REQUEST_MUXING_PAYLOAD_RECEIVER_H
+#define BIG_REQUEST_MUXING_PAYLOAD_RECEIVER_H
+#include /**/ "ace/pre.h"
+
+#include "TestS.h"
+
+/// Implement the Test::Payload_Receiver interface
+/**
+ * Simply print count how many bytes were received.
+ */
+class Payload_Receiver
+ : public virtual POA_Test::Payload_Receiver
+{
+public:
+ Payload_Receiver ();
+
+ // = The skeleton methods
+ virtual void more_data (const Test::Payload &payload
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void sync_none_more_data (const Test::Payload &payload
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ int count(bool sync_none = false) const;
+
+private:
+ ACE_Atomic_Op<TAO_SYNCH_MUTEX, int> message_count_;
+ ACE_Atomic_Op<TAO_SYNCH_MUTEX, int> sync_none_message_count_;
+};
+
+#include /**/ "ace/post.h"
+#endif /* BIG_REQUEST_MUXING_PAYLOAD_RECEIVER_H */
diff --git a/TAO/tests/Big_Request_Muxing/README b/TAO/tests/Big_Request_Muxing/README
new file mode 100644
index 00000000000..227c7d2ce71
--- /dev/null
+++ b/TAO/tests/Big_Request_Muxing/README
@@ -0,0 +1,24 @@
+/**
+
+@page Big_Request_Muxing Test README File
+
+ This is a stress test for the non-blocking I/O features in the
+ORB when used to send oneways and reliable oneways. A client process
+creates multiple threads, each thread sends (large) oneway requests
+with different levels of reliability. The main thread runs the ORB
+event loop. The thread also configures connection muxing in the ORB,
+forcing all the threads to share the same connection. This level of
+concurrency is designed to test as many code sequences in the ORB
+output data as possible.
+
+ This is part of the regression testsuite for:
+
+http://ace.cs.wustl.edu/bugzilla/show_bug.cgi?id=132
+
+ To run the test use the run_test.pl script:
+
+$ ./run_test.pl
+
+ the script returns 0 if the test was successful.
+
+*/
diff --git a/TAO/tests/Big_Request_Muxing/Test.idl b/TAO/tests/Big_Request_Muxing/Test.idl
new file mode 100644
index 00000000000..21068d3d9e4
--- /dev/null
+++ b/TAO/tests/Big_Request_Muxing/Test.idl
@@ -0,0 +1,19 @@
+//
+// $Id$
+//
+
+module Test
+{
+ typedef sequence<octet> Payload;
+
+ interface Payload_Receiver
+ {
+ /// Send the data using a twoway operat
+ oneway void more_data (in Payload the_payload);
+
+ /// operation used with SYNC_NONE clients. This is separated to avoid
+ /// error reporting due to dropped messages. Drops are allowed in the
+ /// sync_none case.
+ oneway void sync_none_more_data (in Payload the_payload);
+ };
+};
diff --git a/TAO/tests/Big_Request_Muxing/client.cpp b/TAO/tests/Big_Request_Muxing/client.cpp
new file mode 100644
index 00000000000..321eed0bd4a
--- /dev/null
+++ b/TAO/tests/Big_Request_Muxing/client.cpp
@@ -0,0 +1,143 @@
+// $Id$
+
+#include "Client_Task.h"
+#include "ace/Get_Opt.h"
+#include "tao/Messaging/Messaging.h"
+
+ACE_RCSID(Muxing, client, "$Id$")
+
+const char *ior = "file://test.ior";
+
+// 3 clients with 2 threads each send this many messages.
+// so the server should expect NUM_MSGS * 6 total.
+static const int NUM_MSGS = 100;
+static const int NUM_THRDS = 2;
+static const int MSG_SIZE = 4096;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DEBUG ((LM_DEBUG, "(%P) Starting client\n"));
+
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var tmp =
+ orb->string_to_object(ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Test::Payload_Receiver_var payload_receiver =
+ Test::Payload_Receiver::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (payload_receiver.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Nil coordinator reference <%s>\n",
+ ior),
+ 1);
+ }
+
+ Client_Task task0 (ACE_Thread_Manager::instance (),
+ payload_receiver.in (),
+ NUM_MSGS,
+ MSG_SIZE,
+ orb.in (),
+ Messaging::SYNC_WITH_TARGET,
+ ACE_CString("Sync_With_Target"));
+ Client_Task task1 (ACE_Thread_Manager::instance (),
+ payload_receiver.in (),
+ NUM_MSGS,
+ MSG_SIZE,
+ orb.in (),
+ Messaging::SYNC_WITH_TRANSPORT,
+ ACE_CString("Sync_With_Transport"));
+ Client_Task task2 (ACE_Thread_Manager::instance (),
+ payload_receiver.in (),
+ NUM_MSGS,
+ MSG_SIZE,
+ orb.in (),
+ Messaging::SYNC_NONE,
+ ACE_CString("Sync_None"));
+
+ ACE_DEBUG ((LM_DEBUG, "(%P) Activating threads in client\n"));
+ if (task0.activate (THR_NEW_LWP | THR_JOINABLE, NUM_THRDS, 1) == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "Error activating client task\n"));
+ }
+ if (task1.activate (THR_NEW_LWP | THR_JOINABLE, NUM_THRDS, 1) == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "Error activating client task\n"));
+ }
+ if (task2.activate (THR_NEW_LWP | THR_JOINABLE, NUM_THRDS, 1) == -1)
+ {
+ ACE_ERROR ((LM_ERROR, "Error activating client task\n"));
+ }
+
+ ACE_Time_Value end_time = ACE_OS::gettimeofday() + ACE_Time_Value(10);
+ while (ACE_OS::gettimeofday() < end_time)
+ {
+ ACE_Time_Value tv (0, 100 * 1000);
+ orb->run (tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ if (task0.done() && task1.done() && task2.done())
+ break;
+ }
+
+ ACE_Thread_Manager::instance ()->wait ();
+ ACE_DEBUG ((LM_DEBUG, "(%P) Threads finished\n"));
+
+ while (orb->work_pending())
+ {
+ ACE_Time_Value tv(0, 100 * 1000);
+ orb->run(tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P) Ending client\n"));
+
+ return 0;
+}
diff --git a/TAO/tests/Big_Request_Muxing/run_test.pl b/TAO/tests/Big_Request_Muxing/run_test.pl
new file mode 100755
index 00000000000..f0985f7c959
--- /dev/null
+++ b/TAO/tests/Big_Request_Muxing/run_test.pl
@@ -0,0 +1,61 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../bin';
+use PerlACE::Run_Test;
+
+$iorfile = PerlACE::LocalFile ("server.ior");
+
+if (PerlACE::is_vxworks_test()) {
+ $SV = new PerlACE::ProcessVX ("server", "-o server.ior -e 800 -n 400");
+}
+else {
+ $SV = new PerlACE::Process ("server", "-o $iorfile -e 800 -n 400");
+}
+$CL1 = new PerlACE::Process ("client", " -k file://$iorfile");
+$CL2 = new PerlACE::Process ("client", " -k file://$iorfile");
+
+for ($n = 0; $n < 10; ++$n) {
+ print "=================================================================\n";
+ print "test run $n\n";
+ unlink $iorfile;
+
+ $SV->Spawn ();
+ if (PerlACE::waitforfile_timed ($iorfile, 10) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill ();
+ exit 1;
+ }
+
+ $CL1->Spawn();
+ $CL2->Spawn();
+
+ $client1 = $CL1->WaitKill (30);
+ if ($client1 != 0) {
+ print STDERR "ERROR: client 1 returned $client1\n";
+ $CL2->Kill();
+ $SV->Kill();
+ exit 1;
+ }
+
+ $client2 = $CL2->WaitKill (30);
+ if ($client2 != 0) {
+ print STDERR "ERROR: client 2 returned $client2\n";
+ $SV->Kill();
+ exit 1;
+ }
+
+ $server = $SV->WaitKill (30);
+ if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ exit 1;
+ }
+}
+
+unlink $iorfile;
+
+exit 0;
diff --git a/TAO/tests/Big_Request_Muxing/server.cpp b/TAO/tests/Big_Request_Muxing/server.cpp
new file mode 100644
index 00000000000..6b134f43f55
--- /dev/null
+++ b/TAO/tests/Big_Request_Muxing/server.cpp
@@ -0,0 +1,176 @@
+// $Id$
+
+#include "Payload_Receiver.h"
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_sys_time.h"
+
+ACE_RCSID(Big_Request_Muxing, server, "$Id$")
+
+const char *ior_output_file = "test.ior";
+static int expected = 400;
+static int sn_expected = 200;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:e:n:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+ case 'e':
+ expected = ACE_OS::atoi(get_opts.opt_arg());
+ break;
+ case 'n':
+ sn_expected = ACE_OS::atoi(get_opts.opt_arg());
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile> [-e <expected>] [-n <expected_sync_none>]"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_DEBUG ((LM_DEBUG, "Starting server\n"));
+
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (poa_object.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize the POA.\n"),
+ 1);
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ Payload_Receiver *payload_receiver_impl;
+ ACE_NEW_RETURN (payload_receiver_impl,
+ Payload_Receiver(),
+ 1);
+ PortableServer::ServantBase_var receiver_owner_transfer(payload_receiver_impl);
+
+ Test::Payload_Receiver_var payload_receiver =
+ payload_receiver_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (payload_receiver.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // If the ior_output_file exists, output the ior to it
+ FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG((LM_DEBUG, "Server waiting for messages...\n"));
+
+ ACE_Time_Value start_time = ACE_OS::gettimeofday();
+ ACE_Time_Value end_time = start_time + ACE_Time_Value(10);
+ int count = payload_receiver_impl->count();
+ int sn_count = payload_receiver_impl->count(true);
+ bool stalled = false;
+ while (payload_receiver_impl->count() < expected ||
+ payload_receiver_impl->count(true) < sn_expected)
+ {
+ int prev_count = count;
+ int sn_prev_count = sn_count;
+ ACE_Time_Value tv(0, 100 * 1000);
+ orb->run (tv ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ count = payload_receiver_impl->count();
+ sn_count = payload_receiver_impl->count(true);
+ if ((count < expected && count == prev_count) ||
+ (sn_count < sn_expected && sn_count == sn_prev_count))
+ {
+ if (!stalled)
+ {
+ stalled = true;
+ end_time = ACE_OS::gettimeofday() + ACE_Time_Value(5);
+ }
+ else if (ACE_OS::gettimeofday() > end_time)
+ {
+ if (count < expected)
+ ACE_DEBUG ((LM_DEBUG,"Clients stalled out after %d messages\n",
+ count));
+ break;
+ }
+ }
+ else stalled = false;
+ }
+
+ ACE_Time_Value runtime = ACE_OS::gettimeofday() - start_time;
+
+ int result = 0;
+
+ if (count != expected)
+ {
+ // Even though 200 events were sent with SYNC_NONE, we still don't
+ // expect TAO to drop any events.
+ ACE_ERROR((LM_ERROR, "Error: "));
+ result = 1;
+ }
+
+
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P) - Server got %d of %d sync messages plus %d sync_none"
+ " in %d sec, %d usec\n",
+ count, expected, payload_receiver_impl->count(true),
+ runtime.sec(), runtime.usec()));
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ return result;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught:");
+ }
+ ACE_ENDTRY;
+
+ ACE_DEBUG ((LM_DEBUG, "Ending server\n"));
+
+ return 1;
+}
diff --git a/TAO/tests/Big_Request_Muxing/svc.conf b/TAO/tests/Big_Request_Muxing/svc.conf
new file mode 100644
index 00000000000..9fb75aeb0dd
--- /dev/null
+++ b/TAO/tests/Big_Request_Muxing/svc.conf
@@ -0,0 +1,4 @@
+#
+# $Id$
+#
+static Client_Strategy_Factory "-ORBTransportMuxStrategy MUXED"
diff --git a/TAO/tests/Big_Request_Muxing/svc.conf.xml b/TAO/tests/Big_Request_Muxing/svc.conf.xml
new file mode 100644
index 00000000000..4fad63264d8
--- /dev/null
+++ b/TAO/tests/Big_Request_Muxing/svc.conf.xml
@@ -0,0 +1,8 @@
+<?xml version='1.0'?>
+<!-- Converted from ./tests/Big_Request_Muxing/svc.conf by svcconf-convert.pl -->
+<ACE_Svc_Conf>
+ <!-- -->
+ <!-- $Id$ -->
+ <!-- -->
+ <static id="Client_Strategy_Factory" params="-ORBTransportMuxStrategy MUXED"/>
+</ACE_Svc_Conf>