<emclass="property">class </em><codeclass="descclassname">royalnet.network.</code><codeclass="descname">Message</code><aclass="headerlink"href="#royalnet.network.Message"title="Permalink to this definition">¶</a></dt>
<dd><p>A message sent through the Royalnet.</p>
</dd></dl>
<dlclass="class">
<dtid="royalnet.network.ServerErrorMessage">
<emclass="property">class </em><codeclass="descclassname">royalnet.network.</code><codeclass="descname">ServerErrorMessage</code><spanclass="sig-paren">(</span><em>reason</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.ServerErrorMessage"title="Permalink to this definition">¶</a></dt>
<dd><p>Something went wrong in the connection 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>.</p>
</dd></dl>
<dlclass="class">
<dtid="royalnet.network.InvalidSecretEM">
<emclass="property">class </em><codeclass="descclassname">royalnet.network.</code><codeclass="descname">InvalidSecretEM</code><spanclass="sig-paren">(</span><em>reason</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.InvalidSecretEM"title="Permalink to this definition">¶</a></dt>
<dd><p>The sent secret was incorrect.</p>
<p>This message terminates connection 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>.</p>
</dd></dl>
<dlclass="class">
<dtid="royalnet.network.InvalidDestinationEM">
<emclass="property">class </em><codeclass="descclassname">royalnet.network.</code><codeclass="descname">InvalidDestinationEM</code><spanclass="sig-paren">(</span><em>reason</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.InvalidDestinationEM"title="Permalink to this definition">¶</a></dt>
<dd><p>The <aclass="reference internal"href="#royalnet.network.Package"title="royalnet.network.Package"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.network.Package</span></code></a> destination was invalid or not found.</p>
</dd></dl>
<dlclass="class">
<dtid="royalnet.network.InvalidPackageEM">
<emclass="property">class </em><codeclass="descclassname">royalnet.network.</code><codeclass="descname">InvalidPackageEM</code><spanclass="sig-paren">(</span><em>reason</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.InvalidPackageEM"title="Permalink to this definition">¶</a></dt>
<dd><p>The sent <aclass="reference internal"href="#royalnet.network.Package"title="royalnet.network.Package"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.network.Package</span></code></a> was invalid.</p>
</dd></dl>
<dlclass="class">
<dtid="royalnet.network.RoyalnetLink">
<emclass="property">class </em><codeclass="descclassname">royalnet.network.</code><codeclass="descname">RoyalnetLink</code><spanclass="sig-paren">(</span><em>master_uri: str</em>, <em>secret: str</em>, <em>link_type: str</em>, <em>request_handler</em>, <em>*</em>, <em>loop: asyncio.events.AbstractEventLoop = <_WindowsSelectorEventLoop running=False closed=False debug=False></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.RoyalnetLink"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="method">
<dtid="royalnet.network.RoyalnetLink.connect">
<codeclass="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></dd></dl>
<dlclass="method">
<dtid="royalnet.network.RoyalnetLink.identify">
<codeclass="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>
<dd></dd></dl>
<dlclass="method">
<dtid="royalnet.network.RoyalnetLink.receive">
<codeclass="descname">receive</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ royalnet.network.packages.Package<aclass="headerlink"href="#royalnet.network.RoyalnetLink.receive"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="royalnet.network.RoyalnetLink.request">
<codeclass="descname">request</code><spanclass="sig-paren">(</span><em>message</em>, <em>destination</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.RoyalnetLink.request"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="royalnet.network.RoyalnetLink.run">
<codeclass="descname">run</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.RoyalnetLink.run"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="royalnet.network.RoyalnetLink.send">
<codeclass="descname">send</code><spanclass="sig-paren">(</span><em>package: royalnet.network.packages.Package</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.RoyalnetLink.send"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="exception">
<dtid="royalnet.network.NetworkError">
<emclass="property">exception </em><codeclass="descclassname">royalnet.network.</code><codeclass="descname">NetworkError</code><spanclass="sig-paren">(</span><em>error_msg: royalnet.network.messages.ServerErrorMessage</em>, <em>*args</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.NetworkError"title="Permalink to this definition">¶</a></dt>
<emclass="property">exception </em><codeclass="descclassname">royalnet.network.</code><codeclass="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="descclassname">royalnet.network.</code><codeclass="descname">NotIdentifiedError</code><aclass="headerlink"href="#royalnet.network.NotIdentifiedError"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="class">
<dtid="royalnet.network.Package">
<emclass="property">class </em><codeclass="descclassname">royalnet.network.</code><codeclass="descname">Package</code><spanclass="sig-paren">(</span><em>data</em>, <em>destination: str</em>, <em>source: str</em>, <em>*</em>, <em>source_conv_id: str = None</em>, <em>destination_conv_id: str = None</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.Package"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.</p>
<dlclass="method">
<dtid="royalnet.network.Package.__init__">
<codeclass="descname">__init__</code><spanclass="sig-paren">(</span><em>data</em>, <em>destination: str</em>, <em>source: str</em>, <em>*</em>, <em>source_conv_id: str = None</em>, <em>destination_conv_id: str = None</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.Package.__init__"title="Permalink to this definition">¶</a></dt>
<dd><p>Create a Package.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>data</strong>– The data that should be sent. Usually a <aclass="reference internal"href="#royalnet.network.Message"title="royalnet.network.Message"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.network.Message</span></code></a>.</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</strong>– The <codeclass="docutils literal notranslate"><spanclass="pre">nid</span></code> of the node that created this Package.</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>
</ul>
</dd>
</dl>
</dd></dl>
<dlclass="method">
<dtid="royalnet.network.Package.pickle">
<codeclass="descname">pickle</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ bytes<aclass="headerlink"href="#royalnet.network.Package.pickle"title="Permalink to this definition">¶</a></dt>
<ddclass="field-odd"><p>The pickled package in form of bytes.</p>
</dd>
</dl>
</dd></dl>
<dlclass="method">
<dtid="royalnet.network.Package.reply">
<codeclass="descname">reply</code><spanclass="sig-paren">(</span><em>data</em><spanclass="sig-paren">)</span>→ royalnet.network.packages.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 <aclass="reference internal"href="#royalnet.network.Message"title="royalnet.network.Message"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">royalnet.network.Message</span></code></a>.</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>The reply Package.</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="royalnet.network.RoyalnetServer">
<emclass="property">class </em><codeclass="descclassname">royalnet.network.</code><codeclass="descname">RoyalnetServer</code><spanclass="sig-paren">(</span><em>address: str</em>, <em>port: int</em>, <em>required_secret: str</em>, <em>*</em>, <em>loop: asyncio.events.AbstractEventLoop = <_WindowsSelectorEventLoop running=False closed=False debug=False></em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.RoyalnetServer"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">find_destination</code><spanclass="sig-paren">(</span><em>package: royalnet.network.packages.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>
<dd><p>Find a list of destinations for the package.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>package</strong>– The package to find the destination of.</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p>A <aclass="reference external"href="https://docs.python.org/3.7/library/stdtypes.html#list"title="(in Python v3.7)"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">list</span></code></a> of <codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">ConnectedClients</span></code> to send the package to.</p>
</dd>
</dl>
</dd></dl>
<dlclass="method">
<dtid="royalnet.network.RoyalnetServer.listener">
<codeclass="descname">listener</code><spanclass="sig-paren">(</span><em>websocket: websockets.server.WebSocketServerProtocol</em>, <em>request_uri: str</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.RoyalnetServer.listener"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">route_package</code><spanclass="sig-paren">(</span><em>package: royalnet.network.packages.Package</em><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#royalnet.network.RoyalnetServer.route_package"title="Permalink to this definition">¶</a></dt>
<dd><p>Executed every time a package is received and must be routed somewhere.</p>
</dd></dl>
<dlclass="method">
<dtid="royalnet.network.RoyalnetServer.serve">
<codeclass="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>
<dd></dd></dl>
<dlclass="method">
<dtid="royalnet.network.RoyalnetServer.start">
<codeclass="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>
<dd></dd></dl>
</dd></dl>
<dlclass="class">
<dtid="royalnet.network.RequestSuccessful">
<emclass="property">class </em><codeclass="descclassname">royalnet.network.</code><codeclass="descname">RequestSuccessful</code><aclass="headerlink"href="#royalnet.network.RequestSuccessful"title="Permalink to this definition">¶</a></dt>
<codeclass="descname">raise_on_error</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#royalnet.network.RequestSuccessful.raise_on_error"title="Permalink to this definition">¶</a></dt>
<dd><p>If the reply is an error, raise an error, otherwise, do nothing.</p>
<p>Does nothing.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="royalnet.network.RequestError">
<emclass="property">class </em><codeclass="descclassname">royalnet.network.</code><codeclass="descname">RequestError</code><spanclass="sig-paren">(</span><em>exc: Exception</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.RequestError"title="Permalink to this definition">¶</a></dt>
<dd><p>The sent request wasn’t successful.</p>
<dlclass="method">
<dtid="royalnet.network.RequestError.__init__">
<codeclass="descname">__init__</code><spanclass="sig-paren">(</span><em>exc: Exception</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.RequestError.__init__"title="Permalink to this definition">¶</a></dt>
<dd><p>Create a RequestError.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>exc</strong>– The exception that caused the error in the request.</p>
<codeclass="descname">raise_on_error</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#royalnet.network.RequestError.raise_on_error"title="Permalink to this definition">¶</a></dt>
<dd><p>If the reply is an error, raise an error, otherwise, do nothing.</p>
<p>:raises Always raises a <codeclass="xref py py-exc docutils literal notranslate"><spanclass="pre">royalnet.error.RoyalnetError</span></code>, containing the exception that caused the error.:</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="royalnet.network.RoyalnetConfig">
<emclass="property">class </em><codeclass="descclassname">royalnet.network.</code><codeclass="descname">RoyalnetConfig</code><spanclass="sig-paren">(</span><em>master_uri: str</em>, <em>master_secret: str</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#royalnet.network.RoyalnetConfig"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><codeclass="descclassname">royalnet.network.</code><codeclass="descname">Reply</code><aclass="headerlink"href="#royalnet.network.Reply"title="Permalink to this definition">¶</a></dt>
<dd><p>A reply to a request sent through the Royalnet.</p>
<dlclass="method">
<dtid="royalnet.network.Reply.raise_on_error">
<codeclass="descname">raise_on_error</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ None<aclass="headerlink"href="#royalnet.network.Reply.raise_on_error"title="Permalink to this definition">¶</a></dt>
<dd><p>If the reply is an error, raise an error, otherwise, do nothing.</p>
<p>:raises A <codeclass="xref py py-exc docutils literal notranslate"><spanclass="pre">RoyalnetError</span></code>, if the Reply is an error, otherwise, nothing.:</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>.