Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > c7b8d5922a45aeb64a36e62c8024cf09 > files > 59

ocaml-async_extra-devel-109.24.00-2.mga4.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="Rpc.html">
<link rel="next" href="Std.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Command" rel="Chapter" href="Command.html">
<link title="File_tail" rel="Chapter" href="File_tail.html">
<link title="File_writer" rel="Chapter" href="File_writer.html">
<link title="Import" rel="Chapter" href="Import.html">
<link title="Lock_file" rel="Chapter" href="Lock_file.html">
<link title="Log" rel="Chapter" href="Log.html">
<link title="Persistent_singleton" rel="Chapter" href="Persistent_singleton.html">
<link title="Rpc" rel="Chapter" href="Rpc.html">
<link title="Rpc_intf" rel="Chapter" href="Rpc_intf.html">
<link title="Std" rel="Chapter" href="Std.html">
<link title="Tcp" rel="Chapter" href="Tcp.html">
<link title="Tcp_file" rel="Chapter" href="Tcp_file.html">
<link title="Typed_tcp" rel="Chapter" href="Typed_tcp.html">
<link title="Typed_tcp_intf" rel="Chapter" href="Typed_tcp_intf.html">
<link title="Unpack_sequence" rel="Chapter" href="Unpack_sequence.html">
<link title="User_and_group" rel="Chapter" href="User_and_group.html">
<link title="Versioned_rpc" rel="Chapter" href="Versioned_rpc.html">
<link title="Versioned_typed_tcp" rel="Chapter" href="Versioned_typed_tcp.html">
<link title="Weak_hashtbl" rel="Chapter" href="Weak_hashtbl.html"><title>Rpc_intf</title>
</head>
<body>
<div class="navbar"><a class="pre" href="Rpc.html" title="Rpc">Previous</a>
&nbsp;<a class="up" href="index.html" title="Index">Up</a>
&nbsp;<a class="post" href="Std.html" title="Std">Next</a>
</div>
<h1>Module <a href="type_Rpc_intf.html">Rpc_intf</a></h1>

<pre><span class="keyword">module</span> Rpc_intf: <code class="code">sig</code> <a href="Rpc_intf.html">..</a> <code class="code">end</code></pre><div class="info module top">
Initiate an Rpc connection on the given reader/writer pair.  <code class="code">server</code> should be the
      bag of implementations that the calling side implements; it defaults to
      <code class="code">Implementations.null</code> (i.e., "I implement no RPCs").<br>
</div>
<hr width="100%">

<pre><span id="VAL__pa_ounit_275876e34cf609db118f3d84b799a790"><span class="keyword">val</span> __pa_ounit_275876e34cf609db118f3d84b799a790</span> : <code class="type">string</code></pre>
<pre><span class="keyword">module type</span> <a href="Rpc_intf.Connection.html">Connection</a> = <code class="code">sig</code> <a href="Rpc_intf.Connection.html">..</a> <code class="code">end</code></pre><br>
Initiate an Rpc connection on the given reader/writer pair.  <code class="code">server</code> should be the
      bag of implementations that the calling side implements; it defaults to
      <code class="code">Implementations.null</code> (i.e., "I implement no RPCs").<br>
<br>
<code class="code">with_close</code> tries to create a <code class="code">t</code> using the given reader and writer.  If a
      handshake error is the result, it calls <code class="code">on_handshake_error</code>, for which the default
      behavior is to raise an exception.  If no error results, <code class="code">dispatch_queries</code> is
      called on <code class="code">t</code>.
<p>

      After <code class="code">dispatch_queries</code> returns, if <code class="code">server</code> is None, the <code class="code">t</code> will be closed and
      the deferred returned by <code class="code">dispatch_queries</code> wil be determined immediately.
      Otherwise, we'll wait until the other side closes the connection and then close <code class="code">t</code>
      and determine the deferred returned by <code class="code">dispatch_queries</code>.
<p>

      When the deferred returned by <code class="code">with_close</code> becomes determined, both <code class="code">Reader.close</code>
      and <code class="code">Writer.close</code> have finished.<br>
<br>
<code class="code">serve implementations ~port ?on_handshake_error ()</code> starts a server with the given
      implementation on <code class="code">port</code>.  The optional auth function will be called on all incoming
      connections with the address info of the client and will disconnect the client
      immediately if it returns false.  This auth mechanism is generic and does nothing
      other than disconnect the client - any logging or record of the reasons is the
      responsibility of the auth function itself.<br>
<br>
<code class="code">client ~host ~port ()</code> connects to the server at (<code class="code">host</code>,<code class="code">port</code>) and returns the
      connection or an Error if a connection could not be made.  It is the responsibility
      of the caller to eventually call close.<br>
<br>
<code class="code">with_client ~host ~port f</code> connects to the server at (<code class="code">host</code>,<code class="code">port</code>) and runs f
      until an exception is thrown or until the returned Deferred is fulfilled.<br>
</body></html>