nim-chronos/api/chronos/handles.html

649 lines
54 KiB
HTML

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- This file is generated by Nim. -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Favicon -->
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
<!-- Google fonts -->
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
<!-- CSS -->
<title>chronos/handles</title>
<link rel="stylesheet" type="text/css" href="../nimdoc.out.css">
<script type="text/javascript" src="../dochack.js"></script>
<script type="text/javascript">
function main() {
var pragmaDots = document.getElementsByClassName("pragmadots");
for (var i = 0; i < pragmaDots.length; i++) {
pragmaDots[i].onclick = function(event) {
// Hide tease
event.target.parentNode.style.display = "none";
// Show actual
event.target.parentNode.nextElementSibling.style.display = "inline";
}
}
function switchTheme(e) {
if (e.target.checked) {
document.documentElement.setAttribute('data-theme', 'dark');
localStorage.setItem('theme', 'dark');
} else {
document.documentElement.setAttribute('data-theme', 'light');
localStorage.setItem('theme', 'light');
}
}
const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]');
if (toggleSwitch !== null) {
toggleSwitch.addEventListener('change', switchTheme, false);
}
var currentTheme = localStorage.getItem('theme');
if (!currentTheme && window.matchMedia('(prefers-color-scheme: dark)').matches) {
currentTheme = 'dark';
}
if (currentTheme) {
document.documentElement.setAttribute('data-theme', currentTheme);
if (currentTheme === 'dark' && toggleSwitch !== null) {
toggleSwitch.checked = true;
}
}
}
window.addEventListener('DOMContentLoaded', main);
</script>
</head>
<body>
<div class="document" id="documentId">
<div class="container">
<h1 class="title">chronos/handles</h1>
<div class="row">
<div class="three columns">
<div class="theme-switch-wrapper">
<label class="theme-switch" for="checkbox">
<input type="checkbox" id="checkbox" />
<div class="slider round"></div>
</label>
&nbsp;&nbsp;&nbsp; <em>Dark Mode</em>
</div>
<div id="global-links">
<ul class="simple">
<li>
<a href="../theindex.html">Index</a>
</li>
</ul>
</div>
<div id="searchInputDiv">
Search: <input type="text" id="searchInput"
onkeyup="search()" />
</div>
<div>
Group by:
<select onchange="groupBy(this.value)">
<option value="section">Section</option>
<option value="type">Type</option>
</select>
</div>
<ul class="simple simple-toc" id="toc-list">
<li>
<a class="reference reference-toplevel" href="#6" id="56">Imports</a>
<ul class="simple simple-toc-section">
</ul>
</li>
<li>
<a class="reference reference-toplevel" href="#10" id="60">Consts</a>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#asyncInvalidPipe"
title="asyncInvalidPipe = -1'i32">asyncInvalidPipe</a></li>
<li><a class="reference" href="#asyncInvalidSocket"
title="asyncInvalidSocket = -1'i32">asyncInvalidSocket</a></li>
</ul>
</li>
<li>
<a class="reference reference-toplevel" href="#12" id="62">Procs</a>
<ul class="simple simple-toc-section">
<ul class="simple nested-toc-section">createAsyncPipe
<li><a class="reference" href="#createAsyncPipe"
title="createAsyncPipe(): tuple[read: AsyncFD, write: AsyncFD]">createAsyncPipe(): tuple[read: AsyncFD, write: AsyncFD]</a></li>
</ul>
<ul class="simple nested-toc-section">createAsyncSocket
<li><a class="reference" href="#createAsyncSocket%2CDomain%2CSockType%2CProtocol"
title="createAsyncSocket(domain: Domain; sockType: SockType; protocol: Protocol;
inherit = true): AsyncFD">createAsyncSocket(domain: Domain; sockType: SockType; protocol: Protocol;
inherit = true): AsyncFD</a></li>
</ul>
<ul class="simple nested-toc-section">createAsyncSocket2
<li><a class="reference" href="#createAsyncSocket2%2CDomain%2CSockType%2CProtocol"
title="createAsyncSocket2(domain: Domain; sockType: SockType; protocol: Protocol;
inherit = true): Result[AsyncFD, OSErrorCode]">createAsyncSocket2(domain: Domain; sockType: SockType; protocol: Protocol;
inherit = true): Result[AsyncFD, OSErrorCode]</a></li>
</ul>
<ul class="simple nested-toc-section">getDualstack
<li><a class="reference" href="#getDualstack%2CAsyncFD"
title="getDualstack(fd: AsyncFD): Result[bool, OSErrorCode]">getDualstack(fd: AsyncFD): Result[bool, OSErrorCode]</a></li>
</ul>
<ul class="simple nested-toc-section">getInheritable
<li><a class="reference" href="#getInheritable%2CAsyncFD"
title="getInheritable(fd: AsyncFD): Result[bool, OSErrorCode]">getInheritable(fd: AsyncFD): Result[bool, OSErrorCode]</a></li>
</ul>
<ul class="simple nested-toc-section">getMaxOpenFiles
<li><a class="reference" href="#getMaxOpenFiles"
title="getMaxOpenFiles(): int">getMaxOpenFiles(): int</a></li>
</ul>
<ul class="simple nested-toc-section">getMaxOpenFiles2
<li><a class="reference" href="#getMaxOpenFiles2"
title="getMaxOpenFiles2(): Result[int, OSErrorCode]">getMaxOpenFiles2(): Result[int, OSErrorCode]</a></li>
</ul>
<ul class="simple nested-toc-section">getSocketError
<li><a class="reference" href="#getSocketError%2CAsyncFD%2Cint"
title="getSocketError(socket: AsyncFD; err: var int): bool">getSocketError(socket: AsyncFD; err: var int): bool</a></li>
</ul>
<ul class="simple nested-toc-section">getSocketError2
<li><a class="reference" href="#getSocketError2%2CAsyncFD"
title="getSocketError2(socket: AsyncFD): Result[cint, OSErrorCode]">getSocketError2(socket: AsyncFD): Result[cint, OSErrorCode]</a></li>
</ul>
<ul class="simple nested-toc-section">getSockOpt
<li><a class="reference" href="#getSockOpt%2CAsyncFD%2Cint%2Cint%2Cint"
title="getSockOpt(socket: AsyncFD; level, optname: int; value: var int): bool">getSockOpt(socket: AsyncFD; level, optname: int; value: var int): bool</a></li>
<li><a class="reference" href="#getSockOpt%2CAsyncFD%2Cint%2Cint%2Cpointer%2Cint"
title="getSockOpt(socket: AsyncFD; level, optname: int; value: var pointer;
valuelen: var int): bool">getSockOpt(socket: AsyncFD; level, optname: int; value: var pointer;
valuelen: var int): bool</a></li>
</ul>
<ul class="simple nested-toc-section">getSockOpt2
<li><a class="reference" href="#getSockOpt2%2CAsyncFD%2Cint%2Cint"
title="getSockOpt2(socket: AsyncFD; level, optname: int): Result[cint, OSErrorCode]">getSockOpt2(socket: AsyncFD; level, optname: int): Result[cint, OSErrorCode]</a></li>
<li><a class="reference" href="#getSockOpt2%2CAsyncFD%2Cint%2Cint%2Ctype"
title="getSockOpt2(socket: AsyncFD; level, optname: int; T: type): Result[T,
OSErrorCode]">getSockOpt2(socket: AsyncFD; level, optname: int; T: type): Result[T,
OSErrorCode]</a></li>
</ul>
<ul class="simple nested-toc-section">isAvailable
<li><a class="reference" href="#isAvailable%2CDomain"
title="isAvailable(domain: Domain): bool">isAvailable(domain: Domain): bool</a></li>
</ul>
<ul class="simple nested-toc-section">setDualstack
<li><a class="reference" href="#setDualstack%2CAsyncFD%2Cbool"
title="setDualstack(fd: AsyncFD; value: bool): Result[void, OSErrorCode]">setDualstack(fd: AsyncFD; value: bool): Result[void, OSErrorCode]</a></li>
</ul>
<ul class="simple nested-toc-section">setMaxOpenFiles
<li><a class="reference" href="#setMaxOpenFiles%2Cint"
title="setMaxOpenFiles(count: int)">setMaxOpenFiles(count: int)</a></li>
</ul>
<ul class="simple nested-toc-section">setMaxOpenFiles2
<li><a class="reference" href="#setMaxOpenFiles2%2Cint"
title="setMaxOpenFiles2(count: int): Result[void, OSErrorCode]">setMaxOpenFiles2(count: int): Result[void, OSErrorCode]</a></li>
</ul>
<ul class="simple nested-toc-section">setSocketBlocking
<li><a class="reference" href="#setSocketBlocking%2CSocketHandle%2Cbool"
title="setSocketBlocking(s: SocketHandle; blocking: bool): bool">setSocketBlocking(s: SocketHandle; blocking: bool): bool</a></li>
</ul>
<ul class="simple nested-toc-section">setSockOpt
<li><a class="reference" href="#setSockOpt%2CAsyncFD%2Cint%2Cint%2Cint"
title="setSockOpt(socket: AsyncFD; level, optname, optval: int): bool">setSockOpt(socket: AsyncFD; level, optname, optval: int): bool</a></li>
<li><a class="reference" href="#setSockOpt%2CAsyncFD%2Cint%2Cint%2Cpointer%2Cint"
title="setSockOpt(socket: AsyncFD; level, optname: int; value: pointer; valuelen: int): bool">setSockOpt(socket: AsyncFD; level, optname: int; value: pointer; valuelen: int): bool</a></li>
</ul>
<ul class="simple nested-toc-section">setSockOpt2
<li><a class="reference" href="#setSockOpt2%2CAsyncFD%2Cint%2Cint%2Cint"
title="setSockOpt2(socket: AsyncFD; level, optname, optval: int): Result[void,
OSErrorCode]">setSockOpt2(socket: AsyncFD; level, optname, optval: int): Result[void,
OSErrorCode]</a></li>
<li><a class="reference" href="#setSockOpt2%2CAsyncFD%2Cint%2Cint%2Cpointer%2Cint"
title="setSockOpt2(socket: AsyncFD; level, optname: int; value: pointer; valuelen: int): Result[
void, OSErrorCode]">setSockOpt2(socket: AsyncFD; level, optname: int; value: pointer; valuelen: int): Result[
void, OSErrorCode]</a></li>
</ul>
<ul class="simple nested-toc-section">wrapAsyncSocket
<li><a class="reference" href="#wrapAsyncSocket"
title="wrapAsyncSocket(sock: cint | SocketHandle): AsyncFD">wrapAsyncSocket(sock: cint | SocketHandle): AsyncFD</a></li>
</ul>
<ul class="simple nested-toc-section">wrapAsyncSocket2
<li><a class="reference" href="#wrapAsyncSocket2"
title="wrapAsyncSocket2(sock: cint | SocketHandle): Result[AsyncFD, OSErrorCode]">wrapAsyncSocket2(sock: cint | SocketHandle): Result[AsyncFD, OSErrorCode]</a></li>
</ul>
</ul>
</li>
</ul>
</div>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L1"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L1" class="link-seesrc" target="_blank" >Edit</a>
<div class="nine columns" id="content">
<div id="tocRoot"></div>
<p class="module-desc"></p>
<div class="section" id="6">
<h1><a class="toc-backref" href="#6">Imports</a></h1>
<dl class="item">
<a class="reference external" href="asyncloop.html">asyncloop</a>, <a class="reference external" href="osdefs.html">osdefs</a>, <a class="reference external" href="osutils.html">osutils</a>
</dl></div>
<div class="section" id="10">
<h1><a class="toc-backref" href="#10">Consts</a></h1>
<dl class="item">
<div id="asyncInvalidPipe">
<dt><pre><a href="handles.html#asyncInvalidPipe"><span class="Identifier">asyncInvalidPipe</span></a> <span class="Other">=</span> <span class="DecNumber">-1'i32</span></pre></dt>
<dd>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L22"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L22" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="asyncInvalidSocket">
<dt><pre><a href="handles.html#asyncInvalidSocket"><span class="Identifier">asyncInvalidSocket</span></a> <span class="Other">=</span> <span class="DecNumber">-1'i32</span></pre></dt>
<dd>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L21"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L21" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
</dl></div>
<div class="section" id="12">
<h1><a class="toc-backref" href="#12">Procs</a></h1>
<dl class="item">
<div id="createAsyncPipe">
<dt><pre><span class="Keyword">proc</span> <a href="#createAsyncPipe"><span class="Identifier">createAsyncPipe</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Keyword">tuple</span><span class="Other">[</span><span class="Identifier">read</span><span class="Other">:</span> <a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">,</span> <span class="Identifier">write</span><span class="Other">:</span> <a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Create new asynchronouse pipe. Returns tuple of read pipe handle and write pipe handle<tt class="docutils literal"><span class="pre">asyncInvalidPipe</span></tt> on error.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L264"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L264" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="createAsyncSocket,Domain,SockType,Protocol">
<dt><pre><span class="Keyword">proc</span> <a href="#createAsyncSocket%2CDomain%2CSockType%2CProtocol"><span class="Identifier">createAsyncSocket</span></a><span class="Other">(</span><span class="Identifier">domain</span><span class="Other">:</span> <span class="Identifier">Domain</span><span class="Other">;</span> <span class="Identifier">sockType</span><span class="Other">:</span> <span class="Identifier">SockType</span><span class="Other">;</span> <span class="Identifier">protocol</span><span class="Other">:</span> <span class="Identifier">Protocol</span><span class="Other">;</span>
<span class="Identifier">inherit</span> <span class="Other">=</span> <span class="Identifier">true</span><span class="Other">)</span><span class="Other">:</span> <a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Creates new asynchronous socket. Returns <tt class="docutils literal"><span class="pre">asyncInvalidSocket</span></tt> on error.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L188"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L188" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="createAsyncSocket2,Domain,SockType,Protocol">
<dt><pre><span class="Keyword">proc</span> <a href="#createAsyncSocket2%2CDomain%2CSockType%2CProtocol"><span class="Identifier">createAsyncSocket2</span></a><span class="Other">(</span><span class="Identifier">domain</span><span class="Other">:</span> <span class="Identifier">Domain</span><span class="Other">;</span> <span class="Identifier">sockType</span><span class="Other">:</span> <span class="Identifier">SockType</span><span class="Other">;</span> <span class="Identifier">protocol</span><span class="Other">:</span> <span class="Identifier">Protocol</span><span class="Other">;</span>
<span class="Identifier">inherit</span> <span class="Other">=</span> <span class="Identifier">true</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">,</span> <span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Creates new asynchronous socket.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L128"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L128" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="getDualstack,AsyncFD">
<dt><pre><span class="Keyword">proc</span> <a href="#getDualstack%2CAsyncFD"><span class="Identifier">getDualstack</span></a><span class="Other">(</span><span class="Identifier">fd</span><span class="Other">:</span> <a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><span class="Identifier">bool</span><span class="Other">,</span> <span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Returns <tt class="docutils literal"><span class="pre"><span class="Identifier">true</span></span></tt> if <tt class="docutils literal"><span class="pre"><span class="Identifier">IPV6_V6ONLY</span></span></tt> socket option set to <tt class="docutils literal"><span class="pre"><span class="Identifier">false</span></span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L275"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L275" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="getInheritable,AsyncFD">
<dt><pre><span class="Keyword">proc</span> <a href="#getInheritable%2CAsyncFD"><span class="Identifier">getInheritable</span></a><span class="Other">(</span><span class="Identifier">fd</span><span class="Other">:</span> <a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><span class="Identifier">bool</span><span class="Other">,</span> <span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Returns <tt class="docutils literal"><span class="pre">true</span></tt> if <tt class="docutils literal"><span class="pre">fd</span></tt> is inheritable handle.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L251"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L251" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="getMaxOpenFiles">
<dt><pre><span class="Keyword">proc</span> <a href="#getMaxOpenFiles"><span class="Identifier">getMaxOpenFiles</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">int</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">OSError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Returns maximum file descriptor number that can be opened by this process.</p>
<p>Note: On Windows its impossible to obtain such number, so getMaxOpenFiles() will return constant value of 16384. You can get more information on this link <a class="reference external" href="https://docs.microsoft.com/en-us/archive/blogs/markrussinovich/pushing-the-limits-of-windows-handles">https://docs.microsoft.com/en-us/archive/blogs/markrussinovich/pushing-the-limits-of-windows-handles</a></p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L232"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L232" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="getMaxOpenFiles2">
<dt><pre><span class="Keyword">proc</span> <a href="#getMaxOpenFiles2"><span class="Identifier">getMaxOpenFiles2</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><span class="Identifier">int</span><span class="Other">,</span> <span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Returns maximum file descriptor number that can be opened by this process.</p>
<p>Note: On Windows its impossible to obtain such number, so getMaxOpenFiles() will return constant value of 16384. You can get more information on this link <a class="reference external" href="https://docs.microsoft.com/en-us/archive/blogs/markrussinovich/pushing-the-limits-of-windows-handles">https://docs.microsoft.com/en-us/archive/blogs/markrussinovich/pushing-the-limits-of-windows-handles</a></p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L203"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L203" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="getSocketError,AsyncFD,int">
<dt><pre><span class="Keyword">proc</span> <a href="#getSocketError%2CAsyncFD%2Cint"><span class="Identifier">getSocketError</span></a><span class="Other">(</span><span class="Identifier">socket</span><span class="Other">:</span> <a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">;</span> <span class="Identifier">err</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">&quot;Please use getSocketError() instead&quot;</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<div class="deprecation-message">
<b>Deprecated:</b> Please use getSocketError() instead
</div>
Recover error code associated with socket handle <tt class="docutils literal"><span class="pre">socket</span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L101"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L101" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="getSocketError2,AsyncFD">
<dt><pre><span class="Keyword">proc</span> <a href="#getSocketError2%2CAsyncFD"><span class="Identifier">getSocketError2</span></a><span class="Other">(</span><span class="Identifier">socket</span><span class="Other">:</span> <a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><span class="Identifier">cint</span><span class="Other">,</span> <span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L109"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L109" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="getSockOpt,AsyncFD,int,int,int">
<dt><pre><span class="Keyword">proc</span> <a href="#getSockOpt%2CAsyncFD%2Cint%2Cint%2Cint"><span class="Identifier">getSockOpt</span></a><span class="Other">(</span><span class="Identifier">socket</span><span class="Other">:</span> <a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">;</span> <span class="Identifier">level</span><span class="Other">,</span> <span class="Identifier">optname</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">&quot;Please use getSockOpt2() instead&quot;</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<div class="deprecation-message">
<b>Deprecated:</b> Please use getSockOpt2() instead
</div>
<tt class="docutils literal"><span class="pre"><span class="Identifier">getsockopt</span><span class="Punctuation">(</span><span class="Punctuation">)</span></span></tt> for integer options. Returns <tt class="docutils literal"><span class="pre">true</span></tt> on success, <tt class="docutils literal"><span class="pre">false</span></tt> on error.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L85"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L85" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="getSockOpt,AsyncFD,int,int,pointer,int">
<dt><pre><span class="Keyword">proc</span> <a href="#getSockOpt%2CAsyncFD%2Cint%2Cint%2Cpointer%2Cint"><span class="Identifier">getSockOpt</span></a><span class="Other">(</span><span class="Identifier">socket</span><span class="Other">:</span> <a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">;</span> <span class="Identifier">level</span><span class="Other">,</span> <span class="Identifier">optname</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">pointer</span><span class="Other">;</span>
<span class="Identifier">valuelen</span><span class="Other">:</span> <span class="Keyword">var</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">&quot;Please use getSockOpt2() instead&quot;</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<div class="deprecation-message">
<b>Deprecated:</b> Please use getSockOpt2() instead
</div>
<tt class="docutils literal"><span class="pre"><span class="Identifier">getsockopt</span><span class="Punctuation">(</span><span class="Punctuation">)</span></span></tt> for custom options (pointer and length). Returns <tt class="docutils literal"><span class="pre">true</span></tt> on success, <tt class="docutils literal"><span class="pre">false</span></tt> on error.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L93"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L93" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="getSockOpt2,AsyncFD,int,int">
<dt><pre><span class="Keyword">proc</span> <a href="#getSockOpt2%2CAsyncFD%2Cint%2Cint"><span class="Identifier">getSockOpt2</span></a><span class="Other">(</span><span class="Identifier">socket</span><span class="Other">:</span> <a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">;</span> <span class="Identifier">level</span><span class="Other">,</span> <span class="Identifier">optname</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><span class="Identifier">cint</span><span class="Other">,</span> <span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L63"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L63" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="getSockOpt2,AsyncFD,int,int,type">
<dt><pre><span class="Keyword">proc</span> <a href="#getSockOpt2%2CAsyncFD%2Cint%2Cint%2Ctype"><span class="Identifier">getSockOpt2</span></a><span class="Other">(</span><span class="Identifier">socket</span><span class="Other">:</span> <a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">;</span> <span class="Identifier">level</span><span class="Other">,</span> <span class="Identifier">optname</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">T</span><span class="Other">:</span> <span class="Identifier">type</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">,</span>
<span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L74"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L74" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="isAvailable,Domain">
<dt><pre><span class="Keyword">proc</span> <a href="#isAvailable%2CDomain"><span class="Identifier">isAvailable</span></a><span class="Other">(</span><span class="Identifier">domain</span><span class="Other">:</span> <span class="Identifier">Domain</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L112"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L112" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="setDualstack,AsyncFD,bool">
<dt><pre><span class="Keyword">proc</span> <a href="#setDualstack%2CAsyncFD%2Cbool"><span class="Identifier">setDualstack</span></a><span class="Other">(</span><span class="Identifier">fd</span><span class="Other">:</span> <a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <span class="Identifier">bool</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><span class="Identifier">void</span><span class="Other">,</span> <span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Sets <tt class="docutils literal"><span class="pre"><span class="Identifier">IPV6_V6ONLY</span></span></tt> socket option value to <tt class="docutils literal"><span class="pre"><span class="Identifier">false</span></span></tt> if <tt class="docutils literal"><span class="pre"><span class="Identifier">value</span> <span class="Operator">==</span> <span class="Identifier">true</span></span></tt> and to <tt class="docutils literal"><span class="pre"><span class="Identifier">true</span></span></tt> if <tt class="docutils literal"><span class="pre"><span class="Identifier">value</span> <span class="Operator">==</span> <span class="Identifier">false</span></span></tt>.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L286"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L286" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="setMaxOpenFiles,int">
<dt><pre><span class="Keyword">proc</span> <a href="#setMaxOpenFiles%2Cint"><span class="Identifier">setMaxOpenFiles</span></a><span class="Other">(</span><span class="Identifier">count</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">OSError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Set maximum file descriptor number that can be opened by this process.</p>
<p>Note: On Windows its impossible to set this value, so it just a nop call.</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L243"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L243" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="setMaxOpenFiles2,int">
<dt><pre><span class="Keyword">proc</span> <a href="#setMaxOpenFiles2%2Cint"><span class="Identifier">setMaxOpenFiles2</span></a><span class="Other">(</span><span class="Identifier">count</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><span class="Identifier">void</span><span class="Other">,</span> <span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Set maximum file descriptor number that can be opened by this process.</p>
<p>Note: On Windows its impossible to set this value, so it just a nop call.</p>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L217"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L217" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="setSocketBlocking,SocketHandle,bool">
<dt><pre><span class="Keyword">proc</span> <a href="#setSocketBlocking%2CSocketHandle%2Cbool"><span class="Identifier">setSocketBlocking</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <span class="Identifier">SocketHandle</span><span class="Other">;</span> <span class="Identifier">blocking</span><span class="Other">:</span> <span class="Identifier">bool</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">&quot;Please use setDescriptorBlocking() instead&quot;</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<div class="deprecation-message">
<b>Deprecated:</b> Please use setDescriptorBlocking() instead
</div>
Sets blocking mode on socket.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L24"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L24" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="setSockOpt,AsyncFD,int,int,int">
<dt><pre><span class="Keyword">proc</span> <a href="#setSockOpt%2CAsyncFD%2Cint%2Cint%2Cint"><span class="Identifier">setSockOpt</span></a><span class="Other">(</span><span class="Identifier">socket</span><span class="Other">:</span> <a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">;</span> <span class="Identifier">level</span><span class="Other">,</span> <span class="Identifier">optname</span><span class="Other">,</span> <span class="Identifier">optval</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">&quot;Please use setSockOpt2() instead&quot;</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<div class="deprecation-message">
<b>Deprecated:</b> Please use setSockOpt2() instead
</div>
<tt class="docutils literal"><span class="pre"><span class="Identifier">setsockopt</span><span class="Punctuation">(</span><span class="Punctuation">)</span></span></tt> for integer options. Returns <tt class="docutils literal"><span class="pre">true</span></tt> on success, <tt class="docutils literal"><span class="pre">false</span></tt> on error.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L50"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L50" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="setSockOpt,AsyncFD,int,int,pointer,int">
<dt><pre><span class="Keyword">proc</span> <a href="#setSockOpt%2CAsyncFD%2Cint%2Cint%2Cpointer%2Cint"><span class="Identifier">setSockOpt</span></a><span class="Other">(</span><span class="Identifier">socket</span><span class="Other">:</span> <a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">;</span> <span class="Identifier">level</span><span class="Other">,</span> <span class="Identifier">optname</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <span class="Identifier">pointer</span><span class="Other">;</span>
<span class="Identifier">valuelen</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span><span class="Other">:</span> <span class="StringLit">&quot;Please use setSockOpt2() instead&quot;</span><span class="Other">,</span>
<span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<div class="deprecation-message">
<b>Deprecated:</b> Please use setSockOpt2() instead
</div>
<tt class="docutils literal"><span class="pre"><span class="Identifier">setsockopt</span><span class="Punctuation">(</span><span class="Punctuation">)</span></span></tt> for custom options (pointer and length). Returns <tt class="docutils literal"><span class="pre">true</span></tt> on success, <tt class="docutils literal"><span class="pre">false</span></tt> on error.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L56"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L56" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="setSockOpt2,AsyncFD,int,int,int">
<dt><pre><span class="Keyword">proc</span> <a href="#setSockOpt2%2CAsyncFD%2Cint%2Cint%2Cint"><span class="Identifier">setSockOpt2</span></a><span class="Other">(</span><span class="Identifier">socket</span><span class="Other">:</span> <a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">;</span> <span class="Identifier">level</span><span class="Other">,</span> <span class="Identifier">optname</span><span class="Other">,</span> <span class="Identifier">optval</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><span class="Identifier">void</span><span class="Other">,</span>
<span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L31"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L31" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="setSockOpt2,AsyncFD,int,int,pointer,int">
<dt><pre><span class="Keyword">proc</span> <a href="#setSockOpt2%2CAsyncFD%2Cint%2Cint%2Cpointer%2Cint"><span class="Identifier">setSockOpt2</span></a><span class="Other">(</span><span class="Identifier">socket</span><span class="Other">:</span> <a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">;</span> <span class="Identifier">level</span><span class="Other">,</span> <span class="Identifier">optname</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">;</span> <span class="Identifier">value</span><span class="Other">:</span> <span class="Identifier">pointer</span><span class="Other">;</span>
<span class="Identifier">valuelen</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><span class="Identifier">void</span><span class="Other">,</span> <span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<tt class="docutils literal"><span class="pre"><span class="Identifier">setsockopt</span><span class="Punctuation">(</span><span class="Punctuation">)</span></span></tt> for custom options (pointer and length). Returns <tt class="docutils literal"><span class="pre">true</span></tt> on success, <tt class="docutils literal"><span class="pre">false</span></tt> on error.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L40"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L40" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="wrapAsyncSocket">
<dt><pre><span class="Keyword">proc</span> <a href="#wrapAsyncSocket"><span class="Identifier">wrapAsyncSocket</span></a><span class="Other">(</span><span class="Identifier">sock</span><span class="Other">:</span> <span class="Identifier">cint</span> <span class="Operator">|</span> <span class="Identifier">SocketHandle</span><span class="Other">)</span><span class="Other">:</span> <a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">CatchableError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Wraps socket to asynchronous socket handle. Return <tt class="docutils literal"><span class="pre">asyncInvalidSocket</span></tt> on error.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L196"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L196" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
<div id="wrapAsyncSocket2">
<dt><pre><span class="Keyword">proc</span> <a href="#wrapAsyncSocket2"><span class="Identifier">wrapAsyncSocket2</span></a><span class="Other">(</span><span class="Identifier">sock</span><span class="Other">:</span> <span class="Identifier">cint</span> <span class="Operator">|</span> <span class="Identifier">SocketHandle</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Result</span><span class="Other">[</span><a href="internal/asyncengine.html#AsyncFD"><span class="Identifier">AsyncFD</span></a><span class="Other">,</span> <span class="Identifier">OSErrorCode</span><span class="Other">]</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Wraps socket to asynchronous socket handle.
&nbsp;&nbsp;<a
href="https://github.com/status-im/nim-chronos/tree/master/chronos/handles.nim#L177"
class="link-seesrc" target="_blank">Source</a>
&nbsp;&nbsp;<a href="https://github.com/status-im/nim-chronos/edit/devel/chronos/handles.nim#L177" class="link-seesrc" target="_blank" >Edit</a>
</dd>
</div>
</dl></div>
</div>
</div>
<div class="row">
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br/>
<small style="color: var(--hint);">Made with Nim. Generated: 2024-11-28 08:22:46 UTC</small>
</div>
</div>
</div>
</div>
</body>
</html>