blob: 7cb4d386b7b54df8d5949bcc31d05c573c44e1f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
<!-- $Id$ -->
<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>
|