summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>1999-07-09 01:42:35 +0000
committerbala <balanatarajan@users.noreply.github.com>1999-07-09 01:42:35 +0000
commit4231c3f279536921dbee14d0e9be6d898799b902 (patch)
tree382a85c75e8ab99bd0e84e8d4bb4f40ec434814f
parent926efe96dd7471bae95275b888df54cbbadfac0d (diff)
downloadATCD-4231c3f279536921dbee14d0e9be6d898799b902.tar.gz
*** empty log message ***
-rw-r--r--TAO/examples/Persistent_Grid/README77
-rwxr-xr-xTAO/examples/Persistent_Grid/run_test.pl54
2 files changed, 131 insertions, 0 deletions
diff --git a/TAO/examples/Persistent_Grid/README b/TAO/examples/Persistent_Grid/README
new file mode 100644
index 00000000000..aa55eed144b
--- /dev/null
+++ b/TAO/examples/Persistent_Grid/README
@@ -0,0 +1,77 @@
+$Id$
+
+This is a simple example based that shows how to use the persistent
+memory. The example is a derivative with a slight variation of the
+Grid example in $TAO_ROOT/Simple/grid.
+
+The server hosts the Grid servant. A client comes along and sets
+some values in the grid. These values are written out by the server in
+to a Memory map file. The servant is then brought down. A new server
+is started again which reads from the same meory map file. A new
+client by name persistent_grid is started which reads the value from
+the locations, where the client stored the values. The values are
+printed for clarity purposes.
+
+server:
+-------
+
+server [-d debug] -o <ior_output_file> -m <memory_pool>
+
+Options:
+-------
+-o Outputs the ior to the file
+ The ior is the reference using which the client can interact with
+ the target server object.
+-m Name of the memory pool.
+
+
+When the server is started, you should see as the first line of output
+something that looks like
+
+ iiop:1.0//danzon.cs.wustl.edu:10015/P35ad159600081a38/child_poa/server
+ (-ORBobjrefstyle url)
+or
+ IOR:000000000000001649444c3a43756269745...
+ (-ORBobjrefstyle ior)
+
+client:
+-------
+
+client [-d] [-x] [-f <Server_ior_file>] [-k file://<ior_output_file>]
+ [-w] [-h] [-v]
+
+Options:
+-------
+-d Debug flag
+-x Tells the server to shutdown at the end of the test.
+-f Reads the server ior from the file
+-k IOR or The IOR can also be given in the format like file://[file.ior]
+ with the full path
+
+-w Width of the grid
+-h Height of the grid
+-v Value that needs to be the starting point for storage. The value
+ that is stored will be this value + location id.
+
+persistent_client:
+-----------------
+persistent_client [-d] [-x] [-f <Server_ior_file>] [-k file://<ior_output_file>]
+ [-w] [-h] [-v]
+
+Options:
+-------
+-d Debug flag
+-x Tells the server to shutdown at the end of the test.
+-f Reads the server ior from the file
+-k IOR or The IOR can also be given in the format like file://[file.ior]
+ with the full path
+
+-w Width of the grid from where the values are to be read
+-h Height of the grid from the where the values are to be read
+
+run_test.pl:
+------------
+
+This perl script runs the server then the client. It shuts down the
+server and restarts the server. It then starts the persistent_client
+to read the values from the memory mapped file.
diff --git a/TAO/examples/Persistent_Grid/run_test.pl b/TAO/examples/Persistent_Grid/run_test.pl
new file mode 100755
index 00000000000..91ac2ec3544
--- /dev/null
+++ b/TAO/examples/Persistent_Grid/run_test.pl
@@ -0,0 +1,54 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "../../../bin";
+require ACEutils;
+require Process;
+
+$iorfile = "grid.ior";
+$mem = "foo";
+
+$SV = Process::Create ($EXEPREFIX."server$Process::EXE_EXT", "-o $iorfile -m $mem");
+
+if (ACE::waitforfile_timed ($iorfile, 10) == -1) {
+ print STDERR "ERROR: timedout waiting for file <$iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+$client = Process::Create ($EXEPREFIX."client$Process::EXE_EXT -k file://$iorfile ");
+if ($client->TimedWait (60) == -1) {
+ print STDERR "ERROR: client timedout\n";
+ $status = 1;
+ $client->Kill (); $client->TimeWait (1);
+}
+
+$SV->Kill (); $SV->TimedWait (1);
+
+unlink $iorfile;
+
+$server = Process::Create ($EXEPREFIX."server$Process::EXE_EXT", "-o $iorfile -m $mem");
+
+if (ACE::waitforfile_timed ($iorfile, 10) == -1) {
+ print STDERR "ERROR: timedout waiting for file <$iorfile>\n";
+ $server->Kill (); $server->TimedWait (1);
+ exit 1;
+}
+
+$per_client = Process::Create ($EXEPREFIX."persistent_client$Process::EXE_EXT -k file://$iorfile -w 10 -h 10");
+
+if ($per_client->TimedWait (60) == -1) {
+ print STDERR "ERROR: client timedout\n";
+ $status = 1;
+ $perclient->Kill (); $per_client->TimeWait (1);
+}
+
+$server->Kill (); $server->TimedWait (1);
+
+unlink $iorfile;
+unlink $mem;
+exit $status;