summaryrefslogtreecommitdiff
path: root/newref/book
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-03-27 22:31:14 -0700
committerGarrett D'Amore <garrett@damore.org>2024-03-27 22:31:14 -0700
commited7adc3b9e8bb8cf028221016d60c24edb9d7750 (patch)
tree4b2eecf080bf5700de717edb81f1fe2ffc31ad25 /newref/book
parent6bdb45ed6b1ab0b256ca49d3da8974c093ee6354 (diff)
downloadnng-ed7adc3b9e8bb8cf028221016d60c24edb9d7750.tar.gz
nng-ed7adc3b9e8bb8cf028221016d60c24edb9d7750.tar.bz2
nng-ed7adc3b9e8bb8cf028221016d60c24edb9d7750.zip
add missing pub.html to refnew
Diffstat (limited to 'newref/book')
-rw-r--r--newref/book/protocols/pub.html343
1 files changed, 343 insertions, 0 deletions
diff --git a/newref/book/protocols/pub.html b/newref/book/protocols/pub.html
new file mode 100644
index 00000000..06714fb0
--- /dev/null
+++ b/newref/book/protocols/pub.html
@@ -0,0 +1,343 @@
+<!DOCTYPE HTML>
+<html lang="en" class="light" dir="ltr">
+ <head>
+ <!-- Book generated using mdBook -->
+ <meta charset="UTF-8">
+ <title>PUB - NNG Reference Manual</title>
+
+
+ <!-- Custom HTML head -->
+
+ <meta name="description" content="">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="theme-color" content="#ffffff">
+
+ <link rel="icon" href="../favicon.svg">
+ <link rel="shortcut icon" href="../favicon.png">
+ <link rel="stylesheet" href="../css/variables.css">
+ <link rel="stylesheet" href="../css/general.css">
+ <link rel="stylesheet" href="../css/chrome.css">
+ <link rel="stylesheet" href="../css/print.css" media="print">
+
+ <!-- Fonts -->
+ <link rel="stylesheet" href="../FontAwesome/css/font-awesome.css">
+ <link rel="stylesheet" href="../fonts/fonts.css">
+
+ <!-- Highlight.js Stylesheets -->
+ <link rel="stylesheet" href="../highlight.css">
+ <link rel="stylesheet" href="../tomorrow-night.css">
+ <link rel="stylesheet" href="../ayu-highlight.css">
+
+ <!-- Custom theme stylesheets -->
+
+ </head>
+ <body class="sidebar-visible no-js">
+ <div id="body-container">
+ <!-- Provide site root to javascript -->
+ <script>
+ var path_to_root = "../";
+ var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light";
+ </script>
+
+ <!-- Work around some values being stored in localStorage wrapped in quotes -->
+ <script>
+ try {
+ var theme = localStorage.getItem('mdbook-theme');
+ var sidebar = localStorage.getItem('mdbook-sidebar');
+
+ if (theme.startsWith('"') && theme.endsWith('"')) {
+ localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
+ }
+
+ if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
+ localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
+ }
+ } catch (e) { }
+ </script>
+
+ <!-- Set the theme before any content is loaded, prevents flash -->
+ <script>
+ var theme;
+ try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
+ if (theme === null || theme === undefined) { theme = default_theme; }
+ var html = document.querySelector('html');
+ html.classList.remove('light')
+ html.classList.add(theme);
+ var body = document.querySelector('body');
+ body.classList.remove('no-js')
+ body.classList.add('js');
+ </script>
+
+ <input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
+
+ <!-- Hide / unhide sidebar before it is displayed -->
+ <script>
+ var body = document.querySelector('body');
+ var sidebar = null;
+ var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
+ if (document.body.clientWidth >= 1080) {
+ try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
+ sidebar = sidebar || 'visible';
+ } else {
+ sidebar = 'hidden';
+ }
+ sidebar_toggle.checked = sidebar === 'visible';
+ body.classList.remove('sidebar-visible');
+ body.classList.add("sidebar-" + sidebar);
+ </script>
+
+ <nav id="sidebar" class="sidebar" aria-label="Table of contents">
+ <div class="sidebar-scrollbox">
+ <ol class="chapter"><li class="chapter-item expanded "><a href="../chapter_1.html"><strong aria-hidden="true">1.</strong> Chapter 1</a></li><li class="chapter-item expanded "><a href="../overview/index.html"><strong aria-hidden="true">2.</strong> Overview</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../overview/raw.html"><strong aria-hidden="true">2.1.</strong> RAW mode</a></li></ol></li><li class="chapter-item expanded "><a href="../protocols/index.html"><strong aria-hidden="true">3.</strong> Protocols</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../protocols/bus.html"><strong aria-hidden="true">3.1.</strong> BUS</a></li><li class="chapter-item expanded "><a href="../protocols/pub.html" class="active"><strong aria-hidden="true">3.2.</strong> PUB</a></li><li class="chapter-item "><a href="../protocols/rep.html"><strong aria-hidden="true">3.3.</strong> REP</a></li></ol></li><li class="chapter-item expanded "><a href="../transports/index.html"><strong aria-hidden="true">4.</strong> Transports</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../transports/inproc.html"><strong aria-hidden="true">4.1.</strong> INPROC</a></li><li class="chapter-item "><a href="../transports/tcp.html"><strong aria-hidden="true">4.2.</strong> TCP</a></li></ol></li><li class="chapter-item expanded "><a href="../api/index.html"><strong aria-hidden="true">5.</strong> API Reference</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../api/msg/index.html"><strong aria-hidden="true">5.1.</strong> Messages</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../api/msg/nng_msg_alloc.html"><strong aria-hidden="true">5.1.1.</strong> nng_msg_alloc</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_append.html"><strong aria-hidden="true">5.1.2.</strong> nng_msg_append</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_body.html"><strong aria-hidden="true">5.1.3.</strong> nng_msg_body</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_capacity.html"><strong aria-hidden="true">5.1.4.</strong> nng_msg_capacity</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_chop.html"><strong aria-hidden="true">5.1.5.</strong> nng_msg_chop</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_clear.html"><strong aria-hidden="true">5.1.6.</strong> nng_msg_clear</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_dup.html"><strong aria-hidden="true">5.1.7.</strong> nng_msg_dup</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_free.html"><strong aria-hidden="true">5.1.8.</strong> nng_msg_free</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_get_pipe.html"><strong aria-hidden="true">5.1.9.</strong> nng_msg_get_pipe</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_header.html"><strong aria-hidden="true">5.1.10.</strong> nng_msg_header</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_header_append.html"><strong aria-hidden="true">5.1.11.</strong> nng_msg_header_append</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_header_chop.html"><strong aria-hidden="true">5.1.12.</strong> nng_msg_header_chop</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_header_clear.html"><strong aria-hidden="true">5.1.13.</strong> nng_msg_header_clear</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_header_insert.html"><strong aria-hidden="true">5.1.14.</strong> nng_msg_header_insert</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_header_len.html"><strong aria-hidden="true">5.1.15.</strong> nng_msg_header_len</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_header_trim.html"><strong aria-hidden="true">5.1.16.</strong> nng_msg_header_trim</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_insert.html"><strong aria-hidden="true">5.1.17.</strong> nng_msg_insert</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_len.html"><strong aria-hidden="true">5.1.18.</strong> nng_msg_len</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_realloc.html"><strong aria-hidden="true">5.1.19.</strong> nng_msg_realloc</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_reserve.html"><strong aria-hidden="true">5.1.20.</strong> nng_msg_reserve</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_set_pipe.html"><strong aria-hidden="true">5.1.21.</strong> nng_msg_set_pipe</a></li><li class="chapter-item "><a href="../api/msg/nng_msg_trim.html"><strong aria-hidden="true">5.1.22.</strong> nng_msg_trim</a></li></ol></li><li class="chapter-item "><a href="../api/socket/index.html"><strong aria-hidden="true">5.2.</strong> Sockets</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../api/socket/nng_bus_open.html"><strong aria-hidden="true">5.2.1.</strong> nng_bus_open</a></li><li class="chapter-item "><a href="../api/socket/nng_close.html"><strong aria-hidden="true">5.2.2.</strong> nng_close</a></li><li class="chapter-item "><a href="../api/socket/nng_pub_open.html"><strong aria-hidden="true">5.2.3.</strong> nng_pub_open</a></li></ol></li><li class="chapter-item "><a href="../api/context/index.html"><strong aria-hidden="true">5.3.</strong> Contexts</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../api/context/nng_ctx_close.html"><strong aria-hidden="true">5.3.1.</strong> nng_ctx_close</a></li><li class="chapter-item "><a href="../api/context/nng_ctx_get.html"><strong aria-hidden="true">5.3.2.</strong> nng_ctx_get</a></li><li class="chapter-item "><a href="../api/context/nng_ctx_getopt.html"><strong aria-hidden="true">5.3.3.</strong> nng_ctx_getopt</a></li><li class="chapter-item "><a href="../api/context/nng_ctx_id.html"><strong aria-hidden="true">5.3.4.</strong> nng_ctx_id</a></li><li class="chapter-item "><a href="../api/context/nng_ctx_open.html"><strong aria-hidden="true">5.3.5.</strong> nng_ctx_open</a></li><li class="chapter-item "><a href="../api/context/nng_ctx_recv.html"><strong aria-hidden="true">5.3.6.</strong> nng_ctx_recv</a></li><li class="chapter-item "><a href="../api/context/nng_ctx_recvmsg.html"><strong aria-hidden="true">5.3.7.</strong> nng_ctx_recvmsg</a></li><li class="chapter-item "><a href="../api/context/nng_ctx_send.html"><strong aria-hidden="true">5.3.8.</strong> nng_ctx_send</a></li><li class="chapter-item "><a href="../api/context/nng_ctx_sendmsg.html"><strong aria-hidden="true">5.3.9.</strong> nng_ctx_sendmsg</a></li><li class="chapter-item "><a href="../api/context/nng_ctx_set.html"><strong aria-hidden="true">5.3.10.</strong> nng_ctx_set</a></li><li class="chapter-item "><a href="../api/context/nng_ctx_setopt.html"><strong aria-hidden="true">5.3.11.</strong> nng_ctx_setopt</a></li></ol></li><li class="chapter-item "><a href="../api/aio/index.html"><strong aria-hidden="true">5.4.</strong> Asynchronous I/O</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../api/aio/nng_aio_abort.html"><strong aria-hidden="true">5.4.1.</strong> nng_aio_abort</a></li><li class="chapter-item "><a href="../api/aio/nng_aio_alloc.html"><strong aria-hidden="true">5.4.2.</strong> nng_aio_alloc</a></li><li class="chapter-item "><a href="../api/aio/nng_aio_busy.html"><strong aria-hidden="true">5.4.3.</strong> nng_aio_busy</a></li><li class="chapter-item "><a href="../api/aio/nng_aio_cancel.html"><strong aria-hidden="true">5.4.4.</strong> nng_aio_cancel</a></li><li class="chapter-item "><a href="../api/aio/nng_aio_count.html"><strong aria-hidden="true">5.4.5.</strong> nng_aio_count</a></li><li class="chapter-item "><a href="../api/aio/nng_aio_free.html"><strong aria-hidden="true">5.4.6.</strong> nng_aio_free</a></li><li class="chapter-item "><a href="../api/aio/nng_aio_get_msg.html"><strong aria-hidden="true">5.4.7.</strong> nng_aio_get_msg</a></li><li class="chapter-item "><a href="../api/aio/nng_aio_get_output.html"><strong aria-hidden="true">5.4.8.</strong> nng_aio_get_output</a></li><li class="chapter-item "><a href="../api/aio/nng_aio_result.html"><strong aria-hidden="true">5.4.9.</strong> nng_aio_result</a></li><li class="chapter-item "><a href="../api/aio/nng_aio_set_input.html"><strong aria-hidden="true">5.4.10.</strong> nng_aio_set_input</a></li><li class="chapter-item "><a href="../api/aio/nng_aio_set_iov.html"><strong aria-hidden="true">5.4.11.</strong> nng_aio_set_iov</a></li><li class="chapter-item "><a href="../api/aio/nng_aio_set_msg.html"><strong aria-hidden="true">5.4.12.</strong> nng_aio_set_msg</a></li><li class="chapter-item "><a href="../api/aio/nng_aio_set_timeout.html"><strong aria-hidden="true">5.4.13.</strong> nng_aio_set_timeout</a></li><li class="chapter-item "><a href="../api/aio/nng_aio_stop.html"><strong aria-hidden="true">5.4.14.</strong> nng_aio_stop</a></li><li class="chapter-item "><a href="../api/aio/nng_aio_wait.html"><strong aria-hidden="true">5.4.15.</strong> nng_aio_wait</a></li></ol></li><li class="chapter-item "><a href="../api/aio_provider/index.html"><strong aria-hidden="true">5.5.</strong> Asynchronous I/O for Providers</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../api/aio_provider/nng_aio_begin.html"><strong aria-hidden="true">5.5.1.</strong> nng_aio_begin</a></li><li class="chapter-item "><a href="../api/aio_provider/nng_aio_defer.html"><strong aria-hidden="true">5.5.2.</strong> nng_aio_defer</a></li><li class="chapter-item "><a href="../api/aio_provider/nng_aio_finish.html"><strong aria-hidden="true">5.5.3.</strong> nng_aio_finish</a></li><li class="chapter-item "><a href="../api/aio_provider/nng_aio_get_input.html"><strong aria-hidden="true">5.5.4.</strong> nng_aio_get_input</a></li><li class="chapter-item "><a href="../api/aio_provider/nng_aio_set_output.html"><strong aria-hidden="true">5.5.5.</strong> nng_aio_set_output</a></li></ol></li><li class="chapter-item "><a href="../api/util/index.html"><strong aria-hidden="true">5.6.</strong> Utility Functions</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../api/util/nng_alloc.html"><strong aria-hidden="true">5.6.1.</strong> nng_alloc</a></li><li class="chapter-item "><a href="../api/util/nng_clock.html"><strong aria-hidden="true">5.6.2.</strong> nng_clock</a></li><li class="chapter-item "><a href="../api/util/nng_free.html"><strong aria-hidden="true">5.6.3.</strong> nng_free</a></li><li class="chapter-item "><a href="../api/util/nng_msleep.html"><strong aria-hidden="true">5.6.4.</strong> nng_msleep</a></li><li class="chapter-item "><a href="../api/util/nng_random.html"><strong aria-hidden="true">5.6.5.</strong> nng_random</a></li><li class="chapter-item "><a href="../api/util/nng_sleep_aio.html"><strong aria-hidden="true">5.6.6.</strong> nng_sleep_aio</a></li><li class="chapter-item "><a href="../api/util/nng_strdup.html"><strong aria-hidden="true">5.6.7.</strong> nng_strdup</a></li><li class="chapter-item "><a href="../api/util/nng_strerror.html"><strong aria-hidden="true">5.6.8.</strong> nng_strerror</a></li><li class="chapter-item "><a href="../api/util/nng_strfree.html"><strong aria-hidden="true">5.6.9.</strong> nng_strfree</a></li><li class="chapter-item "><a href="../api/util/nng_version.html"><strong aria-hidden="true">5.6.10.</strong> nng_version</a></li></ol></li><li class="chapter-item "><a href="../api/threads/index.html"><strong aria-hidden="true">5.7.</strong> Threads and Synchronization</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../api/threads/nng_cv_alloc.html"><strong aria-hidden="true">5.7.1.</strong> nng_cv_alloc</a></li><li class="chapter-item "><a href="../api/threads/nng_cv_free.html"><strong aria-hidden="true">5.7.2.</strong> nng_cv_free</a></li><li class="chapter-item "><a href="../api/threads/nng_cv_until.html"><strong aria-hidden="true">5.7.3.</strong> nng_cv_until</a></li><li class="chapter-item "><a href="../api/threads/nng_cv_wait.html"><strong aria-hidden="true">5.7.4.</strong> nng_cv_wait</a></li><li class="chapter-item "><a href="../api/threads/nng_cv_wake.html"><strong aria-hidden="true">5.7.5.</strong> nng_cv_wake</a></li><li class="chapter-item "><a href="../api/threads/nng_cv_wake1.html"><strong aria-hidden="true">5.7.6.</strong> nng_cv_wake1</a></li><li class="chapter-item "><a href="../api/threads/nng_mtx_alloc.html"><strong aria-hidden="true">5.7.7.</strong> nng_mtx_alloc</a></li><li class="chapter-item "><a href="../api/threads/nng_mtx_free.html"><strong aria-hidden="true">5.7.8.</strong> nng_mtx_free</a></li><li class="chapter-item "><a href="../api/threads/nng_mtx_lock.html"><strong aria-hidden="true">5.7.9.</strong> nng_mtx_lock</a></li><li class="chapter-item "><a href="../api/threads/nng_mtx_unlock.html"><strong aria-hidden="true">5.7.10.</strong> nng_mtx_unlock</a></li></ol></li><li class="chapter-item "><a href="../api/compat/index.html"><strong aria-hidden="true">5.8.</strong> Legacy Compatibility</a></li></ol></li><li class="chapter-item expanded "><a href="../indexing.html"><strong aria-hidden="true">6.</strong> Index</a></li></ol>
+ </div>
+ <div id="sidebar-resize-handle" class="sidebar-resize-handle">
+ <div class="sidebar-resize-indicator"></div>
+ </div>
+ </nav>
+
+ <!-- Track and set sidebar scroll position -->
+ <script>
+ var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
+ 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' });
+ }
+ }
+ </script>
+
+ <div id="page-wrapper" class="page-wrapper">
+
+ <div class="page">
+ <div id="menu-bar-hover-placeholder"></div>
+ <div id="menu-bar" class="menu-bar sticky">
+ <div class="left-buttons">
+ <label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
+ <i class="fa fa-bars"></i>
+ </label>
+ <button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
+ <i class="fa fa-paint-brush"></i>
+ </button>
+ <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
+ <li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
+ <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
+ <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
+ <li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
+ <li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
+ </ul>
+ <button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
+ <i class="fa fa-search"></i>
+ </button>
+ </div>
+
+ <h1 class="menu-title">NNG Reference Manual</h1>
+
+ <div class="right-buttons">
+ <a href="../print.html" title="Print this book" aria-label="Print this book">
+ <i id="print-button" class="fa fa-print"></i>
+ </a>
+
+ </div>
+ </div>
+
+ <div id="search-wrapper" class="hidden">
+ <form id="searchbar-outer" class="searchbar-outer">
+ <input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
+ </form>
+ <div id="searchresults-outer" class="searchresults-outer hidden">
+ <div id="searchresults-header" class="searchresults-header"></div>
+ <ul id="searchresults">
+ </ul>
+ </div>
+ </div>
+
+ <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
+ <script>
+ document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
+ document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
+ Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
+ link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
+ });
+ </script>
+
+ <div id="content" class="content">
+ <main>
+ <style>
+.mdbook-alerts {
+ padding: 8px 16px;
+ margin-bottom: 16px;
+ border-left: 0.25em solid var(--mdbook-alerts-color);
+}
+
+.mdbook-alerts > *:first-child {
+ margin-top: 0;
+}
+
+.mdbook-alerts > *:last-child {
+ margin-bottom: 0;
+}
+
+.mdbook-alerts-title {
+ display: flex;
+ font-weight: 600;
+ align-items: center;
+ line-height: 1;
+ color: var(--mdbook-alerts-color);
+ text-transform: capitalize;
+}
+
+.mdbook-alerts-icon {
+ display: inline-block;
+ width: 1em;
+ height: 1em;
+ margin-right: 0.2em;
+ background-color: currentColor;
+ -webkit-mask: no-repeat center / 100%;
+ mask: no-repeat center / 100%;
+ -webkit-mask-image: var(--mdbook-alerts-icon);
+ mask-image: var(--mdbook-alerts-icon);
+}
+
+.mdbook-alerts-note {
+ --mdbook-alerts-color: rgb(9, 105, 218);
+ /* https://icon-sets.iconify.design/material-symbols/info-outline-rounded/ */
+ --mdbook-alerts-icon: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="24" height="24" viewBox="0 0 24 24"%3E%3Cpath fill="currentColor" d="M12 17q.425 0 .713-.288T13 16v-4q0-.425-.288-.712T12 11q-.425 0-.712.288T11 12v4q0 .425.288.713T12 17m0-8q.425 0 .713-.288T13 8q0-.425-.288-.712T12 7q-.425 0-.712.288T11 8q0 .425.288.713T12 9m0 13q-2.075 0-3.9-.788t-3.175-2.137q-1.35-1.35-2.137-3.175T2 12q0-2.075.788-3.9t2.137-3.175q1.35-1.35 3.175-2.137T12 2q2.075 0 3.9.788t3.175 2.137q1.35 1.35 2.138 3.175T22 12q0 2.075-.788 3.9t-2.137 3.175q-1.35 1.35-3.175 2.138T12 22m0-2q3.35 0 5.675-2.325T20 12q0-3.35-2.325-5.675T12 4Q8.65 4 6.325 6.325T4 12q0 3.35 2.325 5.675T12 20m0-8"%2F%3E%3C%2Fsvg%3E');
+}
+
+.mdbook-alerts-tip {
+ --mdbook-alerts-color: rgb(26, 127, 55);
+ /* https://icon-sets.iconify.design/material-symbols/lightbulb-outline-rounded/ */
+ --mdbook-alerts-icon: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="24" height="24" viewBox="0 0 24 24"%3E%3Cpath fill="currentColor" d="M12 22q-.825 0-1.412-.587T10 20h4q0 .825-.587 1.413T12 22m-3-3q-.425 0-.712-.288T8 18q0-.425.288-.712T9 17h6q.425 0 .713.288T16 18q0 .425-.288.713T15 19zm-.75-3q-1.725-1.025-2.738-2.75T4.5 9.5q0-3.125 2.188-5.312T12 2q3.125 0 5.313 2.188T19.5 9.5q0 2.025-1.012 3.75T15.75 16zm.6-2h6.3q1.125-.8 1.738-1.975T17.5 9.5q0-2.3-1.6-3.9T12 4Q9.7 4 8.1 5.6T6.5 9.5q0 1.35.613 2.525T8.85 14M12 14"%2F%3E%3C%2Fsvg%3E');
+}
+
+.mdbook-alerts-important {
+ --mdbook-alerts-color: rgb(130, 80, 223);
+ /* https://icon-sets.iconify.design/material-symbols/chat-info-outline-rounded/ */
+ --mdbook-alerts-icon: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="24" height="24" viewBox="0 0 24 24"%3E%3Cpath fill="currentColor" d="M12 7q.425 0 .713-.288T13 6q0-.425-.288-.712T12 5q-.425 0-.712.288T11 6q0 .425.288.713T12 7m0 8q.425 0 .713-.288T13 14v-4q0-.425-.288-.712T12 9q-.425 0-.712.288T11 10v4q0 .425.288.713T12 15m-6 3l-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18zm-.85-2H20V4H4v13.125zM4 16V4z"%2F%3E%3C%2Fsvg%3E');
+}
+
+.mdbook-alerts-warning {
+ --mdbook-alerts-color: rgb(154, 103, 0);
+ /* https://icon-sets.iconify.design/material-symbols/warning-outline-rounded/ */
+ --mdbook-alerts-icon: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="24" height="24" viewBox="0 0 24 24"%3E%3Cpath fill="currentColor" d="M2.725 21q-.275 0-.5-.137t-.35-.363q-.125-.225-.137-.488t.137-.512l9.25-16q.15-.25.388-.375T12 3q.25 0 .488.125t.387.375l9.25 16q.15.25.138.513t-.138.487q-.125.225-.35.363t-.5.137zm1.725-2h15.1L12 6zM12 18q.425 0 .713-.288T13 17q0-.425-.288-.712T12 16q-.425 0-.712.288T11 17q0 .425.288.713T12 18m0-3q.425 0 .713-.288T13 14v-3q0-.425-.288-.712T12 10q-.425 0-.712.288T11 11v3q0 .425.288.713T12 15m0-2.5"%2F%3E%3C%2Fsvg%3E');
+}
+
+.mdbook-alerts-caution {
+ --mdbook-alerts-color: rgb(207, 34, 46);
+ /* https://icon-sets.iconify.design/material-symbols/brightness-alert-outline-rounded/ */
+ --mdbook-alerts-icon: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="24" height="24" viewBox="0 0 24 24"%3E%3Cpath fill="currentColor" d="M12 17q.425 0 .713-.288T13 16q0-.425-.288-.712T12 15q-.425 0-.712.288T11 16q0 .425.288.713T12 17m0-4q.425 0 .713-.288T13 12V8q0-.425-.288-.712T12 7q-.425 0-.712.288T11 8v4q0 .425.288.713T12 13m-3.35 7H6q-.825 0-1.412-.587T4 18v-2.65L2.075 13.4q-.275-.3-.425-.662T1.5 12q0-.375.15-.737t.425-.663L4 8.65V6q0-.825.588-1.412T6 4h2.65l1.95-1.925q.3-.275.663-.425T12 1.5q.375 0 .738.15t.662.425L15.35 4H18q.825 0 1.413.588T20 6v2.65l1.925 1.95q.275.3.425.663t.15.737q0 .375-.15.738t-.425.662L20 15.35V18q0 .825-.587 1.413T18 20h-2.65l-1.95 1.925q-.3.275-.662.425T12 22.5q-.375 0-.737-.15t-.663-.425zm.85-2l2.5 2.5l2.5-2.5H18v-3.5l2.5-2.5L18 9.5V6h-3.5L12 3.5L9.5 6H6v3.5L3.5 12L6 14.5V18zm2.5-6"%2F%3E%3C%2Fsvg%3E');
+}
+
+</style>
+<h1 id="pub-protocol"><a class="header" href="#pub-protocol">PUB Protocol</a></h1>
+<p>The <a name="a001"></a><em>PUB</em> protocol<a name="a002"></a>/subscriber pattern.
+In this pattern, a publisher sends data, which is broadcast to all
+subscribers.
+The subscribing applications only see the data to which
+they have subscribed.</p>
+<p>The <em>PUB</em> protocol is the publisher side, and the
+<a href="sub.html"><em>SUB</em></a> protocol is the subscriber side.</p>
+<div class="mdbook-alerts mdbook-alerts-note">
+<p class="mdbook-alerts-title">
+ <span class="mdbook-alerts-icon"></span>
+ note
+</p>
+<p>In this implementation, the publisher delivers all messages to all
+subscribers.
+The subscribers maintain their own subscriptions, and filter them locally.
+Thus, this pattern should not be used in an attempt to reduce bandwidth
+consumption.</p>
+</div>
+<p>The topics that subscribers subscribe to is just the first part of
+the message body.
+Applications should construct their messages accordingly.</p>
+<h2 id="socket-operations"><a class="header" href="#socket-operations">Socket Operations</a></h2>
+<p>The <a href="../api/nng_pub_open.html"><code>nng_pub0_open()</code></a> functions create a publisher socket.
+This socket may be used to send messages, but is unable to receive them.
+Attempts to receive messages will result in <code>NNG_ENOTSUP</code>.</p>
+<h2 id="protocol-versions"><a class="header" href="#protocol-versions">Protocol Versions</a></h2>
+<p>Only version 0 of this protocol is supported.
+(At the time of writing, no other versions of this protocol have been defined.)</p>
+<h2 id="protocol-options"><a class="header" href="#protocol-options">Protocol Options</a></h2>
+<p>The <em>PUB</em> protocol has no protocol-specific options.</p>
+<h2 id="protocol-headers"><a class="header" href="#protocol-headers">Protocol Headers</a></h2>
+<p>The <em>PUB</em> protocol has no protocol-specific headers.</p>
+
+ </main>
+
+ <nav class="nav-wrapper" aria-label="Page navigation">
+ <!-- Mobile navigation buttons -->
+ <a rel="prev" href="../protocols/bus.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
+ <i class="fa fa-angle-left"></i>
+ </a>
+
+ <a rel="next prefetch" href="../protocols/rep.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
+ <i class="fa fa-angle-right"></i>
+ </a>
+
+ <div style="clear: both"></div>
+ </nav>
+ </div>
+ </div>
+
+ <nav class="nav-wide-wrapper" aria-label="Page navigation">
+ <a rel="prev" href="../protocols/bus.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
+ <i class="fa fa-angle-left"></i>
+ </a>
+
+ <a rel="next prefetch" href="../protocols/rep.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
+ <i class="fa fa-angle-right"></i>
+ </a>
+ </nav>
+
+ </div>
+
+ <!-- Livereload script (if served using the cli tool) -->
+ <script>
+ const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
+ const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload";
+ const socket = new WebSocket(wsAddress);
+ socket.onmessage = function (event) {
+ if (event.data === "reload") {
+ socket.close();
+ location.reload();
+ }
+ };
+
+ window.onbeforeunload = function() {
+ socket.close();
+ }
+ </script>
+
+
+
+ <script>
+ window.playground_copyable = true;
+ </script>
+
+
+ <script src="../elasticlunr.min.js"></script>
+ <script src="../mark.min.js"></script>
+ <script src="../searcher.js"></script>
+
+ <script src="../clipboard.min.js"></script>
+ <script src="../highlight.js"></script>
+ <script src="../book.js"></script>
+
+ <!-- Custom JS scripts -->
+
+
+ </div>
+ </body>
+</html>