Sophie

Sophie

distrib > Mandriva > 10.0-com > i586 > by-pkgid > 21280410b6ea906d791d7a12afae2579 > files > 44

libace5-doc-5.4-2mdk.i586.rpm

<!-- page01.html,v 1.5 2000/03/19 20:09:20 jcej Exp -->
<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">
   <META NAME="Description" CONTENT="A first step towards using ACE productively">
   <TITLE>ACE Tutorial 002</TITLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000FFF" VLINK="#FF0F0F">

<CENTER><B><FONT SIZE=+2>ACE Tutorial 002</FONT></B></CENTER>

<CENTER><B><FONT SIZE=+2>Creating a Better Server</FONT></B></CENTER>


<P>
<HR WIDTH="100%">

<P>In this tutorial, we will build a little on what we learned in the first
tutorial and add a few extras. In the end, we will have a better server
object that is actually simpler and more maintainable than the one we created
before.</P>

<P>
<HR WIDTH="100%"></P>

<P>To begin, let's ask ourselves the same thing we did at the beginning
of tutorial 001:</P>

<UL>
<P>What do you need to create a server?</P>
</UL>

<OL>
<OL>
<LI>Something which accepts connections from clients</LI>

<LI>Something which handles established connections</LI>

<LI>A main program loop that handles it all</LI>
</OL>
</OL>

<P>Previously, we created a solution which addressed each one of these
questions specifically. At the end of it all, we realized that our only
application-specific coding was confined to the <I>handler</I> portion
of the program. We hinted that there may be a way to eliminate hand-coding
an <I>acceptor</I> each time we want to create a server. Here, we will
explore that approach.</P>

<P><HR WIDTH="100%">
<CENTER>[<A HREF="../online-tutorials.html">Tutorial Index</A>] [<A HREF="page02.html">Continue This Tutorial</A>]</CENTER>