summaryrefslogtreecommitdiff
path: root/docs/tutorials
diff options
context:
space:
mode:
authorjcej <jcej@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-01-22 01:42:47 +0000
committerjcej <jcej@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-01-22 01:42:47 +0000
commitde7130e9dd16e91799b84012bfbd541dc1a9eaa8 (patch)
tree2750ac9d19d696090f4cc9ef3498070409ecffd5 /docs/tutorials
parentf4811f25fbf7de822e2b3b37a7ffd25bf78296a9 (diff)
downloadATCD-de7130e9dd16e91799b84012bfbd541dc1a9eaa8.tar.gz
*** empty log message ***
Diffstat (limited to 'docs/tutorials')
-rw-r--r--docs/tutorials/006/client_acceptor.h2
-rw-r--r--docs/tutorials/006/client_handler.cpp2
-rw-r--r--docs/tutorials/006/client_handler.h2
-rw-r--r--docs/tutorials/006/page01.html2
-rw-r--r--docs/tutorials/006/page03.html2
-rw-r--r--docs/tutorials/006/page04.html2
-rw-r--r--docs/tutorials/006/page05.html2
-rw-r--r--docs/tutorials/008/combine.shar8
-rw-r--r--docs/tutorials/009/combine.shar394
-rw-r--r--docs/tutorials/009/directed_client.cpp2
-rw-r--r--docs/tutorials/009/page01.html24
-rw-r--r--docs/tutorials/009/page02.html186
-rw-r--r--docs/tutorials/009/page03.html129
-rw-r--r--docs/tutorials/009/page04.html71
-rw-r--r--docs/tutorials/009/page05.html12
-rw-r--r--docs/tutorials/009/server.cpp6
16 files changed, 601 insertions, 245 deletions
diff --git a/docs/tutorials/006/client_acceptor.h b/docs/tutorials/006/client_acceptor.h
index 2318b6adacd..6369d23b523 100644
--- a/docs/tutorials/006/client_acceptor.h
+++ b/docs/tutorials/006/client_acceptor.h
@@ -6,7 +6,7 @@
/*
The ACE_Acceptor<> template lives in the ace/Acceptor.h header file. You'll
- find a very consitent naming convention between the ACE objects and the
+ find a very consistent naming convention between the ACE objects and the
headers where they can be found. In general, the ACE object ACE_Foobar will
diff --git a/docs/tutorials/006/client_handler.cpp b/docs/tutorials/006/client_handler.cpp
index 6e88897ee22..a250fb0f406 100644
--- a/docs/tutorials/006/client_handler.cpp
+++ b/docs/tutorials/006/client_handler.cpp
@@ -176,6 +176,8 @@ int Client_Handler::open (void *_acceptor)
*/
int Client_Handler::close(u_long flags)
{
+ ACE_UNUSED_ARG(flags);
+
/*
We use the destroy() method to clean up after ourselves.
That will take care of removing us from the reactor and then
diff --git a/docs/tutorials/006/client_handler.h b/docs/tutorials/006/client_handler.h
index c1c1d534a32..2b501ac7e98 100644
--- a/docs/tutorials/006/client_handler.h
+++ b/docs/tutorials/006/client_handler.h
@@ -29,7 +29,7 @@
interface as well. That's what the ACE_NULL_SYNCH parameter below is all
about. If our Client_Acceptor has chosen thread-per-connection then our
open() method will activate us into a thread. At that point, our svc()
- method will execute. We still don't take advantage of the thiings
+ method will execute. We still don't take advantage of the things
ACE_NULL_SYNCH exists for but stick around for Tutorial 7 and pay special
attention to the Thread_Pool object there for an explanation.
*/
diff --git a/docs/tutorials/006/page01.html b/docs/tutorials/006/page01.html
index 31380d02b6d..82864098ccc 100644
--- a/docs/tutorials/006/page01.html
+++ b/docs/tutorials/006/page01.html
@@ -49,7 +49,7 @@ called per thread for the thread-per-connection server.
<p>
Note that here all the Client_Handler objects aren't registered with the
reactor. The Reactor is only used to accept client connections. Once a
-thread has been deicated per connection, the Client Handler object
+thread has been dedicated per connection, the Client Handler object
reponsible for that client connection now takes up the job of the
reactor and handles future events.
<p>
diff --git a/docs/tutorials/006/page03.html b/docs/tutorials/006/page03.html
index 6fa27df0964..cf164c5b4d8 100644
--- a/docs/tutorials/006/page03.html
+++ b/docs/tutorials/006/page03.html
@@ -34,7 +34,7 @@ to the Tutorial 5 version of this file.
<font color=red>/*
The ACE_Acceptor&lt;> template lives in the ace/Acceptor.h header file. You'll
- find a very consitent naming convention between the ACE objects and the
+ find a very consistent naming convention between the ACE objects and the
headers where they can be found. In general, the ACE object ACE_Foobar will
diff --git a/docs/tutorials/006/page04.html b/docs/tutorials/006/page04.html
index 3e2002b1d52..130c264cec7 100644
--- a/docs/tutorials/006/page04.html
+++ b/docs/tutorials/006/page04.html
@@ -54,7 +54,7 @@ exist.
interface as well. That's what the ACE_NULL_SYNCH parameter below is all
about. If our Client_Acceptor has chosen thread-per-connection then our
open() method will activate us into a thread. At that point, our svc()
- method will execute. We still don't take advantage of the thiings
+ method will execute. We still don't take advantage of the things
ACE_NULL_SYNCH exists for but stick around for Tutorial 7 and pay special
attention to the Thread_Pool object there for an explanation.
*/</font>
diff --git a/docs/tutorials/006/page05.html b/docs/tutorials/006/page05.html
index 94cb1554897..ce9d99ce0b6 100644
--- a/docs/tutorials/006/page05.html
+++ b/docs/tutorials/006/page05.html
@@ -200,6 +200,8 @@ int <font color=#008888>Client_Handler::open</font> (void *_acceptor)
*/</font>
int <font color=#008888>Client_Handler::close</font>(u_long flags)
{
+ ACE_UNUSED_ARG(flags);
+
<font color=red>/*
We use the destroy() method to clean up after ourselves.
That will take care of removing us from the reactor and then
diff --git a/docs/tutorials/008/combine.shar b/docs/tutorials/008/combine.shar
index f64a7e4b3a4..26e729f68b3 100644
--- a/docs/tutorials/008/combine.shar
+++ b/docs/tutorials/008/combine.shar
@@ -3,8 +3,8 @@
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
-# Made on 1999-01-21 16:00 EST by <jcej@beta.mobsec.com>.
-# Source directory was `/projects/home/jcej/projects/ACE_wrappers/docs/tutorials/008'.
+# Made on 1999-01-21 20:42 EST by <jcej@chiroptera.tragus.org>.
+# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/008'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
@@ -67,7 +67,7 @@ else
fi
rm -f 1231235999 $$.touch
#
-if mkdir _sh14356; then
+if mkdir _sh23902; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
@@ -456,5 +456,5 @@ SHAR_EOF
$echo 'page04.pst:' 'original size' '987,' 'current size' "$shar_count!"
fi
fi
-rm -fr _sh14356
+rm -fr _sh23902
exit 0
diff --git a/docs/tutorials/009/combine.shar b/docs/tutorials/009/combine.shar
new file mode 100644
index 00000000000..c12d2186061
--- /dev/null
+++ b/docs/tutorials/009/combine.shar
@@ -0,0 +1,394 @@
+#!/bin/sh
+# This is a shell archive (produced by GNU sharutils 4.2).
+# To extract the files from this archive, save it to some FILE, remove
+# everything before the `!/bin/sh' line above, then type `sh FILE'.
+#
+# Made on 1999-01-21 20:41 EST by <jcej@chiroptera.tragus.org>.
+# Source directory was `/var/home/jcej/projects/ACE_wrappers/docs/tutorials/009'.
+#
+# Existing files will *not* be overwritten unless `-c' is specified.
+#
+# This shar contains:
+# length mode name
+# ------ ---------- ------------------------------------------
+# 520 -rw-rw-r-- hdr
+# 59 -rw-rw-r-- bodies
+# 2185 -rw-rw-r-- page01.pre
+# 188 -rw-rw-r-- page02.pre
+# 295 -rw-rw-r-- page03.pre
+# 301 -rw-rw-r-- page04.pre
+# 995 -rw-rw-r-- page05.pre
+# 81 -rw-rw-r-- page02.pst
+# 96 -rw-rw-r-- page03.pst
+#
+save_IFS="${IFS}"
+IFS="${IFS}:"
+gettext_dir=FAILED
+locale_dir=FAILED
+first_param="$1"
+for dir in $PATH
+do
+ if test "$gettext_dir" = FAILED && test -f $dir/gettext \
+ && ($dir/gettext --version >/dev/null 2>&1)
+ then
+ set `$dir/gettext --version 2>&1`
+ if test "$3" = GNU
+ then
+ gettext_dir=$dir
+ fi
+ fi
+ if test "$locale_dir" = FAILED && test -f $dir/shar \
+ && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
+ then
+ locale_dir=`$dir/shar --print-text-domain-dir`
+ fi
+done
+IFS="$save_IFS"
+if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
+then
+ echo=echo
+else
+ TEXTDOMAINDIR=$locale_dir
+ export TEXTDOMAINDIR
+ TEXTDOMAIN=sharutils
+ export TEXTDOMAIN
+ echo="$gettext_dir/gettext -s"
+fi
+touch -am 1231235999 $$.touch >/dev/null 2>&1
+if test ! -f 1231235999 && test -f $$.touch; then
+ shar_touch=touch
+else
+ shar_touch=:
+ echo
+ $echo 'WARNING: not restoring timestamps. Consider getting and'
+ $echo "installing GNU \`touch', distributed in GNU File Utilities..."
+ echo
+fi
+rm -f 1231235999 $$.touch
+#
+if mkdir _sh23750; then
+ $echo 'x -' 'creating lock directory'
+else
+ $echo 'failed to create lock directory'
+ exit 1
+fi
+# ============= hdr ==============
+if test -f 'hdr' && test "$first_param" != -c; then
+ $echo 'x -' SKIPPING 'hdr' '(file already exists)'
+else
+ $echo 'x -' extracting 'hdr' '(text)'
+ sed 's/^X//' << 'SHAR_EOF' > 'hdr' &&
+<HTML>
+<HEAD>
+X <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
+X <META NAME="GENERATOR" CONTENT="Mozilla/4.04 [en] (X11; I; Linux 2.0.32 i486) [Netscape]">
+X <META NAME="Author" CONTENT="James CE Johnson">
+X <TITLE>ACE Tutorial 009</TITLE>
+</HEAD>
+<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F">
+X
+<CENTER><B><FONT SIZE=+2>ACE Tutorial 009</FONT></B></CENTER>
+X
+<CENTER><B><FONT SIZE=+2>Sending and receiving datagrams again</FONT></B></CENTER>
+X
+X
+<P>
+<HR WIDTH="100%">
+SHAR_EOF
+ $shar_touch -am 0121195099 'hdr' &&
+ chmod 0664 'hdr' ||
+ $echo 'restore of' 'hdr' 'failed'
+ if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
+ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
+ md5sum -c << SHAR_EOF >/dev/null 2>&1 \
+ || $echo 'hdr:' 'MD5 check failed'
+808b7f288617f5b0a55256542f242912 hdr
+SHAR_EOF
+ else
+ shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'hdr'`"
+ test 520 -eq "$shar_count" ||
+ $echo 'hdr:' 'original size' '520,' 'current size' "$shar_count!"
+ fi
+fi
+# ============= bodies ==============
+if test -f 'bodies' && test "$first_param" != -c; then
+ $echo 'x -' SKIPPING 'bodies' '(file already exists)'
+else
+ $echo 'x -' extracting 'bodies' '(text)'
+ sed 's/^X//' << 'SHAR_EOF' > 'bodies' &&
+PAGE=2
+server.cpp
+directed_client.cpp
+broadcast_client.cpp
+SHAR_EOF
+ $shar_touch -am 0121195199 'bodies' &&
+ chmod 0664 'bodies' ||
+ $echo 'restore of' 'bodies' 'failed'
+ if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
+ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
+ md5sum -c << SHAR_EOF >/dev/null 2>&1 \
+ || $echo 'bodies:' 'MD5 check failed'
+707d1735ca25694e2b5fddc1f6e7e124 bodies
+SHAR_EOF
+ else
+ shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'bodies'`"
+ test 59 -eq "$shar_count" ||
+ $echo 'bodies:' 'original size' '59,' 'current size' "$shar_count!"
+ fi
+fi
+# ============= page01.pre ==============
+if test -f 'page01.pre' && test "$first_param" != -c; then
+ $echo 'x -' SKIPPING 'page01.pre' '(file already exists)'
+else
+ $echo 'x -' extracting 'page01.pre' '(text)'
+ sed 's/^X//' << 'SHAR_EOF' > 'page01.pre' &&
+X
+<P>In our previous tutorial, we created a datagram listener and a couple
+of clients that would send it datagrams.&nbsp; That server would respond
+to any datagram sent to the TCP/IP port at which the server was listening.&nbsp;
+What we really want to do, however, is to have the server only respond
+to clients that meet some criteria.
+X
+<P>Why is this important?
+X
+<P>Imagine you're writting a distributed system that will have many server
+applications.&nbsp; Each of those will probably listen at different (and
+well-known)&nbsp;TCP/IP addresses so that clients can find each server
+without confusion.&nbsp; However...&nbsp; In a large system you might have
+several <I>versions</I> of the same server running at the same time*.&nbsp;
+You probably don't want those servers running at different addresses since
+that breaks the well-known address requirement.
+X
+<P>By creating a datagram listener similar to the last tutorial, a client
+can send broadcast datagrams to locate all of the servers listening at
+the well-known address.&nbsp;&nbsp; By adding a thin protocol layer into
+the datagram contents, the servers can be selective about which clients
+they respond to.&nbsp; Thus, if each client sends its version signature
+in the broadcast, then the servers can choose to respond only to clients
+with matching versions.
+<P>
+Kirthika's Abstract:
+<UL>
+Here, the client uses datagrams for discovery of the server in the
+subnet and also sends a signature for authentification. The server
+decides on replying to the client depending on the signature. The only
+changes from the previous tutorial are in the addition of an extra
+signature matching portion on the server side and providing timeout
+values on the client side which allows the send() and recv() calls to
+return on a timeout if the target party fails to respond.
+<P>
+This feature of discrimnation depending on the client signature could be
+used for security reasons or version confirmation by the server.
+</UL>
+<P><FONT SIZE=-1>*Note:&nbsp; I'm making the assumption that your multiple
+server versions will be running on different hosts since you can only have
+one server listening at the well-known address on a given host.</FONT>
+X
+SHAR_EOF
+ $shar_touch -am 0121195099 'page01.pre' &&
+ chmod 0664 'page01.pre' ||
+ $echo 'restore of' 'page01.pre' 'failed'
+ if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
+ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
+ md5sum -c << SHAR_EOF >/dev/null 2>&1 \
+ || $echo 'page01.pre:' 'MD5 check failed'
+c6367380deb11b98c346d35794fac6cd page01.pre
+SHAR_EOF
+ else
+ shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page01.pre'`"
+ test 2185 -eq "$shar_count" ||
+ $echo 'page01.pre:' 'original size' '2185,' 'current size' "$shar_count!"
+ fi
+fi
+# ============= page02.pre ==============
+if test -f 'page02.pre' && test "$first_param" != -c; then
+ $echo 'x -' SKIPPING 'page02.pre' '(file already exists)'
+else
+ $echo 'x -' extracting 'page02.pre' '(text)'
+ sed 's/^X//' << 'SHAR_EOF' > 'page02.pre' &&
+X
+<P>Let's take a look at our new <A HREF="server.cpp">server.cpp</A> where
+we add in just a bit of code to examine the datagram contents before responding.
+X
+<P>
+<HR WIDTH="100%"><TT></TT>
+SHAR_EOF
+ $shar_touch -am 0121195099 'page02.pre' &&
+ chmod 0664 'page02.pre' ||
+ $echo 'restore of' 'page02.pre' 'failed'
+ if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
+ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
+ md5sum -c << SHAR_EOF >/dev/null 2>&1 \
+ || $echo 'page02.pre:' 'MD5 check failed'
+76a728cf5d0f42ca9b7d7a6fa0637384 page02.pre
+SHAR_EOF
+ else
+ shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page02.pre'`"
+ test 188 -eq "$shar_count" ||
+ $echo 'page02.pre:' 'original size' '188,' 'current size' "$shar_count!"
+ fi
+fi
+# ============= page03.pre ==============
+if test -f 'page03.pre' && test "$first_param" != -c; then
+ $echo 'x -' SKIPPING 'page03.pre' '(file already exists)'
+else
+ $echo 'x -' extracting 'page03.pre' '(text)'
+ sed 's/^X//' << 'SHAR_EOF' > 'page03.pre' &&
+X
+<P>Our new <A HREF="directed_client.cpp">directed_client.cpp</A>&nbsp;
+is very much like our previous one.&nbsp; The primary difference is the
+addition of a timeout to the recv() call so that we can exit somewhat gracefully
+if the server doesn't like what we have to say.
+X
+<P>
+<HR WIDTH="100%">
+SHAR_EOF
+ $shar_touch -am 0121194999 'page03.pre' &&
+ chmod 0664 'page03.pre' ||
+ $echo 'restore of' 'page03.pre' 'failed'
+ if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
+ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
+ md5sum -c << SHAR_EOF >/dev/null 2>&1 \
+ || $echo 'page03.pre:' 'MD5 check failed'
+58878c3f2b7d458371fdf243db6cba61 page03.pre
+SHAR_EOF
+ else
+ shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page03.pre'`"
+ test 295 -eq "$shar_count" ||
+ $echo 'page03.pre:' 'original size' '295,' 'current size' "$shar_count!"
+ fi
+fi
+# ============= page04.pre ==============
+if test -f 'page04.pre' && test "$first_param" != -c; then
+ $echo 'x -' SKIPPING 'page04.pre' '(file already exists)'
+else
+ $echo 'x -' extracting 'page04.pre' '(text)'
+ sed 's/^X//' << 'SHAR_EOF' > 'page04.pre' &&
+X
+<P>As you can see in <A HREF="broadcast_client.cpp">broadcast_client.cpp</A>,
+there isn't enough difference to even comment on!&nbsp; Look back to the
+Tutorial 8 version of this file.&nbsp; The only difference is the addition
+of the timeout variable passed to recv().
+X
+<P>
+<HR WIDTH="100%"><TT></TT>
+SHAR_EOF
+ $shar_touch -am 0121195099 'page04.pre' &&
+ chmod 0664 'page04.pre' ||
+ $echo 'restore of' 'page04.pre' 'failed'
+ if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
+ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
+ md5sum -c << SHAR_EOF >/dev/null 2>&1 \
+ || $echo 'page04.pre:' 'MD5 check failed'
+8c92e7ef51e85491bc2d7991a5b62cbb page04.pre
+SHAR_EOF
+ else
+ shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page04.pre'`"
+ test 301 -eq "$shar_count" ||
+ $echo 'page04.pre:' 'original size' '301,' 'current size' "$shar_count!"
+ fi
+fi
+# ============= page05.pre ==============
+if test -f 'page05.pre' && test "$first_param" != -c; then
+ $echo 'x -' SKIPPING 'page05.pre' '(file already exists)'
+else
+ $echo 'x -' extracting 'page05.pre' '(text)'
+ sed 's/^X//' << 'SHAR_EOF' > 'page05.pre' &&
+In this tutorial we've expanded on Tutorial 8 to provide a more discriminating
+server application.&nbsp; The changes to the clients were trivial, amounting
+to not much more than the addition of a timeout when reading a server's
+potential response.&nbsp; The server change was a bit more since it had
+to compare the clients' query with it's own signature.
+X
+<P>In a "real" system, the signatures you swap would probably include version
+information.&nbsp; You could even use a major/minor scheme where an exact
+match isn't necessary.&nbsp; Another upgrade might be to have a set of
+signatures at one or both ends of the conversation.&nbsp; The level of
+service provided by the server would be determined by the signature pair
+match.
+X
+<P>Here's the final file list:
+<UL>
+<LI>
+<A HREF="Makefile">Makefile</A></LI>
+X
+<LI>
+<A HREF="server.cpp">server.cpp</A></LI>
+X
+<LI>
+<A HREF="directed_client.cpp">directed_client.cpp</A></LI>
+X
+<LI>
+<A HREF="broadcast_client.cpp">broadcast_client.cpp</A></LI>
+</UL>
+X
+SHAR_EOF
+ $shar_touch -am 0121194999 'page05.pre' &&
+ chmod 0664 'page05.pre' ||
+ $echo 'restore of' 'page05.pre' 'failed'
+ if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
+ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
+ md5sum -c << SHAR_EOF >/dev/null 2>&1 \
+ || $echo 'page05.pre:' 'MD5 check failed'
+835e97e1b6ac1747ef9508936a56a6cc page05.pre
+SHAR_EOF
+ else
+ shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page05.pre'`"
+ test 995 -eq "$shar_count" ||
+ $echo 'page05.pre:' 'original size' '995,' 'current size' "$shar_count!"
+ fi
+fi
+# ============= page02.pst ==============
+if test -f 'page02.pst' && test "$first_param" != -c; then
+ $echo 'x -' SKIPPING 'page02.pst' '(file already exists)'
+else
+ $echo 'x -' extracting 'page02.pst' '(text)'
+ sed 's/^X//' << 'SHAR_EOF' > 'page02.pst' &&
+<HR WIDTH="100%">
+X
+<P>Let's move on and see what changes the clients require...
+X
+SHAR_EOF
+ $shar_touch -am 0121195099 'page02.pst' &&
+ chmod 0664 'page02.pst' ||
+ $echo 'restore of' 'page02.pst' 'failed'
+ if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
+ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
+ md5sum -c << SHAR_EOF >/dev/null 2>&1 \
+ || $echo 'page02.pst:' 'MD5 check failed'
+76a64b9c5c1d1baa1425085b1649fb31 page02.pst
+SHAR_EOF
+ else
+ shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page02.pst'`"
+ test 81 -eq "$shar_count" ||
+ $echo 'page02.pst:' 'original size' '81,' 'current size' "$shar_count!"
+ fi
+fi
+# ============= page03.pst ==============
+if test -f 'page03.pst' && test "$first_param" != -c; then
+ $echo 'x -' SKIPPING 'page03.pst' '(file already exists)'
+else
+ $echo 'x -' extracting 'page03.pst' '(text)'
+ sed 's/^X//' << 'SHAR_EOF' > 'page03.pst' &&
+<HR WIDTH="100%">
+X
+<P>On the next page, we see that the directed_client gets similar upgrades.
+X
+SHAR_EOF
+ $shar_touch -am 0121195099 'page03.pst' &&
+ chmod 0664 'page03.pst' ||
+ $echo 'restore of' 'page03.pst' 'failed'
+ if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
+ && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
+ md5sum -c << SHAR_EOF >/dev/null 2>&1 \
+ || $echo 'page03.pst:' 'MD5 check failed'
+11fda077df9a3ef7155f33e75cc9b6b6 page03.pst
+SHAR_EOF
+ else
+ shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'page03.pst'`"
+ test 96 -eq "$shar_count" ||
+ $echo 'page03.pst:' 'original size' '96,' 'current size' "$shar_count!"
+ fi
+fi
+rm -fr _sh23750
+exit 0
diff --git a/docs/tutorials/009/directed_client.cpp b/docs/tutorials/009/directed_client.cpp
index 7156286bec1..b15dbab45d7 100644
--- a/docs/tutorials/009/directed_client.cpp
+++ b/docs/tutorials/009/directed_client.cpp
@@ -20,7 +20,7 @@ int main (int argc, char *argv[])
char buf[512];
/*
- In order to conform to the "protocol" requried by the server,
+ In order to conform to the "protocol" required by the server,
we allow the user to specify a signature. A default matching
the server's default is also available.
*/
diff --git a/docs/tutorials/009/page01.html b/docs/tutorials/009/page01.html
index aa80ca05b7c..cadc7cb5484 100644
--- a/docs/tutorials/009/page01.html
+++ b/docs/tutorials/009/page01.html
@@ -38,15 +38,23 @@ the datagram contents, the servers can be selective about which clients
they respond to.&nbsp; Thus, if each client sends its version signature
in the broadcast, then the servers can choose to respond only to clients
with matching versions.
-
+<P>
+Kirthika's Abstract:
+<UL>
+Here, the client uses datagrams for discovery of the server in the
+subnet and also sends a signature for authentification. The server
+decides on replying to the client depending on the signature. The only
+changes from the previous tutorial are in the addition of an extra
+signature matching portion on the server side and providing timeout
+values on the client side which allows the send() and recv() calls to
+return on a timeout if the target party fails to respond.
+<P>
+This feature of discrimnation depending on the client signature could be
+used for security reasons or version confirmation by the server.
+</UL>
<P><FONT SIZE=-1>*Note:&nbsp; I'm making the assumption that your multiple
server versions will be running on different hosts since you can only have
one server listening at the well-known address on a given host.</FONT>
-<P>
-<HR WIDTH="100%">
-<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page02.html">Continue
-This Tutorial</A>]</CENTER>
-
-</BODY>
-</HTML>
+<P><HR WIDTH="100%">
+<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page02.html">Continue This Tutorial</A>]</CENTER>
diff --git a/docs/tutorials/009/page02.html b/docs/tutorials/009/page02.html
index 1098bef0f46..66801670f2b 100644
--- a/docs/tutorials/009/page02.html
+++ b/docs/tutorials/009/page02.html
@@ -20,111 +20,89 @@ we add in just a bit of code to examine the datagram contents before responding.
<P>
<HR WIDTH="100%"><TT></TT>
-
-<P><TT>/*</TT>
-<BR><TT>&nbsp;&nbsp; The actual datagram operations here are exactly the
-same as those used in</TT>
-<BR><TT>&nbsp;&nbsp; the previous tutorial.&nbsp; What we've added is some
-logic that will prevent</TT>
-<BR><TT>&nbsp;&nbsp; this server from responding to just any old datagram.&nbsp;
-I'll limit my</TT>
-<BR><TT>&nbsp;&nbsp; comments to those pieces of code.</TT>
-<BR><TT>&nbsp;*/</TT><TT></TT>
-
-<P><TT>#include "ace/SOCK_Dgram.h"</TT>
-<BR><TT>#include "ace/INET_Addr.h"</TT><TT></TT>
-
-<P><TT>static const u_short PORT = ACE_DEFAULT_SERVER_PORT;</TT><TT></TT>
-
-<P><TT>/*</TT>
-<BR><TT>&nbsp;&nbsp; In order to be more selective, our server will be
-started with a</TT>
-<BR><TT>&nbsp;&nbsp; "signature".&nbsp; If none is given, we'll use the
-one here instead.</TT>
-<BR><TT>&nbsp;*/</TT>
-<BR><TT>static const char *default_signature = "Hello World!";</TT><TT></TT>
-
-<P><TT>int main (int argc, char *argv[])</TT>
-<BR><TT>{</TT>
-<BR><TT>&nbsp; ACE_INET_Addr local (PORT);</TT>
-<BR><TT>&nbsp; ACE_SOCK_Dgram dgram;</TT><TT></TT>
-
-<P><TT>&nbsp; if (dgram.open (local) == -1)</TT>
-<BR><TT>&nbsp; {</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp; ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"),
--1);</TT>
-<BR><TT>&nbsp; }</TT><TT></TT>
-
-<P><TT>&nbsp; char buf[512];</TT>
-<BR><TT>&nbsp; ACE_INET_Addr remote;</TT><TT></TT>
-
-<P><TT>&nbsp; while (dgram.recv (buf, sizeof (buf), remote) != -1)</TT>
-<BR><TT>&nbsp; {</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp; /*</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; What did the client say?</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp; */</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp; ACE_DEBUG ((LM_DEBUG, "(%P|%t) Received (%s)
-from (%s)\n", buf, remote.get_host_name ()));</TT><TT></TT>
-
-<P><TT>&nbsp;&nbsp;&nbsp; /*</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Use a simple string-op to
-decide if the client is one of our own.&nbsp; Of</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; course, you could have sent
-numeric values or even a struct of data. For</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this simple exercise, however,
-strings are just fine.</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp; */</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp; if (ACE_OS::strcmp (buf, argc > 1 ? argv[1]
-: default_signature))</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp; {</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If the client
-didn't say something we like then log it and move on.</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ACE_DEBUG ((LM_DEBUG,</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-"(%P|%t) Client query does not match our signature (%s).&nbsp; Response
-not sent.\n",</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-argc > 1 ? argv[1] : default_signature));</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp; }</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp; else</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp; {</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; As before, we
-respond to the client's query.</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */</TT><TT></TT>
-
-<P><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ACE_INET_Addr local ((u_short) 0);</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ACE_SOCK_Dgram client;</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (client.open (local) == -1)</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ACE_ERROR_RETURN
-((LM_ERROR, "%p\n", "response open"), -1);</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</TT><TT></TT>
-
-<P><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sprintf (buf, "I am here");</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (client.send (buf, strlen (buf)
-+ 1, remote) == -1)</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ACE_ERROR_RETURN
-((LM_ERROR, "%p\n", "response send"), -1);</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp; }</TT>
-<BR><TT>&nbsp; }</TT><TT></TT>
-
-<P><TT>&nbsp; return (0);</TT>
-<BR><TT>}</TT><TT></TT>
-
-<P>
+<PRE>
+
+<font color=red>// $Id$</font>
+
+<font color=red>/*
+ The actual datagram operations here are exactly the same as those used in
+ the previous tutorial. What we've added is some logic that will prevent
+ this server from responding to just any old datagram. I'll limit my
+ comments to those pieces of code.
+ */</font>
+
+<font color=blue>#include</font> "<font color=green>ace/SOCK_Dgram.h</font>"
+<font color=blue>#include</font> "<font color=green>ace/INET_Addr.h</font>"
+
+static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
+
+<font color=red>/*
+ In order to be more selective, our server will be started with a
+ "<font color=green>signature</font>". If none is given, we'll use the one here instead.
+ */</font>
+static const char *default_signature = "<font color=green>Hello World!</font>";
+
+int main (int argc, char *argv[])
+{
+ ACE_INET_Addr local (PORT);
+ ACE_SOCK_Dgram dgram;
+
+ if (dgram.open (local) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "<font color=green>%p\n</font>", "<font color=green>open</font>"), -1);
+ }
+
+ char buf[512];
+ ACE_INET_Addr remote;
+
+ while (dgram.recv (buf, sizeof (buf), remote) != -1)
+ {
+ <font color=red>/*
+ What did the client say?
+ */</font>
+ ACE_DEBUG ((LM_DEBUG, "<font color=green>(%P|%t) Received (%s) from (%s)\n</font>", buf, remote.get_host_name ()));
+
+ <font color=red>/*
+ Use a simple string-op to decide if the client is one of our own. Of
+ course, you could have sent numeric values or even a struct of data. For
+ this simple exercise, however, strings are just fine.
+ */</font>
+ if (<font color=#008888>ACE_OS::strcmp</font> (buf, argc > 1 ? argv[1] : default_signature))
+ {
+ <font color=red>/*
+ If the client didn't say something we like then log it and move on.
+ */</font>
+ ACE_DEBUG ((LM_DEBUG,
+ "<font color=green>(%P|%t) Client query does not match our signature (%s). Response not sent.\n</font>",
+ argc > 1 ? argv[1] : default_signature));
+ }
+ else
+ {
+ <font color=red>/*
+ As before, we respond to the client's query.
+ */</font>
+
+ ACE_INET_Addr local ((u_short) 0);
+ ACE_SOCK_Dgram peer;
+ if (peer.open (local) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "<font color=green>%p\n</font>", "<font color=green>response open</font>"), -1);
+ }
+
+ sprintf (buf, "<font color=green>I am here</font>");
+ if (peer.send (buf, strlen (buf) + 1, remote) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "<font color=green>%p\n</font>", "<font color=green>response send</font>"), -1);
+ }
+ }
+ }
+
+ return (0);
+}
+</PRE>
<HR WIDTH="100%">
<P>Let's move on and see what changes the clients require...
-<P>
-<HR WIDTH="100%">
-<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page03.html">Continue
-This Tutorial</A>]</CENTER>
-
-</BODY>
-</HTML>
+<P><HR WIDTH="100%">
+<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page03.html">Continue This Tutorial</A>]</CENTER>
diff --git a/docs/tutorials/009/page03.html b/docs/tutorials/009/page03.html
index b84f22bcba8..e0cd345e9e9 100644
--- a/docs/tutorials/009/page03.html
+++ b/docs/tutorials/009/page03.html
@@ -21,80 +21,63 @@ addition of a timeout to the recv() call so that we can exit somewhat gracefully
if the server doesn't like what we have to say.
<P>
-<HR WIDTH="100%"><TT></TT>
-
-<P><TT>#include "ace/SOCK_Dgram.h"</TT>
-<BR><TT>#include "ace/INET_Addr.h"</TT><TT></TT>
-
-<P><TT>static const u_short PORT = ACE_DEFAULT_SERVER_PORT;</TT><TT></TT>
-
-<P><TT>int main (int argc, char *argv[])</TT>
-<BR><TT>{</TT>
-<BR><TT>&nbsp; ACE_INET_Addr local ((u_short) 0);</TT>
-<BR><TT>&nbsp; ACE_INET_Addr remote (PORT, argc > 1 ? argv[1] : "localhost");</TT>
-<BR><TT>&nbsp; ACE_SOCK_Dgram dgram;</TT><TT></TT>
-
-<P><TT>&nbsp; if (dgram.open (local) == -1)</TT>
-<BR><TT>&nbsp; {</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp; ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"),
--1);</TT>
-<BR><TT>&nbsp; }</TT><TT></TT>
-
-<P><TT>&nbsp; char buf[512];</TT><TT></TT>
-
-<P><TT>&nbsp; /*</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp; In order to conform to the "protocol"
-requried by the server,</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp; we allow the user to specify a signature.&nbsp;
-A default matching</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp; the server's default is also available.</TT>
-<BR><TT>&nbsp;&nbsp; */</TT>
-<BR><TT>&nbsp; sprintf (buf, argc > 2 ? argv[2] : "Hello World!");</TT><TT></TT>
-
-<P><TT>&nbsp; if (dgram.send (buf, strlen (buf) + 1, remote) == -1)</TT>
-<BR><TT>&nbsp; {</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp; ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"),
--1);</TT>
-<BR><TT>&nbsp; }</TT><TT></TT>
-
-<P><TT>&nbsp; /*</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp; Because we may have sent a signature that
-the server doesn't</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp; honor, we have to have some way to get
-out of the recv().</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp; Most ACE objects that have potential for
-infinite blocking</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp; give you the option of providing a timeout.&nbsp;
-recv() is no</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp; exception.&nbsp; Here, we construct an
-ACE_Time_Value representing</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp; two seconds and no micro-seconds.&nbsp;
-If recv() fails to get</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp; a response within the two seconds, it
-will return -1.</TT>
-<BR><TT>&nbsp;&nbsp; */</TT>
-<BR><TT>&nbsp; ACE_Time_Value timeout (2, 0);</TT>
-<BR><TT>&nbsp; if (dgram.recv (buf, sizeof (buf), remote, 0, &amp;timeout)
-== -1)</TT>
-<BR><TT>&nbsp; {</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp; ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "recv"),
--1);</TT>
-<BR><TT>&nbsp; }</TT><TT></TT>
-
-<P><TT>&nbsp; ACE_DEBUG ((LM_DEBUG, "(%P|%t) The server said (%s)\n", buf));</TT><TT></TT>
-
-<P><TT>&nbsp; return (0);</TT>
-<BR><TT>}</TT>
-
-<P>
+<HR WIDTH="100%"><PRE>
+
+<font color=red>// $Id$</font>
+
+<font color=blue>#include</font> "<font color=green>ace/SOCK_Dgram.h</font>"
+<font color=blue>#include</font> "<font color=green>ace/INET_Addr.h</font>"
+
+static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
+
+int main (int argc, char *argv[])
+{
+ ACE_INET_Addr local ((u_short) 0);
+ ACE_INET_Addr remote (PORT, argc > 1 ? argv[1] : "<font color=green>localhost</font>");
+ ACE_SOCK_Dgram dgram;
+
+ if (dgram.open (local) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "<font color=green>%p\n</font>", "<font color=green>open</font>"), -1);
+ }
+
+ char buf[512];
+
+ <font color=red>/*
+ In order to conform to the "<font color=green>protocol</font>" required by the server,
+ we allow the user to specify a signature. A default matching
+ the server's default is also available.
+ */</font>
+ sprintf (buf, argc > 2 ? argv[2] : "<font color=green>Hello World!</font>");
+
+ if (dgram.send (buf, strlen (buf) + 1, remote) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "<font color=green>%p\n</font>", "<font color=green>send</font>"), -1);
+ }
+
+ <font color=red>/*
+ Because we may have sent a signature that the server doesn't
+ honor, we have to have some way to get out of the recv().
+ Most ACE objects that have potential for infinite blocking
+ give you the option of providing a timeout. recv() is no
+ exception. Here, we construct an ACE_Time_Value representing
+ two seconds and no micro-seconds. If recv() fails to get
+ a response within the two seconds, it will return -1.
+ */</font>
+ ACE_Time_Value timeout (2, 0);
+ if (dgram.recv (buf, sizeof (buf), remote, 0, &timeout) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "<font color=green>%p\n</font>", "<font color=green>recv</font>"), -1);
+ }
+
+ ACE_DEBUG ((LM_DEBUG, "<font color=green>(%P|%t) The server said (%s)\n</font>", buf));
+
+ return (0);
+}
+</PRE>
<HR WIDTH="100%">
<P>On the next page, we see that the directed_client gets similar upgrades.
-<P>
-<HR WIDTH="100%">
-<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page04.html">Continue
-This Tutorial</A>]</CENTER>
-
-</BODY>
-</HTML>
+<P><HR WIDTH="100%">
+<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page04.html">Continue This Tutorial</A>]</CENTER>
diff --git a/docs/tutorials/009/page04.html b/docs/tutorials/009/page04.html
index 46bc80c2a2f..e9bcc1d8fd4 100644
--- a/docs/tutorials/009/page04.html
+++ b/docs/tutorials/009/page04.html
@@ -22,53 +22,46 @@ of the timeout variable passed to recv().
<P>
<HR WIDTH="100%"><TT></TT>
+<PRE>
-<P><TT>#include "ace/SOCK_Dgram_Bcast.h"</TT>
-<BR><TT>#include "ace/INET_Addr.h"</TT><TT></TT>
+<font color=red>// $Id$</font>
-<P><TT>static const u_short PORT = ACE_DEFAULT_SERVER_PORT;</TT><TT></TT>
+<font color=blue>#include</font> "<font color=green>ace/SOCK_Dgram_Bcast.h</font>"
+<font color=blue>#include</font> "<font color=green>ace/INET_Addr.h</font>"
-<P><TT>int main (int argc, char *argv[])</TT>
-<BR><TT>{</TT>
-<BR><TT>&nbsp; ACE_INET_Addr local ((u_short) 0);</TT>
-<BR><TT>&nbsp; ACE_INET_Addr remote (PORT, INADDR_BROADCAST);</TT>
-<BR><TT>&nbsp; ACE_SOCK_Dgram_Bcast dgram;</TT><TT></TT>
+static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
-<P><TT>&nbsp; if (dgram.open (local) == -1)</TT>
-<BR><TT>&nbsp; {</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp; ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"),
--1);</TT>
-<BR><TT>&nbsp; }</TT><TT></TT>
+int main (int argc, char *argv[])
+{
+ ACE_INET_Addr local ((u_short) 0);
+ ACE_INET_Addr remote (PORT, INADDR_BROADCAST);
+ ACE_SOCK_Dgram_Bcast dgram;
-<P><TT>&nbsp; char buf[512];</TT><TT></TT>
+ if (dgram.open (local) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "<font color=green>%p\n</font>", "<font color=green>open</font>"), -1);
+ }
-<P><TT>&nbsp; sprintf (buf, argc > 1 ? argv[1] : "Hello World!");</TT><TT></TT>
+ char buf[512];
-<P><TT>&nbsp; if (dgram.send (buf, strlen (buf) + 1, remote) == -1)</TT>
-<BR><TT>&nbsp; {</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp; ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"),
--1);</TT>
-<BR><TT>&nbsp; }</TT><TT></TT>
+ sprintf (buf, argc > 1 ? argv[1] : "<font color=green>Hello World!</font>");
-<P><TT>&nbsp; ACE_Time_Value timeout (2, 0);</TT>
-<BR><TT>&nbsp; if (dgram.recv (buf, sizeof (buf), remote, 0, &amp;timeout)
-== -1)</TT>
-<BR><TT>&nbsp; {</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp; ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "recv"),
--1);</TT>
-<BR><TT>&nbsp; }</TT><TT></TT>
+ if (dgram.send (buf, strlen (buf) + 1, remote) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "<font color=green>%p\n</font>", "<font color=green>send</font>"), -1);
+ }
-<P><TT>&nbsp; ACE_DEBUG ((LM_DEBUG, "(%P|%t) The server at (%s) said (%s)\n",</TT>
-<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-remote.get_host_name (), buf));</TT><TT></TT>
+ ACE_Time_Value timeout (2, 0);
+ if (dgram.recv (buf, sizeof (buf), remote, 0, &timeout) == -1)
+ {
+ ACE_ERROR_RETURN ((LM_ERROR, "<font color=green>%p\n</font>", "<font color=green>recv</font>"), -1);
+ }
-<P><TT>&nbsp; return (0);</TT>
-<BR><TT>}</TT>
+ ACE_DEBUG ((LM_DEBUG, "<font color=green>(%P|%t) The server at (%s) said (%s)\n</font>",
+ remote.get_host_name (), buf));
-<P>
-<HR WIDTH="100%">
-<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page05.html">Continue
-This Tutorial</A>]</CENTER>
-
-</BODY>
-</HTML>
+ return (0);
+}
+</PRE>
+<P><HR WIDTH="100%">
+<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page05.html">Continue This Tutorial</A>]</CENTER>
diff --git a/docs/tutorials/009/page05.html b/docs/tutorials/009/page05.html
index a48f78f8414..e1524d202ff 100644
--- a/docs/tutorials/009/page05.html
+++ b/docs/tutorials/009/page05.html
@@ -10,12 +10,11 @@
<CENTER><B><FONT SIZE=+2>ACE Tutorial 009</FONT></B></CENTER>
<CENTER><B><FONT SIZE=+2>Sending and receiving datagrams again</FONT></B></CENTER>
-&nbsp;
+
<P>
<HR WIDTH="100%">
-
-<P>In this tutorial we've expanded on Tutorial 8 to provide a more discriminating
+In this tutorial we've expanded on Tutorial 8 to provide a more discriminating
server application.&nbsp; The changes to the clients were trivial, amounting
to not much more than the addition of a timeout when reading a server's
potential response.&nbsp; The server change was a bit more since it had
@@ -43,8 +42,5 @@ match.
<A HREF="broadcast_client.cpp">broadcast_client.cpp</A></LI>
</UL>
-<HR WIDTH="100%">
-<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>]</CENTER>
-
-</BODY>
-</HTML>
+<P><HR WIDTH="100%">
+<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] </CENTER>
diff --git a/docs/tutorials/009/server.cpp b/docs/tutorials/009/server.cpp
index f73c7fd4ad3..e18488313de 100644
--- a/docs/tutorials/009/server.cpp
+++ b/docs/tutorials/009/server.cpp
@@ -60,14 +60,14 @@ int main (int argc, char *argv[])
*/
ACE_INET_Addr local ((u_short) 0);
- ACE_SOCK_Dgram client;
- if (client.open (local) == -1)
+ ACE_SOCK_Dgram peer;
+ if (peer.open (local) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "response open"), -1);
}
sprintf (buf, "I am here");
- if (client.send (buf, strlen (buf) + 1, remote) == -1)
+ if (peer.send (buf, strlen (buf) + 1, remote) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "response send"), -1);
}