blob: cee7f3a4e814b72a6fac4fd91ae3787f91182c9e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
// Populate the sidebar
//
// This is a script, and not included directly in the page, to control the total size of the book.
// The TOC contains an entry for each page, so if each page includes a copy of the TOC,
// the total size of the page becomes O(n**2).
var sidebarScrollbox = document.querySelector("#sidebar .sidebar-scrollbox");
sidebarScrollbox.innerHTML = '<ol class="chapter"><li class="chapter-item expanded affix "><a href="copyright.html">Copyright</a></li><li class="chapter-item expanded affix "><a href="dedication.html">Dedication</a></li><li class="chapter-item expanded affix "><a href="preface.html">Preface</a></li><li class="chapter-item expanded "><a href="api/index.html"><strong aria-hidden="true">1.</strong> API Reference</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item expanded "><a href="api/msg.html"><strong aria-hidden="true">1.1.</strong> Messages</a></li><li class="chapter-item expanded "><a href="api/memory.html"><strong aria-hidden="true">1.2.</strong> Memory</a></li><li class="chapter-item expanded "><a href="api/time.html"><strong aria-hidden="true">1.3.</strong> Time</a></li><li class="chapter-item expanded "><a href="api/url.html"><strong aria-hidden="true">1.4.</strong> URLs</a></li><li class="chapter-item expanded "><a href="api/aio.html"><strong aria-hidden="true">1.5.</strong> Asynchronous I/O</a></li><li class="chapter-item expanded "><a href="api/synch.html"><strong aria-hidden="true">1.6.</strong> Synchronization</a></li><li class="chapter-item expanded "><a href="api/thread.html"><strong aria-hidden="true">1.7.</strong> Threads</a></li><li class="chapter-item expanded "><a href="api/logging.html"><strong aria-hidden="true">1.8.</strong> Logging</a></li><li class="chapter-item expanded "><a href="api/stats.html"><strong aria-hidden="true">1.9.</strong> Statistics</a></li><li class="chapter-item expanded "><a href="api/errors.html"><strong aria-hidden="true">1.10.</strong> Errors</a></li><li class="chapter-item expanded "><a href="api/misc.html"><strong aria-hidden="true">1.11.</strong> Miscellaneous</a></li><li class="chapter-item expanded "><a href="api/id_map.html"><strong aria-hidden="true">1.12.</strong> ID Map</a></li><li class="chapter-item expanded "><a href="api/cmd_opts.html"><strong aria-hidden="true">1.13.</strong> Command Options</a></li></ol></li><li class="chapter-item expanded "><a href="proto/index.html"><strong aria-hidden="true">2.</strong> Protocols</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item expanded "><a href="proto/bus.html"><strong aria-hidden="true">2.1.</strong> BUS Protocol</a></li><li class="chapter-item expanded "><a href="proto/pair.html"><strong aria-hidden="true">2.2.</strong> PAIR Protocol</a></li><li class="chapter-item expanded "><a href="proto/pub.html"><strong aria-hidden="true">2.3.</strong> PUB Protocol</a></li><li class="chapter-item expanded "><a href="proto/pull.html"><strong aria-hidden="true">2.4.</strong> PULL Protocol</a></li><li class="chapter-item expanded "><a href="proto/push.html"><strong aria-hidden="true">2.5.</strong> PUSH Protocol</a></li><li class="chapter-item expanded "><a href="proto/rep.html"><strong aria-hidden="true">2.6.</strong> REP Protocol</a></li><li class="chapter-item expanded "><a href="proto/req.html"><strong aria-hidden="true">2.7.</strong> REQ Protocol</a></li><li class="chapter-item expanded "><a href="proto/respondent.html"><strong aria-hidden="true">2.8.</strong> RESPONDENT Protocol</a></li><li class="chapter-item expanded "><a href="proto/sub.html"><strong aria-hidden="true">2.9.</strong> SUB Protocol</a></li><li class="chapter-item expanded "><a href="proto/surveyor.html"><strong aria-hidden="true">2.10.</strong> SURVEYOR Protocol</a></li></ol></li><li class="chapter-item expanded "><a href="tran/index.html"><strong aria-hidden="true">3.</strong> Transports</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item expanded "><a href="tran/inproc.html"><strong aria-hidden="true">3.1.</strong> Intra-Process Transport</a></li><li class="chapter-item expanded "><a href="tran/ipc.html"><strong aria-hidden="true">3.2.</strong> Inter-Process Transport</a></li><li class="chapter-item expanded "><a href="tran/socket.html"><strong aria-hidden="true">3.3.</strong> BSD Socket (Experimental)</a></li><li class="chapter-item expanded "><a href="tran/udp.html"><strong aria-hidden="true">3.4.</strong> UDP Transport (Experimental)</a></li></ol></li><li class="chapter-item expanded "><a href="migrate/index.html"><strong aria-hidden="true">4.</strong> Migration Guides</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item expanded "><a href="migrate/nng1.html"><strong aria-hidden="true">4.1.</strong> Migrating from NNG 1.x</a></li><li class="chapter-item expanded "><a href="migrate/nanomsg.html"><strong aria-hidden="true">4.2.</strong> Migrating from libnanomsg</a></li></ol></li><li class="chapter-item expanded "><a href="indexing.html">Index</a></li></ol>';
(function() {
let current_page = document.location.href.toString();
if (current_page.endsWith("/")) {
current_page += "index.html";
}
var links = sidebarScrollbox.querySelectorAll("a");
var l = links.length;
for (var i = 0; i < l; ++i) {
var link = links[i];
var href = link.getAttribute("href");
if (href && !href.startsWith("#") && !/^(?:[a-z+]+:)?\/\//.test(href)) {
link.href = path_to_root + href;
}
// The "index" page is supposed to alias the first chapter in the book.
if (link.href === current_page || (i === 0 && path_to_root === "" && current_page.endsWith("/index.html"))) {
link.classList.add("active");
var parent = link.parentElement;
while (parent) {
if (parent.tagName === "LI" && parent.previousElementSibling) {
if (parent.previousElementSibling.classList.contains("chapter-item")) {
parent.previousElementSibling.classList.add("expanded");
}
}
parent = parent.parentElement;
}
}
}
})();
// Track and set sidebar scroll position
sidebarScrollbox.addEventListener('click', function(e) {
if (e.target.tagName === 'A') {
sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
}
}, { passive: true });
var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
sessionStorage.removeItem('sidebar-scroll');
if (sidebarScrollTop) {
// preserve sidebar scroll position when navigating via links within sidebar
sidebarScrollbox.scrollTop = sidebarScrollTop;
} else {
// scroll sidebar to current active section when navigating via "next/previous chapter" buttons
var activeSection = document.querySelector('#sidebar .active');
if (activeSection) {
activeSection.scrollIntoView({ block: 'center' });
}
}
|