summaryrefslogtreecommitdiff
path: root/docs/tutorials/009
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorials/009')
-rw-r--r--docs/tutorials/009/Makefile63
-rw-r--r--docs/tutorials/009/broadcast_client.cpp39
-rw-r--r--docs/tutorials/009/directed_client.cpp52
-rw-r--r--docs/tutorials/009/page01.html52
-rw-r--r--docs/tutorials/009/page02.html130
-rw-r--r--docs/tutorials/009/page03.html100
-rw-r--r--docs/tutorials/009/page04.html74
-rw-r--r--docs/tutorials/009/page05.html50
-rw-r--r--docs/tutorials/009/server.cpp78
9 files changed, 0 insertions, 638 deletions
diff --git a/docs/tutorials/009/Makefile b/docs/tutorials/009/Makefile
deleted file mode 100644
index 2bf85af82b7..00000000000
--- a/docs/tutorials/009/Makefile
+++ /dev/null
@@ -1,63 +0,0 @@
-#----------------------------------------------------------------------------
-# $Id$
-#----------------------------------------------------------------------------
-
-#----------------------------------------------------------------------------
-# Local macros
-#----------------------------------------------------------------------------
-
-BIN = server directed_client broadcast_client
-
-FILES =
-
-BUILD = $(VBIN)
-
-SRC = $(addsuffix .cpp,$(BIN))
-
-HDR = *.h
-
-#----------------------------------------------------------------------------
-# Include macros and targets
-#----------------------------------------------------------------------------
-
-include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
-include $(ACE_ROOT)/include/makeinclude/macros.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
-#----------------------------------------------------------------------------
-
-Indent : #
- for i in $(SRC) $(HDR) ; do \
- indent -npsl -bli0 -l80 -fca -fc1 -cli0 -cdb < $$i | \
- sed -e 's/: :/::/g' \
- -e 's/^.*\(public:\)/\1/' \
- -e 's/^.*\(protected:\)/\1/' \
- -e 's/^.*\(private:\)/\1/' \
- -e 's/:\(public\)/ : \1/' \
- -e 's/:\(protected\)/ : \1/' \
- -e 's/:\(private\)/ : \1/' \
- > $$i~ ;\
- mv $$i~ $$i ;\
- done
-
-Depend : depend
- perl ../fix.Makefile
-
-.depend : #
- touch .depend
-
-#----------------------------------------------------------------------------
-# Dependencies
-#----------------------------------------------------------------------------
-
- # Don't put anything below here. Between the "depend" target and fix.Makefile
- # it's guaranteed to be lost!
-
- # This is inserted by the fix.Makefile script
-include .depend
diff --git a/docs/tutorials/009/broadcast_client.cpp b/docs/tutorials/009/broadcast_client.cpp
deleted file mode 100644
index 76ff454d066..00000000000
--- a/docs/tutorials/009/broadcast_client.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-
-// $Id$
-
-#include "ace/SOCK_Dgram_Bcast.h"
-#include "ace/INET_Addr.h"
-
-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, INADDR_BROADCAST);
- ACE_SOCK_Dgram_Bcast dgram;
-
- if (dgram.open (local) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), -1);
- }
-
- char buf[512];
-
- sprintf (buf, argc > 1 ? argv[1] : "Hello World!");
-
- if (dgram.send (buf, strlen (buf) + 1, remote) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"), -1);
- }
-
- ACE_Time_Value timeout (2, 0);
- if (dgram.recv (buf, sizeof (buf), remote, 0, &timeout) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "recv"), -1);
- }
-
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) The server at (%s) said (%s)\n",
- remote.get_host_name (), buf));
-
- return (0);
-}
diff --git a/docs/tutorials/009/directed_client.cpp b/docs/tutorials/009/directed_client.cpp
deleted file mode 100644
index 7156286bec1..00000000000
--- a/docs/tutorials/009/directed_client.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-
-// $Id$
-
-#include "ace/SOCK_Dgram.h"
-#include "ace/INET_Addr.h"
-
-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] : "localhost");
- ACE_SOCK_Dgram dgram;
-
- if (dgram.open (local) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "open"), -1);
- }
-
- char buf[512];
-
- /*
- In order to conform to the "protocol" requried by the server,
- we allow the user to specify a signature. A default matching
- the server's default is also available.
- */
- sprintf (buf, argc > 2 ? argv[2] : "Hello World!");
-
- if (dgram.send (buf, strlen (buf) + 1, remote) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"), -1);
- }
-
- /*
- 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.
- */
- ACE_Time_Value timeout (2, 0);
- if (dgram.recv (buf, sizeof (buf), remote, 0, &timeout) == -1)
- {
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "recv"), -1);
- }
-
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) The server said (%s)\n", buf));
-
- return (0);
-}
diff --git a/docs/tutorials/009/page01.html b/docs/tutorials/009/page01.html
deleted file mode 100644
index 77bacc3d4cc..00000000000
--- a/docs/tutorials/009/page01.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="GENERATOR" CONTENT="Mozilla/4.04 [en] (X11; I; Linux 2.0.32 i486) [Netscape]">
- <META NAME="Author" CONTENT="James CE Johnson">
- <TITLE>ACE Tutorial 009</TITLE>
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F">
-
-<CENTER><B><FONT SIZE=+2>ACE Tutorial 009</FONT></B></CENTER>
-
-<CENTER><B><FONT SIZE=+2>Sending and receiving datagrams again</FONT></B></CENTER>
-
-
-<P>
-<HR WIDTH="100%">
-
-<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.
-
-<P>Why is this important?
-
-<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.
-
-<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><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="..">Tutorial Index</A>] [<A HREF="page02.html">Continue
-This Tutorial</A>]</CENTER>
-
-</BODY>
-</HTML>
diff --git a/docs/tutorials/009/page02.html b/docs/tutorials/009/page02.html
deleted file mode 100644
index e2997a16409..00000000000
--- a/docs/tutorials/009/page02.html
+++ /dev/null
@@ -1,130 +0,0 @@
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="GENERATOR" CONTENT="Mozilla/4.04 [en] (X11; I; Linux 2.0.32 i486) [Netscape]">
- <META NAME="Author" CONTENT="James CE Johnson">
- <TITLE>ACE Tutorial 009</TITLE>
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F">
-
-<CENTER><B><FONT SIZE=+2>ACE Tutorial 009</FONT></B></CENTER>
-
-<CENTER><B><FONT SIZE=+2>Sending and receiving datagrams again</FONT></B></CENTER>
-
-
-<P>
-<HR WIDTH="100%">
-
-<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.
-
-<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>
-<HR WIDTH="100%">
-
-<P>Let's move on and see what changes the clients require...
-
-<P>
-<HR WIDTH="100%">
-<CENTER>[<A HREF="..">Tutorial Index</A>] [<A HREF="page03.html">Continue
-This Tutorial</A>]</CENTER>
-
-</BODY>
-</HTML>
diff --git a/docs/tutorials/009/page03.html b/docs/tutorials/009/page03.html
deleted file mode 100644
index 447bf38d497..00000000000
--- a/docs/tutorials/009/page03.html
+++ /dev/null
@@ -1,100 +0,0 @@
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="GENERATOR" CONTENT="Mozilla/4.04 [en] (X11; I; Linux 2.0.32 i486) [Netscape]">
- <META NAME="Author" CONTENT="James CE Johnson">
- <TITLE>ACE Tutorial 009</TITLE>
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F">
-
-<CENTER><B><FONT SIZE=+2>ACE Tutorial 009</FONT></B></CENTER>
-
-<CENTER><B><FONT SIZE=+2>Sending and receiving datagrams again</FONT></B></CENTER>
-
-
-<P>
-<HR WIDTH="100%">
-
-<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.
-
-<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%">
-
-<P>On the next page, we see that the directed_client gets similar upgrades.
-
-<P>
-<HR WIDTH="100%">
-<CENTER>[<A HREF="..">Tutorial Index</A>] [<A HREF="page04.html">Continue
-This Tutorial</A>]</CENTER>
-
-</BODY>
-</HTML>
diff --git a/docs/tutorials/009/page04.html b/docs/tutorials/009/page04.html
deleted file mode 100644
index e1875503b8c..00000000000
--- a/docs/tutorials/009/page04.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="GENERATOR" CONTENT="Mozilla/4.04 [en] (X11; I; Linux 2.0.32 i486) [Netscape]">
- <META NAME="Author" CONTENT="James CE Johnson">
- <TITLE>ACE Tutorial 009</TITLE>
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F">
-
-<CENTER><B><FONT SIZE=+2>ACE Tutorial 009</FONT></B></CENTER>
-
-<CENTER><B><FONT SIZE=+2>Sending and receiving datagrams again</FONT></B></CENTER>
-
-
-<P>
-<HR WIDTH="100%">
-
-<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().
-
-<P>
-<HR WIDTH="100%"><TT></TT>
-
-<P><TT>#include "ace/SOCK_Dgram_Bcast.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, INADDR_BROADCAST);</TT>
-<BR><TT>&nbsp; ACE_SOCK_Dgram_Bcast 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; sprintf (buf, argc > 1 ? argv[1] : "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; 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 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>
-
-<P><TT>&nbsp; return (0);</TT>
-<BR><TT>}</TT>
-
-<P>
-<HR WIDTH="100%">
-<CENTER>[<A HREF="..">Tutorial Index</A>] [<A HREF="page05.html">Continue
-This Tutorial</A>]</CENTER>
-
-</BODY>
-</HTML>
diff --git a/docs/tutorials/009/page05.html b/docs/tutorials/009/page05.html
deleted file mode 100644
index 771e113e961..00000000000
--- a/docs/tutorials/009/page05.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<HTML>
-<HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
- <META NAME="GENERATOR" CONTENT="Mozilla/4.04 [en] (X11; I; Linux 2.0.32 i486) [Netscape]">
- <META NAME="Author" CONTENT="James CE Johnson">
- <TITLE>ACE Tutorial 009</TITLE>
-</HEAD>
-<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F">
-
-<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
-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.
-
-<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.
-
-<P>Here's the final file list:
-<UL>
-<LI>
-<A HREF="Makefile">Makefile</A></LI>
-
-<LI>
-<A HREF="server.cpp">server.cpp</A></LI>
-
-<LI>
-<A HREF="directed_client.cpp">directed_client.cpp</A></LI>
-
-<LI>
-<A HREF="broadcast_client.cpp">broadcast_client.cpp</A></LI>
-</UL>
-
-<HR WIDTH="100%">
-<CENTER>[<A HREF="..">Tutorial Index</A>]</CENTER>
-
-</BODY>
-</HTML>
diff --git a/docs/tutorials/009/server.cpp b/docs/tutorials/009/server.cpp
deleted file mode 100644
index f73c7fd4ad3..00000000000
--- a/docs/tutorials/009/server.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-
-// $Id$
-
-/*
- 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.
- */
-
-#include "ace/SOCK_Dgram.h"
-#include "ace/INET_Addr.h"
-
-static const u_short PORT = ACE_DEFAULT_SERVER_PORT;
-
-/*
- In order to be more selective, our server will be started with a
- "signature". If none is given, we'll use the one here instead.
- */
-static const char *default_signature = "Hello World!";
-
-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, "%p\n", "open"), -1);
- }
-
- char buf[512];
- ACE_INET_Addr remote;
-
- while (dgram.recv (buf, sizeof (buf), remote) != -1)
- {
- /*
- What did the client say?
- */
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) Received (%s) from (%s)\n", buf, remote.get_host_name ()));
-
- /*
- 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.
- */
- if (ACE_OS::strcmp (buf, argc > 1 ? argv[1] : default_signature))
- {
- /*
- If the client didn't say something we like then log it and move on.
- */
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) Client query does not match our signature (%s). Response not sent.\n",
- argc > 1 ? argv[1] : default_signature));
- }
- else
- {
- /*
- As before, we respond to the client's query.
- */
-
- ACE_INET_Addr local ((u_short) 0);
- ACE_SOCK_Dgram client;
- if (client.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)
- {
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "response send"), -1);
- }
- }
- }
-
- return (0);
-}