Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > c3732731228538f6126cae930c10ad71 > files > 181

python-pyro4-4.21-3.mga4.noarch.rpm



<!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">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Socket server API contract &mdash; Pyro 4.21 documentation</title>
    
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '4.21',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="top" title="Pyro 4.21 documentation" href="../index.html" />
    <link rel="up" title="Pyro4 library API" href="../api.html" />
    <link rel="next" title="Running on alternative Python implementations" href="../alternative.html" />
    <link rel="prev" title="Pyro4.futures — asynchronous calls" href="futures.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../alternative.html" title="Running on alternative Python implementations"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="futures.html" title="Pyro4.futures — asynchronous calls"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">Pyro 4.21 documentation</a> &raquo;</li>
          <li><a href="../api.html" accesskey="U">Pyro4 library API</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="socket-server-api-contract">
<h1>Socket server API contract<a class="headerlink" href="#socket-server-api-contract" title="Permalink to this headline">¶</a></h1>
<p>For now, this is an internal API, used by the Pyro Daemon.
The various servers in Pyro4.socketserver implement this.</p>
<dl class="class">
<dt id="SocketServer_API">
<em class="property">class </em><tt class="descname">SocketServer_API</tt><a class="headerlink" href="#SocketServer_API" title="Permalink to this definition">¶</a></dt>
<dd><p><strong>Methods:</strong></p>
<dl class="method">
<dt id="SocketServer_API.init">
<tt class="descname">init</tt><big>(</big><em>daemon</em>, <em>host</em>, <em>port</em>, <em>unixsocket=None</em><big>)</big><a class="headerlink" href="#SocketServer_API.init" title="Permalink to this definition">¶</a></dt>
<dd><p>Must bind the server on the given host and port (can be None).
daemon is the object that will receive Pyro invocation calls (see below).
When host or port is None, the server can select something appropriate itself.
If possible, use <tt class="docutils literal"><span class="pre">Pyro4.config.COMMTIMEOUT</span></tt> on the sockets (see <a class="reference internal" href="config.html"><em>Pyro4.config &#8212; Configuration items</em></a>).
Set <tt class="docutils literal"><span class="pre">self.sock</span></tt> to the daemon server socket.
If unixsocket is given the name of a Unix domain socket, that type of socket
will be created instead of a regular tcp/ip socket.</p>
</dd></dl>

<dl class="method">
<dt id="SocketServer_API.loop">
<tt class="descname">loop</tt><big>(</big><em>loopCondition</em><big>)</big><a class="headerlink" href="#SocketServer_API.loop" title="Permalink to this definition">¶</a></dt>
<dd><p>Start an endless loop that serves Pyro requests.
loopCondition is an optional function that is called every iteration,
if it returns False, the loop is terminated and this method returns.</p>
</dd></dl>

<dl class="method">
<dt id="SocketServer_API.events">
<tt class="descname">events</tt><big>(</big><em>eventsockets</em><big>)</big><a class="headerlink" href="#SocketServer_API.events" title="Permalink to this definition">¶</a></dt>
<dd><p>Called from external event loops: let the server handle events that occur on one of the sockets of this server.
eventsockets is a sequence of all the sockets for which an event occurred.</p>
</dd></dl>

<dl class="method">
<dt id="SocketServer_API.close">
<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#SocketServer_API.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Release the connections and close the server. It can no longer be used after calling this,
until you call initServer again.</p>
</dd></dl>

<dl class="method">
<dt id="SocketServer_API.wakeup">
<tt class="descname">wakeup</tt><big>(</big><big>)</big><a class="headerlink" href="#SocketServer_API.wakeup" title="Permalink to this definition">¶</a></dt>
<dd><p>This is called to wake up the <tt class="xref py py-meth docutils literal"><span class="pre">requestLoop()</span></tt> if it is in a blocking state.</p>
</dd></dl>

<p><strong>Properties:</strong></p>
<dl class="attribute">
<dt id="SocketServer_API.sockets">
<tt class="descname">sockets</tt><a class="headerlink" href="#SocketServer_API.sockets" title="Permalink to this definition">¶</a></dt>
<dd><p>must be the list of all sockets used by this server (server socket + all connected client sockets)</p>
</dd></dl>

<dl class="attribute">
<dt id="SocketServer_API.sock">
<tt class="descname">sock</tt><a class="headerlink" href="#SocketServer_API.sock" title="Permalink to this definition">¶</a></dt>
<dd><p>must be the server socket itself.</p>
</dd></dl>

<dl class="attribute">
<dt id="SocketServer_API.locationStr">
<tt class="descname">locationStr</tt><a class="headerlink" href="#SocketServer_API.locationStr" title="Permalink to this definition">¶</a></dt>
<dd><p>must be a string of the form <tt class="docutils literal"><span class="pre">&quot;serverhostname:serverport&quot;</span></tt>
can be different from the host:port arguments passed to initServer.
because either of those can be None and the server will choose something appropriate.
If the socket is a Unix domain socket, it should be of the form <tt class="docutils literal"><span class="pre">&quot;./u:socketname&quot;</span></tt>.</p>
</dd></dl>

</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../index.html">
              <img class="logo" src="../_static/pyro.png" alt="Logo"/>
            </a></p>
  <h4>Previous topic</h4>
  <p class="topless"><a href="futures.html"
                        title="previous chapter"><tt class="docutils literal"><span class="pre">Pyro4.futures</span></tt> &#8212; asynchronous calls</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="../alternative.html"
                        title="next chapter">Running on alternative Python implementations</a></p>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../alternative.html" title="Running on alternative Python implementations"
             >next</a> |</li>
        <li class="right" >
          <a href="futures.html" title="Pyro4.futures — asynchronous calls"
             >previous</a> |</li>
        <li><a href="../index.html">Pyro 4.21 documentation</a> &raquo;</li>
          <li><a href="../api.html" >Pyro4 library API</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright Irmen de Jong.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>