<emclass="property">async </em><codeclass="sig-name descname">connect</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.RoyalnetLink.connect"title="Permalink to this definition">¶</a></dt>
<dd><p>Connect to the <aclass="reference internal"href="#royalnet.network.RoyalnetServer"title="royalnet.network.RoyalnetServer"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.network.RoyalnetServer</span></code></a> at <codeclass="docutils literal notranslate"><spanclass="pre">self.master_uri</span></code>.</p>
<emclass="property">async </em><codeclass="sig-name descname">identify</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#royalnet.network.RoyalnetLink.identify"title="Permalink to this definition">¶</a></dt>
<emclass="property">async </em><codeclass="sig-name descname">receive</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ royalnet.network.package.Package<aclass="headerlink"href="#royalnet.network.RoyalnetLink.receive"title="Permalink to this definition">¶</a></dt>
<emclass="property">async </em><codeclass="sig-name descname">request</code><spanclass="sig-paren">(</span><emclass="sig-param">message</em>, <emclass="sig-param">destination</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.RoyalnetLink.request"title="Permalink to this definition">¶</a></dt>
<emclass="property">async </em><codeclass="sig-name descname">run</code><spanclass="sig-paren">(</span><emclass="sig-param">loops: numbers.Real = inf</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.RoyalnetLink.run"title="Permalink to this definition">¶</a></dt>
<emclass="property">async </em><codeclass="sig-name descname">send</code><spanclass="sig-paren">(</span><emclass="sig-param">package: royalnet.network.package.Package</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.RoyalnetLink.send"title="Permalink to this definition">¶</a></dt>
<emclass="property">exception </em><codeclass="sig-prename descclassname">royalnet.network.</code><codeclass="sig-name descname">NetworkError</code><spanclass="sig-paren">(</span><emclass="sig-param">error_data: dict</em>, <emclass="sig-param">*args</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.NetworkError"title="Permalink to this definition">¶</a></dt>
<emclass="property">exception </em><codeclass="sig-prename descclassname">royalnet.network.</code><codeclass="sig-name descname">NotConnectedError</code><aclass="headerlink"href="#royalnet.network.NotConnectedError"title="Permalink to this definition">¶</a></dt>
<dd><p>The <aclass="reference internal"href="#royalnet.network.RoyalnetLink"title="royalnet.network.RoyalnetLink"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.network.RoyalnetLink</span></code></a> is not connected to a <aclass="reference internal"href="#royalnet.network.RoyalnetServer"title="royalnet.network.RoyalnetServer"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.network.RoyalnetServer</span></code></a>.</p>
<emclass="property">exception </em><codeclass="sig-prename descclassname">royalnet.network.</code><codeclass="sig-name descname">NotIdentifiedError</code><aclass="headerlink"href="#royalnet.network.NotIdentifiedError"title="Permalink to this definition">¶</a></dt>
<dd><p>A Royalnet package, the data type with which a <aclass="reference internal"href="#royalnet.network.RoyalnetLink"title="royalnet.network.RoyalnetLink"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.network.RoyalnetLink</span></code></a> communicates with a <aclass="reference internal"href="#royalnet.network.RoyalnetServer"title="royalnet.network.RoyalnetServer"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.network.RoyalnetServer</span></code></a> or another link.
Contains info about the source and the destination.</p>
<li><p><strong>data</strong>– The data that should be sent. Usually a <codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.network.Message</span></code>.</p></li>
<li><p><strong>source</strong>– The <codeclass="docutils literal notranslate"><spanclass="pre">nid</span></code> of the node that created this Package.</p></li>
<li><p><strong>destination</strong>– The <codeclass="docutils literal notranslate"><spanclass="pre">link_type</span></code> of the destination node, or alternatively, the <codeclass="docutils literal notranslate"><spanclass="pre">nid</span></code> of the node. Can also be the <codeclass="docutils literal notranslate"><spanclass="pre">NULL</span></code> value to send the message to nobody.</p></li>
<li><p><strong>source_conv_id</strong>– The conversation id of the node that created this package. Akin to the sequence number on IP packets.</p></li>
<li><p><strong>destination_conv_id</strong>– The conversation id of the node that this Package is a reply to.</p></li>
<emclass="property">static </em><codeclass="sig-name descname">from_dict</code><spanclass="sig-paren">(</span><emclass="sig-param">d</em><spanclass="sig-paren">)</span>→ royalnet.network.package.Package<aclass="headerlink"href="#royalnet.network.Package.from_dict"title="Permalink to this definition">¶</a></dt>
<emclass="property">static </em><codeclass="sig-name descname">from_json_bytes</code><spanclass="sig-paren">(</span><emclass="sig-param">b: bytes</em><spanclass="sig-paren">)</span>→ royalnet.network.package.Package<aclass="headerlink"href="#royalnet.network.Package.from_json_bytes"title="Permalink to this definition">¶</a></dt>
<emclass="property">static </em><codeclass="sig-name descname">from_json_string</code><spanclass="sig-paren">(</span><emclass="sig-param">string: str</em><spanclass="sig-paren">)</span>→ royalnet.network.package.Package<aclass="headerlink"href="#royalnet.network.Package.from_json_string"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">reply</code><spanclass="sig-paren">(</span><emclass="sig-param">data</em><spanclass="sig-paren">)</span>→ royalnet.network.package.Package<aclass="headerlink"href="#royalnet.network.Package.reply"title="Permalink to this definition">¶</a></dt>
<dd><p>Reply to this Package with another Package.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>data</strong>– The data that should be sent. Usually a <codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.network.Message</span></code>.</p>
<codeclass="sig-name descname">to_dict</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ dict<aclass="headerlink"href="#royalnet.network.Package.to_dict"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">to_json_bytes</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ bytes<aclass="headerlink"href="#royalnet.network.Package.to_json_bytes"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">to_json_string</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ str<aclass="headerlink"href="#royalnet.network.Package.to_json_string"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">find_destination</code><spanclass="sig-paren">(</span><emclass="sig-param">package: royalnet.network.package.Package</em><spanclass="sig-paren">)</span>→ List[royalnet.network.royalnetserver.ConnectedClient]<aclass="headerlink"href="#royalnet.network.RoyalnetServer.find_destination"title="Permalink to this definition">¶</a></dt>
<emclass="property">async </em><codeclass="sig-name descname">listener</code><spanclass="sig-paren">(</span><emclass="sig-param">websocket: websockets.server.WebSocketServerProtocol</em>, <emclass="sig-param">path</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.RoyalnetServer.listener"title="Permalink to this definition">¶</a></dt>
<emclass="property">async </em><codeclass="sig-name descname">route_package</code><spanclass="sig-paren">(</span><emclass="sig-param">package: royalnet.network.package.Package</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#royalnet.network.RoyalnetServer.route_package"title="Permalink to this definition">¶</a></dt>
<emclass="property">async </em><codeclass="sig-name descname">serve</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.RoyalnetServer.serve"title="Permalink to this definition">¶</a></dt>
<emclass="property">async </em><codeclass="sig-name descname">start</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.RoyalnetServer.start"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">royalnet.network.</code><codeclass="sig-name descname">RoyalnetConfig</code><spanclass="sig-paren">(</span><emclass="sig-param">master_uri: str</em>, <emclass="sig-param">master_secret: str</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.RoyalnetConfig"title="Permalink to this definition">¶</a></dt>
<emclass="property">exception </em><codeclass="sig-prename descclassname">royalnet.network.</code><codeclass="sig-name descname">ConnectionClosedError</code><aclass="headerlink"href="#royalnet.network.ConnectionClosedError"title="Permalink to this definition">¶</a></dt>
<dd><p>The <aclass="reference internal"href="#royalnet.network.RoyalnetLink"title="royalnet.network.RoyalnetLink"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.network.RoyalnetLink</span></code></a>’s connection was closed unexpectedly. The link can’t be used anymore.</p>
<emclass="property">class </em><codeclass="sig-prename descclassname">royalnet.network.</code><codeclass="sig-name descname">Request</code><spanclass="sig-paren">(</span><emclass="sig-param">handler: str</em>, <emclass="sig-param">data: dict</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.Request"title="Permalink to this definition">¶</a></dt>
<dd><p>A request sent from a <aclass="reference internal"href="#royalnet.network.RoyalnetLink"title="royalnet.network.RoyalnetLink"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.network.RoyalnetLink</span></code></a> to another.</p>
<p>It contains the name of the requested handler, in addition to the data.</p>
<emclass="property">static </em><codeclass="sig-name descname">from_dict</code><spanclass="sig-paren">(</span><emclass="sig-param">d: dict</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.Request.from_dict"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">to_dict</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.Request.to_dict"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="sig-prename descclassname">royalnet.network.</code><codeclass="sig-name descname">Response</code><aclass="headerlink"href="#royalnet.network.Response"title="Permalink to this definition">¶</a></dt>
<emclass="property">classmethod </em><codeclass="sig-name descname">from_dict</code><spanclass="sig-paren">(</span><emclass="sig-param">d: dict</em><spanclass="sig-paren">)</span>→ royalnet.network.response.Response<aclass="headerlink"href="#royalnet.network.Response.from_dict"title="Permalink to this definition">¶</a></dt>
<dd><p>Recreate the response from a received <aclass="reference external"href="https://docs.python.org/3.7/library/stdtypes.html#dict"title="(in Python v3.7)"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">dict</span></code></a>.</p>
<codeclass="sig-name descname">raise_on_error</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.Response.raise_on_error"title="Permalink to this definition">¶</a></dt>
<dd><p>Raise an <aclass="reference external"href="https://docs.python.org/3.7/library/exceptions.html#Exception"title="(in Python v3.7)"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Exception</span></code></a> if the Response is an error, do nothing otherwise.</p>
<codeclass="sig-name descname">to_dict</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ dict<aclass="headerlink"href="#royalnet.network.Response.to_dict"title="Permalink to this definition">¶</a></dt>
<dd><p>Prepare the Response to be sent by converting it to a JSONable <aclass="reference external"href="https://docs.python.org/3.7/library/stdtypes.html#dict"title="(in Python v3.7)"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">dict</span></code></a>.</p>
<emclass="property">class </em><codeclass="sig-prename descclassname">royalnet.network.</code><codeclass="sig-name descname">ResponseSuccess</code><spanclass="sig-paren">(</span><emclass="sig-param">data: Optional[dict] = None</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.ResponseSuccess"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">raise_on_error</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.ResponseSuccess.raise_on_error"title="Permalink to this definition">¶</a></dt>
<dd><p>Raise an <aclass="reference external"href="https://docs.python.org/3.7/library/exceptions.html#Exception"title="(in Python v3.7)"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Exception</span></code></a> if the Response is an error, do nothing otherwise.</p>
<codeclass="sig-name descname">raise_on_error</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.ResponseError.raise_on_error"title="Permalink to this definition">¶</a></dt>
<dd><p>Raise an <aclass="reference external"href="https://docs.python.org/3.7/library/exceptions.html#Exception"title="(in Python v3.7)"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Exception</span></code></a> if the Response is an error, do nothing otherwise.</p>
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.