nanoev/nanoev-picos/Nanoev_picos/index.html
2025-05-06 15:09:24 +00:00

2 lines
10 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Nanoev_picos (nanoev-picos.Nanoev_picos)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 3.0.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">Index</a> &#x00BB; <a href="../index.html">nanoev-picos</a> &#x00BB; Nanoev_picos</nav><header class="odoc-preamble"><h1>Module <code><span>Nanoev_picos</span></code></h1><p>Basic interface with picos</p></header><div class="odoc-tocs"><nav class="odoc-toc odoc-local-toc"><ul><li><a href="#non-blocking-io-primitives">Non blocking IO primitives</a></li><li><a href="#building-blocks-on-top-of-">Building blocks on top of <code>Base</code></a></li></ul></nav></div><div class="odoc-content"><div class="odoc-spec"><div class="spec module anchored" id="module-Background_thread"><a href="#module-Background_thread" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Background_thread/index.html">Background_thread</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Global_ev"><a href="#module-Global_ev" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Global_ev/index.html">Global_ev</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Global loop.</p></div></div><h3 id="non-blocking-io-primitives"><a href="#non-blocking-io-primitives" class="anchor"></a>Non blocking IO primitives</h3><div class="odoc-spec"><div class="spec module anchored" id="module-Base"><a href="#module-Base" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Base/index.html">Base</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-include"><details open="open"><summary class="spec include"><code><span><span class="keyword">include</span> <span class="keyword">module</span> <span class="keyword">type</span> <span class="keyword">of</span> <span class="keyword">struct</span> <span class="keyword">include</span> <a href="Base/index.html">Base</a> <span class="keyword">end</span></span></code></summary><div class="odoc-spec"><div class="spec value anchored" id="val-read"><a href="#val-read" class="anchor"></a><code><span><span class="keyword">val</span> read : <span><a href="../../ocaml/Unix/index.html#type-file_descr">Unix.file_descr</a> <span class="arrow">&#45;&gt;</span></span> <span>bytes <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> int</span></code></div><div class="spec-doc"><p>Read from the non blocking FD.</p><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <a href="../../nanoev/Nanoev/index.html#exception-Closed"><code>Nanoev.Closed</code></a> <p>if the FD is closed</p></li></ul><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <a href="../../ocaml/Unix/index.html#exception-Unix_error"><code>Unix.Unix_error</code></a> <p>for other errors</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-write_once"><a href="#val-write_once" class="anchor"></a><code><span><span class="keyword">val</span> write_once : <span><a href="../../ocaml/Unix/index.html#type-file_descr">Unix.file_descr</a> <span class="arrow">&#45;&gt;</span></span> <span>bytes <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> int</span></code></div><div class="spec-doc"><p>Write into the non blocking FD.</p><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <a href="../../nanoev/Nanoev/index.html#exception-Closed"><code>Nanoev.Closed</code></a> <p>if the FD is closed</p></li></ul><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <a href="../../ocaml/Unix/index.html#exception-Unix_error"><code>Unix.Unix_error</code></a> <p>for other errors</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-write"><a href="#val-write" class="anchor"></a><code><span><span class="keyword">val</span> write : <span><a href="../../ocaml/Unix/index.html#type-file_descr">Unix.file_descr</a> <span class="arrow">&#45;&gt;</span></span> <span>bytes <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-close"><a href="#val-close" class="anchor"></a><code><span><span class="keyword">val</span> close : <span><a href="../../ocaml/Unix/index.html#type-file_descr">Unix.file_descr</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Close the file descriptor</p><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <a href="../../ocaml/Unix/index.html#exception-Unix_error"><code>Unix.Unix_error</code></a> <p>when it fails</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-connect"><a href="#val-connect" class="anchor"></a><code><span><span class="keyword">val</span> connect : <span><a href="../../ocaml/Unix/index.html#type-file_descr">Unix.file_descr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="../../ocaml/Unix/index.html#type-sockaddr">Unix.sockaddr</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Connect this FD to the remote address.</p><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <a href="../../nanoev/Nanoev/index.html#exception-Closed"><code>Nanoev.Closed</code></a> <p>if the FD is closed.</p></li></ul><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <a href="../../ocaml/Unix/index.html#exception-Unix_error"><code>Unix.Unix_error</code></a> <p>for other errors</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-accept"><a href="#val-accept" class="anchor"></a><code><span><span class="keyword">val</span> accept : <span><a href="../../ocaml/Unix/index.html#type-file_descr">Unix.file_descr</a> <span class="arrow">&#45;&gt;</span></span> <a href="../../ocaml/Unix/index.html#type-file_descr">Unix.file_descr</a> * <a href="../../ocaml/Unix/index.html#type-sockaddr">Unix.sockaddr</a></span></code></div><div class="spec-doc"><p>Accept a connection on this fd.</p><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <a href="../../nanoev/Nanoev/index.html#exception-Closed"><code>Nanoev.Closed</code></a> <p>if the FD is closed.</p></li></ul><ul class="at-tags"><li class="raises"><span class="at-tag">raises</span> <a href="../../ocaml/Unix/index.html#exception-Unix_error"><code>Unix.Unix_error</code></a> <p>for other errors</p></li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-max_fds"><a href="#val-max_fds" class="anchor"></a><code><span><span class="keyword">val</span> max_fds : <span>unit <span class="arrow">&#45;&gt;</span></span> int</span></code></div><div class="spec-doc"><p>Maximum number of file descriptors one can await on. See <a href="../../nanoev/Nanoev/index.html#val-max_fds"><code>Nanoev.max_fds</code></a></p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-sleep"><a href="#val-sleep" class="anchor"></a><code><span><span class="keyword">val</span> sleep : <span>float <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Suspend current fiber for <code>n</code> seconds</p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Raw"><a href="#module-Raw" class="anchor"></a><code><span><span class="keyword">module</span> Raw</span><span> = <a href="Base/Raw/index.html">Base.Raw</a></span></code></div></div></details></div><h3 id="building-blocks-on-top-of-"><a href="#building-blocks-on-top-of-" class="anchor"></a>Building blocks on top of <a href="Base/index.html"><code>Base</code></a></h3><div class="odoc-spec"><div class="spec module anchored" id="module-IO_in"><a href="#module-IO_in" class="anchor"></a><code><span><span class="keyword">module</span> <a href="IO_in/index.html">IO_in</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-IO_out"><a href="#module-IO_out" class="anchor"></a><code><span><span class="keyword">module</span> <a href="IO_out/index.html">IO_out</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Net"><a href="#module-Net" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Net/index.html">Net</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Net_client"><a href="#module-Net_client" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Net_client/index.html">Net_client</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Net_server"><a href="#module-Net_server" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Net_server/index.html">Net_server</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div></div></body></html>