tmud-2.9.0/benchmark/
tmud-2.9.0/cmd/
tmud-2.9.0/cmd/objects/
tmud-2.9.0/cmd/tiny/
tmud-2.9.0/db/
tmud-2.9.0/doc/classes/Acceptor.src/
tmud-2.9.0/doc/classes/BoolExpParser.src/
tmud-2.9.0/doc/classes/CacheStats.src/
tmud-2.9.0/doc/classes/Character.src/
tmud-2.9.0/doc/classes/Client.src/
tmud-2.9.0/doc/classes/ColorFilter.src/
tmud-2.9.0/doc/classes/Command.src/
tmud-2.9.0/doc/classes/Configuration.src/
tmud-2.9.0/doc/classes/Connector.src/
tmud-2.9.0/doc/classes/ConsoleClient.src/
tmud-2.9.0/doc/classes/CursesClient.src/
tmud-2.9.0/doc/classes/DebugFilter.src/
tmud-2.9.0/doc/classes/Dumper.src/
tmud-2.9.0/doc/classes/Engine.src/
tmud-2.9.0/doc/classes/Event.src/
tmud-2.9.0/doc/classes/EventManager.src/
tmud-2.9.0/doc/classes/Farts/AttributeSyntaxNode.src/
tmud-2.9.0/doc/classes/Farts/CallSyntaxNode.src/
tmud-2.9.0/doc/classes/Farts/CommandSyntaxNode.src/
tmud-2.9.0/doc/classes/Farts/CommentSyntaxNode.src/
tmud-2.9.0/doc/classes/Farts/EndSyntaxNode.src/
tmud-2.9.0/doc/classes/Farts/IfSyntaxNode.src/
tmud-2.9.0/doc/classes/Farts/Interpreter.src/
tmud-2.9.0/doc/classes/Farts/Lexer.src/
tmud-2.9.0/doc/classes/Farts/Lib.src/
tmud-2.9.0/doc/classes/Farts/LiteralSyntaxNode.src/
tmud-2.9.0/doc/classes/Farts/LocalVarSyntaxNode.src/
tmud-2.9.0/doc/classes/Farts/Parser.src/
tmud-2.9.0/doc/classes/Farts/ProgramSyntaxNode.src/
tmud-2.9.0/doc/classes/Farts/SyntaxNode.src/
tmud-2.9.0/doc/classes/Filter.src/
tmud-2.9.0/doc/classes/LineIO.src/
tmud-2.9.0/doc/classes/Loader.src/
tmud-2.9.0/doc/classes/Log.src/
tmud-2.9.0/doc/classes/Module.src/
tmud-2.9.0/doc/classes/ObjCmd.src/
tmud-2.9.0/doc/classes/PacketIO.src/
tmud-2.9.0/doc/classes/ProtocolStack.src/
tmud-2.9.0/doc/classes/Publisher.src/
tmud-2.9.0/doc/classes/Reactor.src/
tmud-2.9.0/doc/classes/Room.src/
tmud-2.9.0/doc/classes/SQLite/
tmud-2.9.0/doc/classes/SQLite/Database.src/
tmud-2.9.0/doc/classes/SQLite3/
tmud-2.9.0/doc/classes/SQLite3/Database.src/
tmud-2.9.0/doc/classes/Script.src/
tmud-2.9.0/doc/classes/SockIO.src/
tmud-2.9.0/doc/classes/String.src/
tmud-2.9.0/doc/classes/TerminalFilter.src/
tmud-2.9.0/doc/classes/TernaryTrie.src/
tmud-2.9.0/doc/classes/TernaryTrie/
tmud-2.9.0/doc/classes/TernaryTrie/TNode.src/
tmud-2.9.0/doc/classes/Timer.src/
tmud-2.9.0/doc/classes/Utility.src/
tmud-2.9.0/doc/classes/XmlStore.src/
tmud-2.9.0/doc/classes/YamlStore.src/
tmud-2.9.0/doc/dot/
tmud-2.9.0/doc/files/cmd/objects/
tmud-2.9.0/doc/files/cmd/tiny/
tmud-2.9.0/doc/files/lib/
tmud-2.9.0/doc/files/lib/engine/
tmud-2.9.0/doc/files/lib/farts/
tmud-2.9.0/doc/files/tclient_rb.src/
tmud-2.9.0/doc/files/tmud_rb.src/
tmud-2.9.0/farts/
tmud-2.9.0/lib/
tmud-2.9.0/lib/core/
tmud-2.9.0/lib/engine/
tmud-2.9.0/lib/farts/
tmud-2.9.0/logs/
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Reactor</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Reactor</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/lib/network/reactor_rb.html">
                lib/network/reactor.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                Object
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">
    <div id="diagram">
      <map id="map" name="map">
  <area shape="RECT" coords="32,17,104,65"      href="Reactor.html" alt="Reactor
">
</map>
<img src="../dot/f_28.png" usemap="#map" border=0 alt="TopLevel">
    </div>

    <div id="description">
      <p>
The <a href="Reactor.html">Reactor</a> class defines a representation of a
multiplexer based on a non-blocking select() server.
</p>
<p>
The network design is based on the Mesh project NetworkService code which
was translated almost directly from C++, warts and all, which in turn is
based on Schmidt&#8217;s <a href="Acceptor.html">Acceptor</a>/<a
href="Connector.html">Connector</a>/<a href="Reactor.html">Reactor</a>
patterns which may be found at <a
href="http://citeseer.ist.psu.edu/schmidt97acceptor.html">citeseer.ist.psu.edu/schmidt97acceptor.html</a>
for an idea of how all these classes are supposed to interelate.
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000037">new</a>&nbsp;&nbsp;
      <a href="#M000040">poll</a>&nbsp;&nbsp;
      <a href="#M000041">register</a>&nbsp;&nbsp;
      <a href="#M000038">start</a>&nbsp;&nbsp;
      <a href="#M000039">stop</a>&nbsp;&nbsp;
      <a href="#M000042">unregister</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">port</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">service_filters</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">service_io</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">service_negotiation</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">service_type</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000037" class="method-detail">
        <a name="M000037"></a>

        <div class="method-heading">
          <a href="Reactor.src/M000037.html" target="Code" class="method-signature"
            onclick="popupCode('Reactor.src/M000037.html');return false;">
          <span class="method-name">new</span><span class="method-args">(service_port, service_type, service_io, service_negotiation, service_filters, address=nil)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Constructor for <a href="Reactor.html">Reactor</a>
</p>
<dl>
<dt><tt>service_port</tt></dt><dd>The port the server will listen on or client will connect to.

</dd>
<dt><tt>service_type</tt></dt><dd>The type of service (:server or :client)

</dd>
<dt><tt>service_io</tt></dt><dd>The service io handler (:sockio, :lineio, or :packetio)

</dd>
<dt><tt>service_negotiation</tt></dt><dd>An array of telnet options the service will try to negotiate

</dd>
</dl>
<pre>
  Valid options are
       :sga, :echo, :naws, :ttype, :zmp (negotiate default)
       :binary
</pre>
<dl>
<dt><tt>service_filters</tt></dt><dd>An array of io filters the service will use.

</dd>
</dl>
<pre>
  Valid options are
    :filter  - attach dummy filter
    :debugfilter - attach debug filter (default)
    :telnetfilter - attach telnet filter (default)
    :colorfilter - attach color filter (default)
    :terminalfilter - attach terminal filter
</pre>
<dl>
<dt><tt>address</tt></dt><dd>Optional address for outgoing connection.

</dd>
</dl>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000040" class="method-detail">
        <a name="M000040"></a>

        <div class="method-heading">
          <a href="Reactor.src/M000040.html" target="Code" class="method-signature"
            onclick="popupCode('Reactor.src/M000040.html');return false;">
          <span class="method-name">poll</span><span class="method-args">(tm_out)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
poll starts the <a href="Reactor.html">Reactor</a> running to process
incoming connection, input and output requests. It also executes commands
from input requests.
</p>
<dl>
<dt>+tm_out*</dt><dd>time to poll in seconds

</dd>
</dl>
        </div>
      </div>

      <div id="method-M000041" class="method-detail">
        <a name="M000041"></a>

        <div class="method-heading">
          <a href="Reactor.src/M000041.html" target="Code" class="method-signature"
            onclick="popupCode('Reactor.src/M000041.html');return false;">
          <span class="method-name">register</span><span class="method-args">(session)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
register adds a session to the registry [<tt>session</tt>]
</p>
        </div>
      </div>

      <div id="method-M000038" class="method-detail">
        <a name="M000038"></a>

        <div class="method-heading">
          <a href="Reactor.src/M000038.html" target="Code" class="method-signature"
            onclick="popupCode('Reactor.src/M000038.html');return false;">
          <span class="method-name">start</span><span class="method-args">(engine)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Start initializes the reactor and gets it ready to accept incoming
connections.
</p>
<dl>
<dt><tt>engine</tt></dt><dd>The client engine that will be observing the acceptor.

</dd>
<dt><tt>return</tt>&#8216;</dt><dd>true if server boots correctly, false if an error occurs.

</dd>
</dl>
        </div>
      </div>

      <div id="method-M000039" class="method-detail">
        <a name="M000039"></a>

        <div class="method-heading">
          <a href="Reactor.src/M000039.html" target="Code" class="method-signature"
            onclick="popupCode('Reactor.src/M000039.html');return false;">
          <span class="method-name">stop</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
stop requests each of the connections to disconnect in the server&#8217;s
user list, deletes the connections, and erases them from the user list. It
then closes its own listening port.
</p>
        </div>
      </div>

      <div id="method-M000042" class="method-detail">
        <a name="M000042"></a>

        <div class="method-heading">
          <a href="Reactor.src/M000042.html" target="Code" class="method-signature"
            onclick="popupCode('Reactor.src/M000042.html');return false;">
          <span class="method-name">unregister</span><span class="method-args">(session)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
unregister removes a session from the registry [<tt>session</tt>]
</p>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>