summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-02-04 21:28:14 +0000
committermk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-02-04 21:28:14 +0000
commit9517382108555616ea6da95155f11f0e7e0eed4f (patch)
tree7a24bf16901f3f66eb824dcad0a15e252010ad6e
parent9b22620fc4df7842512f0090808889e8e9fa8eb2 (diff)
downloadATCD-9517382108555616ea6da95155f11f0e7e0eed4f.tar.gz
ChangeLogTag: Sun Feb 4 15:30:00 2001 Michael Kircher <Michael.Kircher@mchp.siemens.de>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a6
-rw-r--r--TAO/tests/AMI_Timeouts/client.cpp160
-rw-r--r--TAO/tests/AMI_Timeouts/client.dsp144
-rw-r--r--TAO/tests/AMI_Timeouts/timeout_client.cpp7
4 files changed, 314 insertions, 3 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index e5d2a8ed39b..44c30a84813 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,9 @@
+Sun Feb 4 15:30:00 2001 Michael Kircher <Michael.Kircher@mchp.siemens.de>
+
+ * tests/AMI_Timeouts/client.cpp:
+ * tests/AMI_Timeouts/client.dsp:
+ Added the client side of the AMI timeout test.
+
Sun Feb 4 10:40:39 2001 Darrell Brunsch <brunsch@uci.edu>
* orbsvcs/orbsvcs/Fault_Tolerance.dsp:
diff --git a/TAO/tests/AMI_Timeouts/client.cpp b/TAO/tests/AMI_Timeouts/client.cpp
new file mode 100644
index 00000000000..eb1a3f8ba28
--- /dev/null
+++ b/TAO/tests/AMI_Timeouts/client.cpp
@@ -0,0 +1,160 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO/tests/AMI
+//
+// = FILENAME
+// server.cpp
+//
+// = DESCRIPTION
+// A client, which uses the AMI callback model.
+//
+// = AUTHOR
+// Alexander Babu Arulanthu <alex@cs.wustl.edu>,
+// Michael Kircher <Michael.Kircher@mchp.siemens.de>
+//
+// ============================================================================
+
+#include "ace/Get_Opt.h"
+#include "ace/Task.h"
+
+#include "timeoutC.h"
+
+#include "timeout_i.h"
+#include "timeout_client.h"
+
+ACE_RCSID(AMI, client, "$Id$")
+
+const char *ior = "file://test.ior";
+int nthreads = 5;
+int niterations = 5;
+int debug = 0;
+int number_of_replies = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "dk:n:i:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'd':
+ debug = 1;
+ break;
+ case 'k':
+ ior = get_opts.optarg;
+ break;
+ case 'n':
+ nthreads = ACE_OS::atoi (get_opts.optarg);
+ break;
+ case 'i':
+ niterations = ACE_OS::atoi (get_opts.optarg);
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-d "
+ "-k <ior> "
+ "-n <nthreads> "
+ "-i <niterations> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "", ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ CORBA::Object_var object =
+ orb->string_to_object (ior, ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+
+ Timeout_var timeout_var =
+ Timeout::_narrow (object.in (), ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (timeout_var.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Object reference <%s> is nil\n",
+ ior),
+ 1);
+ }
+
+ // Activate POA to handle the call back.
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA");
+ 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_TRY_ENV);
+ ACE_TRY_CHECK;
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+
+ // Instantiate reply handler
+ TimeoutHandler_i timeoutHandler_i;
+
+ AMI_TimeoutHandler_var timeoutHandler_var =
+ timeoutHandler_i._this (ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+
+ // Instantiate client
+ TimeoutClient* client = new TimeoutClient (orb,
+ timeout_var.in (),
+ timeoutHandler_var.in ());
+
+ client->activate ();
+
+ // ORB loop.
+ ACE_Time_Value time (1,0); // 1 s
+ orb->run (time); // Fetch responses
+
+ if (debug)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) : Exited perform_work loop Received <%d> replies\n",
+ (nthreads*niterations) - number_of_replies));
+ }
+
+
+
+ ACE_DEBUG ((LM_DEBUG, "threads finished\n"));
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Catched exception:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
diff --git a/TAO/tests/AMI_Timeouts/client.dsp b/TAO/tests/AMI_Timeouts/client.dsp
new file mode 100644
index 00000000000..e27b743d846
--- /dev/null
+++ b/TAO/tests/AMI_Timeouts/client.dsp
@@ -0,0 +1,144 @@
+# Microsoft Developer Studio Project File - Name="AMI Timeout Client" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=AMI Timeout Client - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "client.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "client.mak" CFG="AMI Timeout Client - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "AMI Timeout Client - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "AMI Timeout Client - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "AMI Timeout Client - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\.." /I "..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 TAO.lib ace.lib TAO_PortableServer.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\tao\PortableServer" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
+
+!ELSEIF "$(CFG)" == "AMI Timeout Client - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "AMI_Timeout_Client___Win32_Debug"
+# PROP BASE Intermediate_Dir "AMI_Timeout_Client___Win32_Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\.." /I "..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 TAOd.lib aced.lib TAO_PortableServerd.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\tao\PortableServer" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
+
+!ENDIF
+
+# Begin Target
+
+# Name "AMI Timeout Client - Win32 Release"
+# Name "AMI Timeout Client - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\client.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\timeout_client.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\timeout_i.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\timeoutC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\timeoutS.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\timeout_client.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\timeout_i.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\timeoutC.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\timeoutS.h
+# End Source File
+# End Group
+# Begin Group "Inline Files"
+
+# PROP Default_Filter "*.i"
+# Begin Source File
+
+SOURCE=.\timeoutC.i
+# End Source File
+# Begin Source File
+
+SOURCE=.\timeoutS.i
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/TAO/tests/AMI_Timeouts/timeout_client.cpp b/TAO/tests/AMI_Timeouts/timeout_client.cpp
index fc0fc910ac0..27010961a10 100644
--- a/TAO/tests/AMI_Timeouts/timeout_client.cpp
+++ b/TAO/tests/AMI_Timeouts/timeout_client.cpp
@@ -29,14 +29,13 @@ TimeoutClient::TimeoutClient (CORBA::ORB_ptr orb,
, INVOKE_ASYNCH(true)
{
-};
-
+}
TimeoutClient::~TimeoutClient ()
{
-};
+}
int
@@ -63,6 +62,7 @@ TimeoutClient::init ()
return 0;
}
+
void
TimeoutClient::send (bool async,
unsigned long msec)
@@ -98,6 +98,7 @@ TimeoutClient::send (bool async,
ACE_ENDTRY;
}
+
int
TimeoutClient::svc ()
{