paradigm_3/html/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Server class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.17 -->
<center>
<a class="qindex" href="main.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><h1>Server Class Reference</h1><code>#include &lt;<a class="el" href="server_8h-source.html">server.h</a>&gt;</code>
<p>
Collaboration diagram for Server:<p><center><img src="classServer__coll__graph.gif" border="0" usemap="#Server__coll__map" alt="Collaboration graph"></center>
<map name="Server__coll__map">
<area href="classLog.html" shape="rect" coords="5,0,43,18" alt="">
<area href="classEventQueue.html" shape="rect" coords="83,0,160,18" alt="">
</map>
<center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center><a href="classServer-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a0">Server</a> (<a class="el" href="classEventQueue.html">EventQueue</a> &amp;r_inque, <a class="el" href="classEventQueue.html">EventQueue</a> &amp;r_outque, <a class="el" href="classLog.html">Log</a> &amp;r_lgfile)</td></tr>
<tr><td nowrap align=right valign=top>virtual&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a1">~Server</a> ()</td></tr>
<tr><td nowrap align=right valign=top>virtual bool&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a2">Boot</a> (unsigned short port)</td></tr>
<tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a3">Run</a> (void *parms)</td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="classLog.html">Log</a> &amp;&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#a4">ServerLog</a> ()</td></tr>
<tr><td colspan=2><br><h2>Private Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#c0">Server</a> (const Server &amp;)</td></tr>
<tr><td nowrap align=right valign=top>Server &amp;&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#c1">operator=</a> (const Server &amp;)</td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#c2">AcceptConnection</a> ()</td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#c3">InitFDs</a> ()</td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#c4">ProcessQueue</a> ()</td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#c5">ShutdownServer</a> ()</td></tr>
<tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#c6">SetNonBlocking</a> (SOCKET s)</td></tr>
<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
<tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#o0">mShutdown</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Flag to indicate that server is shutting down.</em> <a href="#o0"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>fd_set&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#o1">mInputFDs</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Array of input sockets that select will test.</em> <a href="#o1"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>fd_set&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#o2">mOutputFDs</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Array of output sockets that select will test.</em> <a href="#o2"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>SOCKET&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#o3">mAcceptor</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Listening socket for incoming connections.</em> <a href="#o3"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>sockaddr_in&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#o4">mTo</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Network address of the server port.</em> <a href="#o4"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="server_8h.html#a0">ConnList</a>&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#o5">mConns</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>List of Connections managed by this server.</em> <a href="#o5"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#o6">mNumFds</a></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="classLog.html">Log</a> &amp;&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#o7">mrLog</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Server's log.</em> <a href="#o7"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="classEventQueue.html">EventQueue</a> &amp;&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#o8">mrInQueue</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Incoming events.</em> <a href="#o8"></a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="classEventQueue.html">EventQueue</a> &amp;&nbsp;</td><td valign=bottom><a class="el" href="classServer.html#o9">mrOutQueue</a></td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Outgoing events.</em> <a href="#o9"></a><em></em></font><br><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The Server class defines a singleton representation of a internet server. It defines the traditional non-blocking select() server.
<p>
<dl compact><dt><b>Note: </b></dt><dd>
 No reason why this should be a singleton as long as different ports are served.</dl><dl compact><dt><b><a class="el" href="todo.html#_todo000008">Todo: </a></b></dt><dd>
 Make Server an abstract class overriding its Run method to illustrate different network designs as well as different kinds of servers, e.g. httpd, ftpd, and telnetd. </dl> 
<p>

<p>
Definition at line <a class="el" href="server_8h-source.html#l00032">32</a> of file <a class="el" href="server_8h-source.html">server.h</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a name="a0" doxytag="Server::Server"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> Server::Server </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="classEventQueue.html">EventQueue</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>r_inque</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="classEventQueue.html">EventQueue</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>r_outque</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap><a class="el" href="classLog.html">Log</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>r_lgfile</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Constructor for Server 
<p>
Definition at line <a class="el" href="server_8cpp-source.html#l00016">16</a> of file <a class="el" href="server_8cpp-source.html">server.cpp</a>.    </td>
  </tr>
</table>
<a name="a1" doxytag="Server::~Server"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> Server::~Server </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Destructor for Server
<p>
<dl compact><dt><b>Note: </b></dt><dd>
 If we shutdown normally we should not have any connections in our list but we will attempt to delete them anyways. Maybe we should assert this. </dl>
<p>
Definition at line <a class="el" href="server_8cpp-source.html#l00028">28</a> of file <a class="el" href="server_8cpp-source.html">server.cpp</a>.
<p>
References <a class="el" href="server_8h-source.html#l00049">mConns</a>.    </td>
  </tr>
</table>
<a name="c0" doxytag="Server::Server"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> Server::Server </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const Server &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="c2" doxytag="Server::AcceptConnection"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void Server::AcceptConnection </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
AcceptConnection handles an incoming connection request on the server's listening port by creating a <a class="el" href="classConnection.html">Connection</a> object for the socket.
<p>
<dl compact><dt><b>Remarks: </b></dt><dd>
 Dang this code looks dense. </dl>
<p>
Definition at line <a class="el" href="server_8cpp-source.html#l00174">174</a> of file <a class="el" href="server_8cpp-source.html">server.cpp</a>.
<p>
References <a class="el" href="event_8h.html#a5a1">CONNECT_E</a>, <a class="el" href="connection_8cpp-source.html#l00211">Connection::GetSocket</a>(), <a class="el" href="server_8h-source.html#l00047">mAcceptor</a>, <a class="el" href="server_8h-source.html#l00049">mConns</a>, <a class="el" href="server_8h-source.html#l00054">mrOutQueue</a>, <a class="el" href="eventqueue_8cpp-source.html#l00052">EventQueue::Push</a>(), <a class="el" href="server_8cpp-source.html#l00314">ServerLog</a>(), <a class="el" href="server_8cpp-source.html#l00325">SetNonBlocking</a>(), and <a class="el" href="log_8cpp-source.html#l00089">Log::Write</a>().
<p>
Referenced by <a class="el" href="server_8cpp-source.html#l00103">Run</a>().    </td>
  </tr>
</table>
<a name="a2" doxytag="Server::Boot"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool Server::Boot </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">unsigned short&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp; <em>port</em>          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Boot initializes the Server and gets it ready to accept incoming Connections.
<p>
<dl compact><dt><b>Returns :</b></dt><dd>
true if server boots correctly, false if an error occurs. </dl>
<p>
Definition at line <a class="el" href="server_8cpp-source.html#l00041">41</a> of file <a class="el" href="server_8cpp-source.html">server.cpp</a>.
<p>
References <a class="el" href="server_8h-source.html#l00047">mAcceptor</a>, <a class="el" href="server_8h-source.html#l00050">mNumFds</a>, <a class="el" href="server_8h-source.html#l00048">mTo</a>, <a class="el" href="server_8cpp-source.html#l00314">ServerLog</a>(), <a class="el" href="server_8cpp-source.html#l00325">SetNonBlocking</a>(), and <a class="el" href="log_8cpp-source.html#l00089">Log::Write</a>().
<p>
Referenced by <a class="el" href="paradigm_8cpp-source.html#l00175">main</a>().    </td>
  </tr>
</table>
<a name="c3" doxytag="Server::InitFDs"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void Server::InitFDs </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
InitFDs initializes the server's select queue and then re-registers interest in all the connection's sockets in the server's user list including the server's listening port itself.
<p>
<dl compact><dt><b>Note: </b></dt><dd>
 It may well be more efficient to register or unregister interest on a connection by connection basis in the various connection handling routines.</dl><dl compact><dt><b>Remarks: </b></dt><dd>
 [1] On Windows, setting interest in all connected sockets for output will cause our select loop to spin. So we only set it if we know there is output waiting. </dl>
<p>
Definition at line <a class="el" href="server_8cpp-source.html#l00211">211</a> of file <a class="el" href="server_8cpp-source.html">server.cpp</a>.
<p>
References <a class="el" href="server_8h-source.html#l00047">mAcceptor</a>, <a class="el" href="server_8h-source.html#l00049">mConns</a>, <a class="el" href="server_8h-source.html#l00045">mInputFDs</a>, <a class="el" href="server_8h-source.html#l00050">mNumFds</a>, and <a class="el" href="server_8h-source.html#l00046">mOutputFDs</a>.
<p>
Referenced by <a class="el" href="server_8cpp-source.html#l00103">Run</a>().    </td>
  </tr>
</table>
<a name="c1" doxytag="Server::operator="></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> Server&amp; Server::operator= </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const Server &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
    </td>
  </tr>
</table>
<a name="c4" doxytag="Server::ProcessQueue"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void Server::ProcessQueue </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
ProcessQueue attempts to process all the events contained in the eventqueue coming from our chat engine.
<p>
<dl compact><dt><b>Remarks: </b></dt><dd>
 The are only two kinds of messages.<ul>
<li>@shutdown - requests the server to shutdown<li>everything else is interpreted as public conversation</ul>
</dl><dl compact><dt><b><a class="el" href="todo.html#_todo000007">Todo: </a></b></dt><dd>
 Implement a disconnect request coming from driver. Allow specialized Telnet commands to come from driver, and filter them through the connection depending on whether it is capable. </dl> 
<p>
Definition at line <a class="el" href="server_8cpp-source.html#l00244">244</a> of file <a class="el" href="server_8cpp-source.html">server.cpp</a>.
<p>
References <a class="el" href="event_8h.html#a5a1">CONNECT_E</a>, <a class="el" href="event_8h.html#a5a2">DISCONNECT_E</a>, <a class="el" href="event_8h-source.html#l00040">Event::mClientId</a>, <a class="el" href="server_8h-source.html#l00049">mConns</a>, <a class="el" href="event_8h-source.html#l00041">Event::mDataLen</a>, <a class="el" href="event_8h.html#a5a3">MESSAGE_E</a>, <a class="el" href="event_8h-source.html#l00039">Event::mEventType</a>, <a class="el" href="server_8h-source.html#l00046">mOutputFDs</a>, <a class="el" href="event_8h-source.html#l00042">Event::mpData</a>, <a class="el" href="server_8h-source.html#l00053">mrInQueue</a>, <a class="el" href="server_8h-source.html#l00044">mShutdown</a>, <a class="el" href="event_8h.html#a5a0">NONE_E</a>, <a class="el" href="eventqueue_8cpp-source.html#l00068">EventQueue::Pop</a>(), and <a class="el" href="event_8h.html#a5a4">SHUTDOWN_E</a>.
<p>
Referenced by <a class="el" href="server_8cpp-source.html#l00103">Run</a>().    </td>
  </tr>
</table>
<a name="a3" doxytag="Server::Run"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void Server::Run </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp; <em>parms</em>          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Run starts the Server running to process incoming connection, input and output requests. It also executes commands from input requests.
<p>
/param parms Not used.
<p>
/note This should be where we begin threading. Not in Boot.
<p>
/todo Polling time should runtime reconfigurable. 
<p>
Definition at line <a class="el" href="server_8cpp-source.html#l00103">103</a> of file <a class="el" href="server_8cpp-source.html">server.cpp</a>.
<p>
References <a class="el" href="server_8cpp-source.html#l00174">AcceptConnection</a>(), <a class="el" href="event_8h.html#a5a2">DISCONNECT_E</a>, <a class="el" href="server_8cpp-source.html#l00211">InitFDs</a>(), <a class="el" href="server_8h-source.html#l00047">mAcceptor</a>, <a class="el" href="server_8h-source.html#l00049">mConns</a>, <a class="el" href="event_8h.html#a5a3">MESSAGE_E</a>, <a class="el" href="server_8h-source.html#l00045">mInputFDs</a>, <a class="el" href="server_8h-source.html#l00050">mNumFds</a>, <a class="el" href="server_8h-source.html#l00046">mOutputFDs</a>, <a class="el" href="server_8h-source.html#l00054">mrOutQueue</a>, <a class="el" href="server_8h-source.html#l00044">mShutdown</a>, <a class="el" href="server_8cpp-source.html#l00244">ProcessQueue</a>(), <a class="el" href="eventqueue_8cpp-source.html#l00052">EventQueue::Push</a>(), <a class="el" href="server_8cpp-source.html#l00314">ServerLog</a>(), <a class="el" href="server_8cpp-source.html#l00291">ShutdownServer</a>(), and <a class="el" href="log_8cpp-source.html#l00089">Log::Write</a>().
<p>
Referenced by <a class="el" href="paradigm_8cpp-source.html#l00224">StartServer</a>().    </td>
  </tr>
</table>
<a name="a4" doxytag="Server::ServerLog"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="classLog.html">Log</a> &amp; Server::ServerLog </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
ServerLog returns a reference to this server's logging utility so that messages can be written to it by its associates and aggregates.
<p>
<dl compact><dt><b>Returns :</b></dt><dd>
a reference to this server's <a class="el" href="classLog.html">Log</a> </dl>
<p>
Definition at line <a class="el" href="server_8cpp-source.html#l00314">314</a> of file <a class="el" href="server_8cpp-source.html">server.cpp</a>.
<p>
References <a class="el" href="server_8h-source.html#l00052">mrLog</a>.
<p>
Referenced by <a class="el" href="server_8cpp-source.html#l00174">AcceptConnection</a>(), <a class="el" href="server_8cpp-source.html#l00041">Boot</a>(), <a class="el" href="connection_8cpp-source.html#l00162">Connection::Disconnect</a>(), <a class="el" href="connection_8cpp-source.html#l00073">Connection::HandleInput</a>(), <a class="el" href="connection_8cpp-source.html#l00135">Connection::HandleOutput</a>(), <a class="el" href="server_8cpp-source.html#l00103">Run</a>(), <a class="el" href="server_8cpp-source.html#l00325">SetNonBlocking</a>(), and <a class="el" href="server_8cpp-source.html#l00291">ShutdownServer</a>().    </td>
  </tr>
</table>
<a name="c6" doxytag="Server::SetNonBlocking"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool Server::SetNonBlocking </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">SOCKET&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp; <em>s</em>          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
ServerLog returns a reference to this server's logging utility so that messages can be written to it by its associates and aggregates.<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>s</em>&nbsp;</td><td>
The socket to be set non-blocking. </td></tr>
</table>
</dl><dl compact><dt><b>Returns :</b></dt><dd>
true if successful, false if unsuccessful. </dl>
<p>
Definition at line <a class="el" href="server_8cpp-source.html#l00325">325</a> of file <a class="el" href="server_8cpp-source.html">server.cpp</a>.
<p>
References <a class="el" href="server_8cpp-source.html#l00314">ServerLog</a>(), and <a class="el" href="log_8cpp-source.html#l00089">Log::Write</a>().
<p>
Referenced by <a class="el" href="server_8cpp-source.html#l00174">AcceptConnection</a>(), and <a class="el" href="server_8cpp-source.html#l00041">Boot</a>().    </td>
  </tr>
</table>
<a name="c5" doxytag="Server::ShutdownServer"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void Server::ShutdownServer </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>
          <td class="md" valign="top">)&nbsp;</td>
          <td class="md" nowrap><code> [private]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
ShutdownServer requests each of the connections to disconnect in the server's user list, deletes the connections, and erases them from the user list. It then closes its own listening port. 
<p>
Definition at line <a class="el" href="server_8cpp-source.html#l00291">291</a> of file <a class="el" href="server_8cpp-source.html">server.cpp</a>.
<p>
References <a class="el" href="event_8h.html#a5a2">DISCONNECT_E</a>, <a class="el" href="server_8h-source.html#l00047">mAcceptor</a>, <a class="el" href="server_8h-source.html#l00049">mConns</a>, <a class="el" href="server_8h-source.html#l00054">mrOutQueue</a>, <a class="el" href="eventqueue_8cpp-source.html#l00052">EventQueue::Push</a>(), <a class="el" href="server_8cpp-source.html#l00314">ServerLog</a>(), <a class="el" href="event_8h.html#a5a4">SHUTDOWN_E</a>, and <a class="el" href="log_8cpp-source.html#l00089">Log::Write</a>().
<p>
Referenced by <a class="el" href="server_8cpp-source.html#l00103">Run</a>().    </td>
  </tr>
</table>
<hr><h2>Member Data Documentation</h2>
<a name="o3" doxytag="Server::mAcceptor"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> SOCKET Server::mAcceptor<code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Listening socket for incoming connections.
<p>

<p>
Definition at line <a class="el" href="server_8h-source.html#l00047">47</a> of file <a class="el" href="server_8h-source.html">server.h</a>.
<p>
Referenced by <a class="el" href="server_8cpp-source.html#l00174">AcceptConnection</a>(), <a class="el" href="server_8cpp-source.html#l00041">Boot</a>(), <a class="el" href="server_8cpp-source.html#l00211">InitFDs</a>(), <a class="el" href="server_8cpp-source.html#l00103">Run</a>(), and <a class="el" href="server_8cpp-source.html#l00291">ShutdownServer</a>().    </td>
  </tr>
</table>
<a name="o5" doxytag="Server::mConns"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="server_8h.html#a0">ConnList</a> Server::mConns<code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
List of Connections managed by this server.
<p>

<p>
Definition at line <a class="el" href="server_8h-source.html#l00049">49</a> of file <a class="el" href="server_8h-source.html">server.h</a>.
<p>
Referenced by <a class="el" href="server_8cpp-source.html#l00174">AcceptConnection</a>(), <a class="el" href="server_8cpp-source.html#l00211">InitFDs</a>(), <a class="el" href="server_8cpp-source.html#l00244">ProcessQueue</a>(), <a class="el" href="server_8cpp-source.html#l00103">Run</a>(), <a class="el" href="server_8cpp-source.html#l00291">ShutdownServer</a>(), and <a class="el" href="server_8cpp-source.html#l00028">~Server</a>().    </td>
  </tr>
</table>
<a name="o1" doxytag="Server::mInputFDs"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> fd_set Server::mInputFDs<code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Array of input sockets that select will test.
<p>

<p>
Definition at line <a class="el" href="server_8h-source.html#l00045">45</a> of file <a class="el" href="server_8h-source.html">server.h</a>.
<p>
Referenced by <a class="el" href="server_8cpp-source.html#l00211">InitFDs</a>(), and <a class="el" href="server_8cpp-source.html#l00103">Run</a>().    </td>
  </tr>
</table>
<a name="o6" doxytag="Server::mNumFds"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> int Server::mNumFds<code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="server_8h-source.html#l00050">50</a> of file <a class="el" href="server_8h-source.html">server.h</a>.
<p>
Referenced by <a class="el" href="server_8cpp-source.html#l00041">Boot</a>(), <a class="el" href="server_8cpp-source.html#l00211">InitFDs</a>(), and <a class="el" href="server_8cpp-source.html#l00103">Run</a>().    </td>
  </tr>
</table>
<a name="o2" doxytag="Server::mOutputFDs"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> fd_set Server::mOutputFDs<code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Array of output sockets that select will test.
<p>

<p>
Definition at line <a class="el" href="server_8h-source.html#l00046">46</a> of file <a class="el" href="server_8h-source.html">server.h</a>.
<p>
Referenced by <a class="el" href="server_8cpp-source.html#l00211">InitFDs</a>(), <a class="el" href="server_8cpp-source.html#l00244">ProcessQueue</a>(), and <a class="el" href="server_8cpp-source.html#l00103">Run</a>().    </td>
  </tr>
</table>
<a name="o8" doxytag="Server::mrInQueue"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="classEventQueue.html">EventQueue</a>&amp; Server::mrInQueue<code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Incoming events.
<p>

<p>
Definition at line <a class="el" href="server_8h-source.html#l00053">53</a> of file <a class="el" href="server_8h-source.html">server.h</a>.
<p>
Referenced by <a class="el" href="server_8cpp-source.html#l00244">ProcessQueue</a>().    </td>
  </tr>
</table>
<a name="o7" doxytag="Server::mrLog"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="classLog.html">Log</a>&amp; Server::mrLog<code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Server's log.
<p>

<p>
Definition at line <a class="el" href="server_8h-source.html#l00052">52</a> of file <a class="el" href="server_8h-source.html">server.h</a>.
<p>
Referenced by <a class="el" href="server_8cpp-source.html#l00314">ServerLog</a>().    </td>
  </tr>
</table>
<a name="o9" doxytag="Server::mrOutQueue"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> <a class="el" href="classEventQueue.html">EventQueue</a>&amp; Server::mrOutQueue<code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Outgoing events.
<p>

<p>
Definition at line <a class="el" href="server_8h-source.html#l00054">54</a> of file <a class="el" href="server_8h-source.html">server.h</a>.
<p>
Referenced by <a class="el" href="server_8cpp-source.html#l00174">AcceptConnection</a>(), <a class="el" href="server_8cpp-source.html#l00103">Run</a>(), and <a class="el" href="server_8cpp-source.html#l00291">ShutdownServer</a>().    </td>
  </tr>
</table>
<a name="o0" doxytag="Server::mShutdown"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool Server::mShutdown<code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Flag to indicate that server is shutting down.
<p>

<p>
Definition at line <a class="el" href="server_8h-source.html#l00044">44</a> of file <a class="el" href="server_8h-source.html">server.h</a>.
<p>
Referenced by <a class="el" href="server_8cpp-source.html#l00244">ProcessQueue</a>(), and <a class="el" href="server_8cpp-source.html#l00103">Run</a>().    </td>
  </tr>
</table>
<a name="o4" doxytag="Server::mTo"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> struct sockaddr_in Server::mTo<code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Network address of the server port.
<p>

<p>
Definition at line <a class="el" href="server_8h-source.html#l00048">48</a> of file <a class="el" href="server_8h-source.html">server.h</a>.
<p>
Referenced by <a class="el" href="server_8cpp-source.html#l00041">Boot</a>().    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="server_8h-source.html">server.h</a><li><a class="el" href="server_8cpp-source.html">server.cpp</a></ul>
<hr><address style="align: right;"><small>Generated on Mon Mar 29 23:12:58 2004 for Paradigm by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.17 </small></address>
</body>
</html>