Section 1: Commands and Utilities
| - | command line access to Scalability Protocols |
-
From 051e3c5b6e24195c4e65d09ee983e77dd63ca3e6 Mon Sep 17 00:00:00 2001
From: "Staysail Systems, Inc." command line access to Scalability Protocols
-
diff --git a/man/tip/asciidoctor.css b/man/tip/asciidoctor.css
deleted file mode 100644
index 9d9cc70c..00000000
--- a/man/tip/asciidoctor.css
+++ /dev/null
@@ -1,426 +0,0 @@
-/* Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */
-/* Uncomment @import statement to use as custom stylesheet */
-/*@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700";*/
-article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}
-audio,video{display:inline-block}
-audio:not([controls]){display:none;height:0}
-html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
-a{background:none}
-a:focus{outline:thin dotted}
-a:active,a:hover{outline:0}
-h1{font-size:2em;margin:.67em 0}
-abbr[title]{border-bottom:1px dotted}
-b,strong{font-weight:bold}
-dfn{font-style:italic}
-hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}
-mark{background:#ff0;color:#000}
-code,kbd,pre,samp{font-family:monospace;font-size:1em}
-pre{white-space:pre-wrap}
-q{quotes:"\201C" "\201D" "\2018" "\2019"}
-small{font-size:80%}
-sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
-sup{top:-.5em}
-sub{bottom:-.25em}
-img{border:0}
-svg:not(:root){overflow:hidden}
-figure{margin:0}
-fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}
-legend{border:0;padding:0}
-button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}
-button,input{line-height:normal}
-button,select{text-transform:none}
-button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}
-button[disabled],html input[disabled]{cursor:default}
-input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}
-button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}
-textarea{overflow:auto;vertical-align:top}
-table{border-collapse:collapse;border-spacing:0}
-*,*::before,*::after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}
-html,body{font-size:100%}
-body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;font-weight:400;font-style:normal;line-height:1;position:relative;cursor:auto;tab-size:4;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}
-a:hover{cursor:pointer}
-img,object,embed{max-width:100%;height:auto}
-object,embed{height:100%}
-img{-ms-interpolation-mode:bicubic}
-.left{float:left!important}
-.right{float:right!important}
-.text-left{text-align:left!important}
-.text-right{text-align:right!important}
-.text-center{text-align:center!important}
-.text-justify{text-align:justify!important}
-.hide{display:none}
-img,object,svg{display:inline-block;vertical-align:middle}
-textarea{height:auto;min-height:50px}
-select{width:100%}
-.center{margin-left:auto;margin-right:auto}
-.stretch{width:100%}
-.subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em}
-div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0;direction:ltr}
-a{color:#2156a5;text-decoration:underline;line-height:inherit}
-a:hover,a:focus{color:#1d4b8f}
-a img{border:0}
-p{font-family:inherit;font-weight:400;font-size:1em;line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility}
-p aside{font-size:.875em;line-height:1.35;font-style:italic}
-h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:"Open Sans","DejaVu Sans",sans-serif;font-weight:300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em}
-h1 small,h2 small,h3 small,#toctitle small,.sidebarblock>.content>.title small,h4 small,h5 small,h6 small{font-size:60%;color:#e99b8f;line-height:0}
-h1{font-size:2.125em}
-h2{font-size:1.6875em}
-h3,#toctitle,.sidebarblock>.content>.title{font-size:1.375em}
-h4,h5{font-size:1.125em}
-h6{font-size:1em}
-hr{border:solid #dddddf;border-width:1px 0 0;clear:both;margin:1.25em 0 1.1875em;height:0}
-em,i{font-style:italic;line-height:inherit}
-strong,b{font-weight:bold;line-height:inherit}
-small{font-size:60%;line-height:inherit}
-code{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;color:rgba(0,0,0,.9)}
-ul,ol,dl{font-size:1em;line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit}
-ul,ol{margin-left:1.5em}
-ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0;font-size:1em}
-ul.square li ul,ul.circle li ul,ul.disc li ul{list-style:inherit}
-ul.square{list-style-type:square}
-ul.circle{list-style-type:circle}
-ul.disc{list-style-type:disc}
-ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0}
-dl dt{margin-bottom:.3125em;font-weight:bold}
-dl dd{margin-bottom:1.25em}
-abbr,acronym{text-transform:uppercase;font-size:90%;color:rgba(0,0,0,.8);border-bottom:1px dotted #ddd;cursor:help}
-abbr{text-transform:none}
-blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd}
-blockquote cite{display:block;font-size:.9375em;color:rgba(0,0,0,.6)}
-blockquote cite::before{content:"\2014 \0020"}
-blockquote cite a,blockquote cite a:visited{color:rgba(0,0,0,.6)}
-blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)}
-@media screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2}
-h1{font-size:2.75em}
-h2{font-size:2.3125em}
-h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em}
-h4{font-size:1.4375em}}
-table{background:#fff;margin-bottom:1.25em;border:solid 1px #dedede}
-table thead,table tfoot{background:#f7f8f7}
-table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left}
-table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)}
-table tr.even,table tr.alt{background:#f8f8f7}
-table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{display:table-cell;line-height:1.6}
-h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em}
-h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400}
-.clearfix::before,.clearfix::after,.float-group::before,.float-group::after{content:" ";display:table}
-.clearfix::after,.float-group::after{clear:both}
-:not(pre):not([class^=L])>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background:#f7f7f8;-webkit-border-radius:4px;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed;word-wrap:break-word}
-:not(pre)>code.nobreak{word-wrap:normal}
-:not(pre)>code.nowrap{white-space:nowrap}
-pre{color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;line-height:1.45;text-rendering:optimizeSpeed}
-pre code,pre pre{color:inherit;font-size:inherit;line-height:inherit}
-pre>code{display:block}
-pre.nowrap,pre.nowrap pre{white-space:pre;word-wrap:normal}
-em em{font-style:normal}
-strong strong{font-weight:400}
-.keyseq{color:rgba(51,51,51,.8)}
-kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background:#f7f7f7;border:1px solid #ccc;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em white inset;box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em #fff inset;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap}
-.keyseq kbd:first-child{margin-left:0}
-.keyseq kbd:last-child{margin-right:0}
-.menuseq,.menuref{color:#000}
-.menuseq b:not(.caret),.menuref{font-weight:inherit}
-.menuseq{word-spacing:-.02em}
-.menuseq b.caret{font-size:1.25em;line-height:.8}
-.menuseq i.caret{font-weight:bold;text-align:center;width:.45em}
-b.button::before,b.button::after{position:relative;top:-1px;font-weight:400}
-b.button::before{content:"[";padding:0 3px 0 2px}
-b.button::after{content:"]";padding:0 2px 0 3px}
-p a>code:hover{color:rgba(0,0,0,.9)}
-#header,#content,#footnotes,#footer{width:100%;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;max-width:62.5em;*zoom:1;position:relative;padding-left:.9375em;padding-right:.9375em}
-#header::before,#header::after,#content::before,#content::after,#footnotes::before,#footnotes::after,#footer::before,#footer::after{content:" ";display:table}
-#header::after,#content::after,#footnotes::after,#footer::after{clear:both}
-#content{margin-top:1.25em}
-#content::before{content:none}
-#header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0}
-#header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #dddddf}
-#header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px}
-#header .details{border-bottom:1px solid #dddddf;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-flow:row wrap;-webkit-flex-flow:row wrap;flex-flow:row wrap}
-#header .details span:first-child{margin-left:-.125em}
-#header .details span.email a{color:rgba(0,0,0,.85)}
-#header .details br{display:none}
-#header .details br+span::before{content:"\00a0\2013\00a0"}
-#header .details br+span.author::before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)}
-#header .details br+span#revremark::before{content:"\00a0|\00a0"}
-#header #revnumber{text-transform:capitalize}
-#header #revnumber::after{content:"\00a0"}
-#content>h1:first-child:not([class]){color:rgba(0,0,0,.85);border-bottom:1px solid #dddddf;padding-bottom:8px;margin-top:0;padding-top:1rem;margin-bottom:1.25rem}
-#toc{border-bottom:1px solid #e7e7e9;padding-bottom:.5em}
-#toc>ul{margin-left:.125em}
-#toc ul.sectlevel0>li>a{font-style:italic}
-#toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0}
-#toc ul{font-family:"Open Sans","DejaVu Sans",sans-serif;list-style-type:none}
-#toc li{line-height:1.3334;margin-top:.3334em}
-#toc a{text-decoration:none}
-#toc a:active{text-decoration:underline}
-#toctitle{color:#7a2518;font-size:1.2em}
-@media screen and (min-width:768px){#toctitle{font-size:1.375em}
-body.toc2{padding-left:15em;padding-right:0}
-#toc.toc2{margin-top:0!important;background:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #e7e7e9;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto}
-#toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em}
-#toc.toc2>ul{font-size:.9em;margin-bottom:0}
-#toc.toc2 ul ul{margin-left:0;padding-left:1em}
-#toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em}
-body.toc2.toc-right{padding-left:0;padding-right:15em}
-body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #e7e7e9;left:auto;right:0}}
-@media screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
-#toc.toc2{width:20em}
-#toc.toc2 #toctitle{font-size:1.375em}
-#toc.toc2>ul{font-size:.95em}
-#toc.toc2 ul ul{padding-left:1.25em}
-body.toc2.toc-right{padding-left:0;padding-right:20em}}
-#content #toc{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px}
-#content #toc>:first-child{margin-top:0}
-#content #toc>:last-child{margin-bottom:0}
-#footer{max-width:100%;background:rgba(0,0,0,.8);padding:1.25em}
-#footer-text{color:rgba(255,255,255,.8);line-height:1.44}
-#content{margin-bottom:.625em}
-.sect1{padding-bottom:.625em}
-@media screen and (min-width:768px){#content{margin-bottom:1.25em}
-.sect1{padding-bottom:1.25em}}
-.sect1:last-child{padding-bottom:0}
-.sect1+.sect1{border-top:1px solid #e7e7e9}
-#content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400}
-#content h1>a.anchor::before,h2>a.anchor::before,h3>a.anchor::before,#toctitle>a.anchor::before,.sidebarblock>.content>.title>a.anchor::before,h4>a.anchor::before,h5>a.anchor::before,h6>a.anchor::before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}
-#content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible}
-#content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none}
-#content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221}
-details,.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em}
-details>summary:first-of-type{cursor:pointer;display:list-item;outline:none;margin-bottom:.75em}
-.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic}
-table.tableblock.fit-content>caption.title{white-space:nowrap;width:0}
-.paragraph.lead>p,#preamble>.sectionbody>[class="paragraph"]:first-of-type p{font-size:1.21875em;line-height:1.6;color:rgba(0,0,0,.85)}
-table.tableblock #preamble>.sectionbody>[class="paragraph"]:first-of-type p{font-size:inherit}
-.admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%}
-.admonitionblock>table td.icon{text-align:center;width:80px}
-.admonitionblock>table td.icon img{max-width:none}
-.admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase}
-.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6)}
-.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
-.exampleblock>.content{border-style:solid;border-width:1px;border-color:#e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;-webkit-border-radius:4px;border-radius:4px}
-.exampleblock>.content>:first-child{margin-top:0}
-.exampleblock>.content>:last-child{margin-bottom:0}
-.sidebarblock{border-style:solid;border-width:1px;border-color:#dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;-webkit-border-radius:4px;border-radius:4px}
-.sidebarblock>:first-child{margin-top:0}
-.sidebarblock>:last-child{margin-bottom:0}
-.sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
-.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
-.literalblock pre,.listingblock>.content>pre{-webkit-border-radius:4px;border-radius:4px;word-wrap:break-word;overflow-x:auto;padding:1em;font-size:.8125em}
-@media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}}
-@media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}}
-.literalblock pre,.listingblock>.content>pre:not(.highlight),.listingblock>.content>pre[class="highlight"],.listingblock>.content>pre[class^="highlight "]{background:#f7f7f8}
-.literalblock.output pre{color:#f7f7f8;background:rgba(0,0,0,.9)}
-.listingblock>.content{position:relative}
-.listingblock code[data-lang]::before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:inherit;opacity:.5}
-.listingblock:hover code[data-lang]::before{display:block}
-.listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:.5em;color:inherit;opacity:.5}
-.listingblock.terminal pre .command:not([data-prompt])::before{content:"$"}
-.listingblock pre.highlightjs{padding:0}
-.listingblock pre.highlightjs>code{padding:1em;-webkit-border-radius:4px;border-radius:4px}
-.listingblock pre.prettyprint{border-width:0}
-.prettyprint{background:#f7f7f8}
-pre.prettyprint .linenums{line-height:1.45;margin-left:2em}
-pre.prettyprint li{background:none;list-style-type:inherit;padding-left:0}
-pre.prettyprint li code[data-lang]::before{opacity:1}
-pre.prettyprint li:not(:first-child) code[data-lang]::before{display:none}
-table.linenotable{border-collapse:separate;border:0;margin-bottom:0;background:none}
-table.linenotable td[class]{color:inherit;vertical-align:top;padding:0;line-height:inherit;white-space:normal}
-table.linenotable td.code{padding-left:.75em}
-table.linenotable td.linenos{border-right:1px solid currentColor;opacity:.35;padding-right:.5em}
-pre.pygments .lineno{border-right:1px solid currentColor;opacity:.35;display:inline-block;margin-right:.75em}
-pre.pygments .lineno::before{content:"";margin-right:-.125em}
-.quoteblock{margin:0 1em 1.25em 1.5em;display:table}
-.quoteblock:not(.excerpt)>.title{margin-left:-1.5em;margin-bottom:.75em}
-.quoteblock blockquote,.quoteblock p{color:rgba(0,0,0,.85);font-size:1.15rem;line-height:1.75;word-spacing:.1em;letter-spacing:0;font-style:italic;text-align:justify}
-.quoteblock blockquote{margin:0;padding:0;border:0}
-.quoteblock blockquote::before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:#7a2518;text-shadow:0 1px 2px rgba(0,0,0,.1)}
-.quoteblock blockquote>.paragraph:last-child p{margin-bottom:0}
-.quoteblock .attribution{margin-top:.75em;margin-right:.5ex;text-align:right}
-.verseblock{margin:0 1em 1.25em}
-.verseblock pre{font-family:"Open Sans","DejaVu Sans",sans;font-size:1.15rem;color:rgba(0,0,0,.85);font-weight:300;text-rendering:optimizeLegibility}
-.verseblock pre strong{font-weight:400}
-.verseblock .attribution{margin-top:1.25rem;margin-left:.5ex}
-.quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic}
-.quoteblock .attribution br,.verseblock .attribution br{display:none}
-.quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)}
-.quoteblock.abstract blockquote::before,.quoteblock.excerpt blockquote::before,.quoteblock .quoteblock blockquote::before{display:none}
-.quoteblock.abstract blockquote,.quoteblock.abstract p,.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{line-height:1.6;word-spacing:0}
-.quoteblock.abstract{margin:0 1em 1.25em;display:block}
-.quoteblock.abstract>.title{margin:0 0 .375em;font-size:1.15em;text-align:center}
-.quoteblock.excerpt>blockquote,.quoteblock .quoteblock{padding:0 0 .25em 1em;border-left:.25em solid #dddddf}
-.quoteblock.excerpt,.quoteblock .quoteblock{margin-left:0}
-.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{color:inherit;font-size:1.0625rem}
-.quoteblock.excerpt .attribution,.quoteblock .quoteblock .attribution{color:inherit;text-align:left;margin-right:0}
-table.tableblock{max-width:100%;border-collapse:separate}
-p.tableblock:last-child{margin-bottom:0}
-td.tableblock>.content>:last-child{margin-bottom:-1.25em}
-td.tableblock>.content>:last-child.sidebarblock{margin-bottom:0}
-table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
-table.grid-all>thead>tr>.tableblock,table.grid-all>tbody>tr>.tableblock{border-width:0 1px 1px 0}
-table.grid-all>tfoot>tr>.tableblock{border-width:1px 1px 0 0}
-table.grid-cols>*>tr>.tableblock{border-width:0 1px 0 0}
-table.grid-rows>thead>tr>.tableblock,table.grid-rows>tbody>tr>.tableblock{border-width:0 0 1px}
-table.grid-rows>tfoot>tr>.tableblock{border-width:1px 0 0}
-table.grid-all>*>tr>.tableblock:last-child,table.grid-cols>*>tr>.tableblock:last-child{border-right-width:0}
-table.grid-all>tbody>tr:last-child>.tableblock,table.grid-all>thead:last-child>tr>.tableblock,table.grid-rows>tbody>tr:last-child>.tableblock,table.grid-rows>thead:last-child>tr>.tableblock{border-bottom-width:0}
-table.frame-all{border-width:1px}
-table.frame-sides{border-width:0 1px}
-table.frame-topbot,table.frame-ends{border-width:1px 0}
-table.stripes-all tr,table.stripes-odd tr:nth-of-type(odd),table.stripes-even tr:nth-of-type(even),table.stripes-hover tr:hover{background:#f8f8f7}
-th.halign-left,td.halign-left{text-align:left}
-th.halign-right,td.halign-right{text-align:right}
-th.halign-center,td.halign-center{text-align:center}
-th.valign-top,td.valign-top{vertical-align:top}
-th.valign-bottom,td.valign-bottom{vertical-align:bottom}
-th.valign-middle,td.valign-middle{vertical-align:middle}
-table thead th,table tfoot th{font-weight:bold}
-tbody tr th{display:table-cell;line-height:1.6;background:#f7f8f7}
-tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold}
-p.tableblock>code:only-child{background:none;padding:0}
-p.tableblock{font-size:1em}
-ol{margin-left:1.75em}
-ul li ol{margin-left:1.5em}
-dl dd{margin-left:1.125em}
-dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0}
-ol>li p,ul>li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em}
-ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none}
-ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:.625em}
-ul.unstyled,ol.unstyled{margin-left:0}
-ul.checklist{margin-left:.625em}
-ul.checklist li>p:first-child>.fa-square-o:first-child,ul.checklist li>p:first-child>.fa-check-square-o:first-child{width:1.25em;font-size:.8em;position:relative;bottom:.125em}
-ul.checklist li>p:first-child>input[type="checkbox"]:first-child{margin-right:.25em}
-ul.inline{display:-ms-flexbox;display:-webkit-box;display:flex;-ms-flex-flow:row wrap;-webkit-flex-flow:row wrap;flex-flow:row wrap;list-style:none;margin:0 0 .625em -1.25em}
-ul.inline>li{margin-left:1.25em}
-.unstyled dl dt{font-weight:400;font-style:normal}
-ol.arabic{list-style-type:decimal}
-ol.decimal{list-style-type:decimal-leading-zero}
-ol.loweralpha{list-style-type:lower-alpha}
-ol.upperalpha{list-style-type:upper-alpha}
-ol.lowerroman{list-style-type:lower-roman}
-ol.upperroman{list-style-type:upper-roman}
-ol.lowergreek{list-style-type:lower-greek}
-.hdlist>table,.colist>table{border:0;background:none}
-.hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none}
-td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em}
-td.hdlist1{font-weight:bold;padding-bottom:1.25em}
-.literalblock+.colist,.listingblock+.colist{margin-top:-.5em}
-.colist td:not([class]):first-child{padding:.4em .75em 0;line-height:1;vertical-align:top}
-.colist td:not([class]):first-child img{max-width:none}
-.colist td:not([class]):last-child{padding:.25em 0}
-.thumb,.th{line-height:0;display:inline-block;border:solid 4px #fff;-webkit-box-shadow:0 0 0 1px #ddd;box-shadow:0 0 0 1px #ddd}
-.imageblock.left{margin:.25em .625em 1.25em 0}
-.imageblock.right{margin:.25em 0 1.25em .625em}
-.imageblock>.title{margin-bottom:0}
-.imageblock.thumb,.imageblock.th{border-width:6px}
-.imageblock.thumb>.title,.imageblock.th>.title{padding:0 .125em}
-.image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0}
-.image.left{margin-right:.625em}
-.image.right{margin-left:.625em}
-a.image{text-decoration:none;display:inline-block}
-a.image object{pointer-events:none}
-sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super}
-sup.footnote a,sup.footnoteref a{text-decoration:none}
-sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}
-#footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}
-#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em;border-width:1px 0 0}
-#footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;margin-bottom:.2em}
-#footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none;margin-left:-1.05em}
-#footnotes .footnote:last-of-type{margin-bottom:0}
-#content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0}
-.gist .file-data>table{border:0;background:#fff;width:100%;margin-bottom:0}
-.gist .file-data>table td.line-data{width:99%}
-div.unbreakable{page-break-inside:avoid}
-.big{font-size:larger}
-.small{font-size:smaller}
-.underline{text-decoration:underline}
-.overline{text-decoration:overline}
-.line-through{text-decoration:line-through}
-.aqua{color:#00bfbf}
-.aqua-background{background:#00fafa}
-.black{color:#000}
-.black-background{background:#000}
-.blue{color:#0000bf}
-.blue-background{background:#0000fa}
-.fuchsia{color:#bf00bf}
-.fuchsia-background{background:#fa00fa}
-.gray{color:#606060}
-.gray-background{background:#7d7d7d}
-.green{color:#006000}
-.green-background{background:#007d00}
-.lime{color:#00bf00}
-.lime-background{background:#00fa00}
-.maroon{color:#600000}
-.maroon-background{background:#7d0000}
-.navy{color:#000060}
-.navy-background{background:#00007d}
-.olive{color:#606000}
-.olive-background{background:#7d7d00}
-.purple{color:#600060}
-.purple-background{background:#7d007d}
-.red{color:#bf0000}
-.red-background{background:#fa0000}
-.silver{color:#909090}
-.silver-background{background:#bcbcbc}
-.teal{color:#006060}
-.teal-background{background:#007d7d}
-.white{color:#bfbfbf}
-.white-background{background:#fafafa}
-.yellow{color:#bfbf00}
-.yellow-background{background:#fafa00}
-span.icon>.fa{cursor:default}
-a span.icon>.fa{cursor:inherit}
-.admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default}
-.admonitionblock td.icon .icon-note::before{content:"\f05a";color:#19407c}
-.admonitionblock td.icon .icon-tip::before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111}
-.admonitionblock td.icon .icon-warning::before{content:"\f071";color:#bf6900}
-.admonitionblock td.icon .icon-caution::before{content:"\f06d";color:#bf3400}
-.admonitionblock td.icon .icon-important::before{content:"\f06a";color:#bf0000}
-.conum[data-value]{display:inline-block;color:#fff!important;background:rgba(0,0,0,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold}
-.conum[data-value] *{color:#fff!important}
-.conum[data-value]+b{display:none}
-.conum[data-value]::after{content:attr(data-value)}
-pre .conum[data-value]{position:relative;top:-.125em}
-b.conum *{color:inherit!important}
-.conum:not([data-value]):empty{display:none}
-dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
-h1,h2,p,td.content,span.alt{letter-spacing:-.01em}
-p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
-p,blockquote,dt,td.content,span.alt{font-size:1.0625rem}
-p{margin-bottom:1.25rem}
-.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
-.exampleblock>.content{background:#fffef7;border-color:#e0e0dc;-webkit-box-shadow:0 1px 4px #e0e0dc;box-shadow:0 1px 4px #e0e0dc}
-.print-only{display:none!important}
-@page{margin:1.25cm .75cm}
-@media print{*{-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:none!important}
-html{font-size:80%}
-a{color:inherit!important;text-decoration:underline!important}
-a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important}
-a[href^="http:"]:not(.bare)::after,a[href^="https:"]:not(.bare)::after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em}
-abbr[title]::after{content:" (" attr(title) ")"}
-pre,blockquote,tr,img,object,svg{page-break-inside:avoid}
-thead{display:table-header-group}
-svg{max-width:100%}
-p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3}
-h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid}
-#toc,.sidebarblock,.exampleblock>.content{background:none!important}
-#toc{border-bottom:1px solid #dddddf!important;padding-bottom:0!important}
-body.book #header{text-align:center}
-body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em}
-body.book #header .details{border:0!important;display:block;padding:0!important}
-body.book #header .details span:first-child{margin-left:0!important}
-body.book #header .details br{display:block}
-body.book #header .details br+span::before{content:none!important}
-body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important}
-body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always}
-.listingblock code[data-lang]::before{display:block}
-#footer{padding:0 .9375em}
-.hide-on-print{display:none!important}
-.print-only{display:block!important}
-.hide-for-print{display:none!important}
-.show-for-print{display:inherit!important}}
-@media print,amzn-kf8{#header>h1:first-child{margin-top:1.25rem}
-.sect1{padding:0!important}
-.sect1+.sect1{border:0}
-#footer{background:none}
-#footer-text{color:rgba(0,0,0,.6);font-size:.9em}}
-@media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}}
\ No newline at end of file
diff --git a/man/tip/index.html b/man/tip/index.html
index 58ddf417..05cfc610 100644
--- a/man/tip/index.html
+++ b/man/tip/index.html
@@ -1,368 +1,8 @@
---
version: tip
-layout: manpage
-title: NNG Reference Manual
+layout: manpage_v2
---
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-NNG Reference Manual
-Section 1: Commands and Utilities
-
-
-
-
-
This section documents core libary functions supporting Scalability Protocols.
-Most Scalability Protocols applications can be written using just -the functions documented in this section, as this represents the -primary API for building such applications.
-| - | nanomsg next generation library |
-
| - | abort asynchronous I/O operation |
-
| - | allocate asynchronous I/O handle |
-
| - | begin asynchronous I/O operation |
-
| - | cancel asynchronous I/O operation |
-
| - | return number of bytes transferred |
-
| - | defer asynchronous I/O operation |
-
| - | finish asynchronous I/O operation |
-
| - | free asynchronous I/O handle |
-
| - | return input parameter |
-
| - | get message from asynchronous receive |
-
| - | return output result |
-
| - | return result of asynchronous operation |
-
| - | set input parameter |
-
| - | set scatter/gather vector |
-
| - | set message for asynchronous send |
-
| - | set output result |
-
| - | set asynchronous I/O timeout |
-
| - | stop asynchronous I/O operation |
-
| - | wait for asynchronous I/O operation |
-
| - | allocate memory |
-
| - | create bus socket |
-
| - | close socket |
-
| - | close context |
-
| - | get context option |
-
| - | get context option |
-
| - | return numeric context identifier |
-
| - | create context |
-
| - | receive message using context asynchronously |
-
| - | send message using context asynchronously |
-
| - | set context option |
-
| - | set context option |
-
| - | message forwarding device |
-
| - | create and start dialer |
-
| - | close dialer |
-
| - | create dialer |
-
| - | get dialer option |
-
| - | get dialer option |
-
| - | return numeric dialer identifier |
-
| - | set dialer option |
-
| - | set dialer option |
-
| - | start dialer |
-
| - | free memory |
-
| - | get socket option |
-
| - | register inproc transport |
-
| - | register ipc transport |
-
| - | create and start listener |
-
| - | close listener |
-
| - | create listener |
-
| - | get listener option |
-
| - | get listener option |
-
| - | return numeric listener identifier |
-
| - | set listener option |
-
| - | set listener option |
-
| - | start listener |
-
| - | allocate a message |
-
| - | append to message body |
-
| - | return message body |
-
| - | remove data from end of message body |
-
| - | clear message body content |
-
| - | duplicate a message |
-
| - | free a message |
-
| - | get pipe for message |
-
| - | return message header |
-
| - | append to message header |
-
| - | remove data from end of message header |
-
| - | clear message header |
-
| - | prepend to message header |
-
| - | return message header length |
-
| - | remove data from start of message header |
-
| - | prepend to message body |
-
| - | return message body length |
-
| - | reallocate a message |
-
| - | set pipe for message |
-
| - | remove data from start of message body |
-
| - | create pair socket |
-
| - | close pipe |
-
| - | return dialer that created pipe |
-
| - | get pipe option |
-
| - | get pipe option |
-
| - | return numeric pipe identifier |
-
| - | return listener that created pipe |
-
| - | register pipe notification callback |
-
| - | return owning socket for pipe |
-
| - | create pub socket |
-
| - | create pull socket |
-
| - | create push socket |
-
| - | recv data |
-
| - | receive message asynchronously |
-
| - | recv message |
-
| - | create rep socket |
-
| - | create req socket |
-
| - | create respondent socket |
-
| - | send data |
-
| - | send message asynchronously |
-
| - | send message |
-
| - | set socket option |
-
| - | sleep asynchronously |
-
| - | get socket option |
-
| - | return numeric socket identifier |
-
| - | set socket option |
-
| - | get child statistic |
-
| - | get statistic description |
-
| - | find statistic by name |
-
| - | find dialer statistics |
-
| - | find listener statistics |
-
| - | find socket statistics |
-
| - | get statistic name |
-
| - | get next statistic |
-
| - | get statistic string value |
-
| - | get statistic timestamp |
-
| - | get statistic type |
-
| - | get statistic unit |
-
| - | get statistic value |
-
| - | free statistics snapshot |
-
| - | get statistics snapshot |
-
| - | duplicate string |
-
| - | return an error description |
-
| - | free memory |
-
| - | create sub socket |
-
| - | create surveyor socket |
-
| - | register tcp transport |
-
| - | register tls transport |
-
| - | clone URL structure |
-
| - | free a URL structure |
-
| - | create URL structure from a string |
-
| - | report library version |
-
| - | register WebSocket transport |
-
| - | register WebSocket secure transport |
-
| - | register ZeroTier transport |
-
This section documents the nanomsg 1.0 libary compatible functions.
-These functions are provided as a transition aid, for application -developers coming to NNG from libnanomsg, and are discouraged -from use in new applications.
-|
- Tip
- |
--While this is discouraged for long term use, as a transition aid -applications may use the value returned by the -nng_socket_id() in these functions just like a -socket descriptor (as if the socket were opened -via nn_socket()). -This sort of API intermixing should only be used during transition from -the legacy API to the new API. - | -
| - | allocate message (compatible API) |
-
| - | accept connections from remote peers (compatible API) |
-
| - | close socket (compatible API) |
-
| - | message control data (compatible API) |
-
| - | connect to remote peer (compatible API) |
-
| - | create forwarding device (compatible API) |
-
| - | return most recent error (compatible API) |
-
| - | free message (compatible API) |
-
| - | get statistic (stub) |
-
| - | get socket option (compatible API) |
-
| - | poll sockets (compatible API) |
-
| - | reallocate message (compatible API) |
-
| - | receive data (compatible API) |
-
| - | receive message (compatible API) |
-
| - | send data (compatible API) |
-
| - | send message (compatible API) |
-
| - | set socket option (compatible API) |
-
| - | shut down endpoint (compatible API) |
-
| - | create socket (compatible API) |
-
| - | return message for error (compatible API) |
-
| - | terminate library (compatible API) |
-
| - | compatibility with nanomsg 1.0 |
-
This section documents supplemental HTTP (HyperText Transport Protocol) -support functions that are available.
-These functions can be used in conjunction with the -WebSocket transport for Scalability Protocols, or they -may be used to construct other types of applications that communicate -using HTTP.
-It is also possible to combine the two, such that an HTTP server providing -static or dynamic content can also be used to host one or more Scalability -Protocols sockets.
-| - | allocate HTTP client |
-||
| - | establish HTTP client connection |
-||
| - | free HTTP client |
-||
| - | get HTTP client TLS configuration |
-||
| - | set HTTP client TLS configuration |
-||
| - | perform one HTTP transaction |
-||
| - | close HTTP connection |
-||
| - | read from HTTP connection |
-||
| - | read all from HTTP connection |
-||
| - | read HTTP request |
-||
| - | read HTTP response |
-||
| - | perform one HTTP transaction on connection |
-||
| - | write to HTTP connection |
-||
| - | write all to HTTP connection |
-||
| - | write HTTP request |
-||
| - | write HTTP response |
-||
| - | allocate HTTP server handler |
-||
| - | set HTTP handler to collect request body |
-||
| - | free HTTP server handler |
-||
| - | return extra data for HTTP handler |
-||
| - | set extra data for HTTP handler |
-||
| - | set host for HTTP handler |
-||
| - | set HTTP handler method |
-||
| - | set HTTP handler to match trees |
-||
| - | hijack HTTP server connection |
-||
| - | add HTTP request header |
-||
| - | allocate HTTP request structure |
-||
| - | copy HTTP request body |
-||
| - | delete HTTP request header |
-||
| - | free HTTP request structure |
-||
| - | get HTTP request body |
-||
| - | return HTTP request header |
-||
| - | return HTTP request method |
-||
| - | return HTTP request URI |
-||
| - | return HTTP request protocol version |
-||
| - | reset HTTP request structure |
-||
| - | set HTTP request body |
-||
| - | set HTTP request header |
-||
| - | set HTTP request method |
-||
| - | set HTTP request URI |
-||
| - | set HTTP request protocol version |
-||
| - | add HTTP response header |
-||
| - | allocate HTTP response structure |
-||
| - | allocate HTTP error response |
-||
| - | copy HTTP response body |
-||
| - | set HTTP response header |
-||
| - | free HTTP response structure |
-||
| - | get HTTP response body |
-||
| - | return HTTP response header |
-||
| - | return HTTP response reason |
-||
| - | return HTTP status code |
-||
| - | return HTTP response protocol version |
-||
| - | reset HTTP response structure |
-||
| - | set HTTP response body |
-||
| - | set HTTP response header |
-||
| - | set HTTP response reason |
-||
| - | set HTTP response status |
-||
| - | set HTTP response protocol version |
-||
| - | add HTTP server handler |
-||
| - | delete HTTP server handler |
-||
| - | get HTTP server address |
-||
| - | get HTTP server TLS configuration |
-||
| - | get and hold HTTP server instance |
-||
| - | release HTTP server instance |
-||
| - | use HTTP server error page |
-||
| - | set custom HTTP error file |
-||
| - | set custom HTTP error page |
-||
| - | set HTTP server TLS configuration |
-
This section documents the nanomsg 1.0 libary compatible functions.
+These functions are provided as a transition aid, for application +developers coming to NNG from libnanomsg, and are discouraged +from use in new applications.
+| - | start HTTP server |
++ + | +
+While this is discouraged for long term use, as a transition aid
+applications may use the value returned by the
+nng_socket_id() in these functions just like a
+socket descriptor (as if the socket were opened via
+nn_socket()).
+This sort of API intermixing should only be used during transition from
+the legacy API to the new API.
+ |
This section documents supplemental HTTP (HyperText Transport Protocol) +support functions that are available.
+These functions can be used in conjunction with the +WebSocket transport for Scalability Protocols, or they +may be used to construct other types of applications that communicate +using HTTP.
+It is also possible to combine the two, such that an HTTP server providing +static or dynamic content can also be used to host one or more Scalability +Protocols sockets.
+| - | stop HTTP server |
++ + | ++At present NNG only supports HTTP/1.0 and HTTP/1.1. + |
| - | close byte stream |
-
| - | allocate byte stream dialer |
-
| - | close byte stream dialer |
-
| - | initiate outgoing byte stream connection |
-
| - | free byte stream dialer |
-
| - | get option from byte stream dialer |
-
| - | set option on byte stream dialer |
-
| - | free byte stream |
-
| - | get option from byte stream |
-
| - | accept incoming byte stream connection |
-
| - | allocate byte stream listener |
-
| - | close byte stream listener |
-
| - | free byte stream listener |
-
| - | get option from byte stream listener |
-
| - | bind listener to configured address |
-
| - | set option on byte stream listener |
-
| - | receive from byte stream |
-
| - | send to byte stream |
-
| - | set option on byte stream |
-
| - | get time |
-
| - | allocate condition variable |
-
| - | free condition variable |
-
| - | wait for condition or timeout |
-
| - | wait for condition |
-
| - | wake all waiters |
-
| - | wake one waiter |
-
| - | sleep milliseconds |
-
| - | allocate mutex |
-
| - | free mutex |
-
| - | lock mutex |
-
| - | unlock mutex |
-
| - | parse command line options |
-
| - | get random number |
-
| - | create thread |
-
| - | reap thread |
-
Currently, this extra support can be provided by the -mbedTLS library.
+mbedTLS library or by external plug-ins.| - | allocate TLS configuration object |
-||
| - | configure authentication mode |
-||
| - | configure certificate authority certificate chain |
-||
| - | load certificate authority from file |
-||
| - | load own certificate and key from file |
-||
| - | deallocate a TLS configuration object |
-||
| - | hold TLS configuration object |
-||
| - | configure own certificate and key |
-||
| - | configure remote server name |
-||
| - | configure TLS version |
-||
| - | TLS engine description |
-||
| - | TLS FIPS 140-2 mode indicator |
-
| - | TLS engine name |
++ + | ++Contact Staysail Systems, Inc. for +details about commercially available options, including support for +FIPS 140-2 validated cryptography and TLS v1.3. + |
| - | asynchronous I/O handle |
-
| - | protocol context |
-
| - | dialer |
-
| - | relative time in milliseconds |
-
| - | scatter/gather element |
-
| - | IPC-specific options |
-
| - | listener |
-
| - | message |
-
| - | socket, dialer, listener, and pipe options |
-
| - | communications pipe |
-
| - | socket address |
-
| - | IPv4 socket address |
-
| - | IPv6 socket address |
-
| - | inproc socket address |
-
| - | IPC socket address |
-
| - | ZeroTier socket address |
-
| - | socket handle |
-
| - | statistic |
-
| - | byte stream |
-
| - | byte stream dialer |
-
| - | byte stream listener |
-
| - | TCP connection |
-
| - | TTCP-specific options |
-
| - | TLS over TCP connection |
-
| - | TLS configuration object |
-
| - | TLS engine implementation |
-
| - | TLS-specific options |
-
-Protocols represent “patterns” of communication, such as +
Protocols implement communication patterns, such as request/reply, publish/subscribe, and so forth. A given socket is created with exactly one protocol, and that protocol defines the key behavior of the socket.
-Conversely, transports are the underlying mechansims by which messages +
Conversely, transports are the underlying mechansims by which messages are moved between participants, such as TCP/IP or UNIX domain IPC. A given socket may be using several transports at the same time.
| - | nanomsg next generation |
-
| - | bus protocol |
-
| - | intra-process transport |
-
| - | IPC transport |
-
| - | pair protocol |
-
| - | publisher protocol |
-
| - | pull protocol |
-
| - | push protocol |
-
| - | reply protocol |
-
| - | request protocol |
-
| - | respondent protocol |
-
| - | subscriber protocol |
-
| - | surveyor protocol |
-
| - | TCP/IP transport |
-
| - | TLS transport |
-
| - | WebSocket transport |
-
| - | ZeroTier transport |
-
libnng - nanomsg next generation library
The nng library provides a common messaging framework +
NNG provides a common messaging framework intended to solve common communication problems in distributed applications.
Most applications will interact with nng synchronously; that is that +
Most applications will interact with NNG synchronously; that is that
functions such as nng_send() will block the calling
thread until the operation has completed.
A context structure, an nng_aio, is allocated and
@@ -1075,7 +719,7 @@ to observe program behaviors and as an aid in troubleshooting.
get statistic unit
get statistic value
close TLS connection
allocate TLS configuration
set remote server name
allocate TLS dialer
close TLS dialer
initiate outgoing TLS connection
free TLS dialer
get option from TLS dialer
set option on TLS dialer
free TLS connection
get option from TLS connection
accept incoming TLS connection
allocate TLS listener
close TLS listener
free TLS listener
get option from TLS listener
bind TLS listener to port
set option on TLS listener
receive from TLS connection
send to TLS connection
set option on TLS connection
nn_allocmsg - allocate message (compatible API)
#include <nanomsg/nn.h>
-
-void *nn_allocmsg(size_t size, int type);
+#include <nanomsg/nn.h>
+
+void *nn_allocmsg(size_t size, int type);
nn_bind - accept connections from remote peers (compatible API)
#include <nanomsg/nn.h>
-
+#include <nanomsg/nn.h>
+
int nn_bind(int sock, const char *url)
The nn_bind() function arranges for the socket sock to
accept connections at the address specified by url.
-An “endpoint identifier” for this socket’s association with the url is
+An identifier for this socket’s association with the url is
returned to the caller on success.
-This ID can be used with nn_shutdown() to
-“unbind” the socket from the address at url.
nn_shutdown() to
+remove the association later.
| -In nng buffers are sized as a count of messages rather than -bytes; accordingly this value is the nng queue depth multiplied by 1024 +In NNG buffers are sized as a count of messages rather than +bytes; accordingly this value is the queue depth multiplied by 1024 (representing an estimate that the average message size is 1kB). Applications that have unusual message sizes may wish to adjust the value used here accordingly. @@ -567,7 +211,7 @@ The default is zero. |
This option was unreliable in early releases of libnanomsg, and
-is unsupported in nng and recent libnanomsg releases.
+is unsupported in NNG and recent libnanomsg releases.
Applications needing assurance of message delivery should either include an
explicit notification (automatic with the NN_REQ protocol) or allow
sufficient time for the socket to drain before closing the socket or exiting.
@@ -597,7 +241,7 @@ their different application-specific purposes.
NN_MAXTTLMaximum “hops” through proxies and devices a message may go through. + Maximum number of times a message may traverse devices or proxies. This value, if positive, provides some protection against forwarding loops in device chains. NN_WS_MSG_TYPEThis This nng_socket(5), nn_close(3compat), nn_errno(3compat), -nn_getsockopt(3compat), +nn_getsockopt(3compat), nng_compat(3compat), nng(7) - - diff --git a/man/tip/nn_poll.3compat.html b/man/tip/nn_poll.3compat.html index dc2001e4..4759646f 100644 --- a/man/tip/nn_poll.3compat.html +++ b/man/tip/nn_poll.3compat.html @@ -1,386 +1,30 @@ --- version: tip -layout: manpage -title: nn_poll(3compat) +layout: manpage_v2 --- - -
-
-nn_poll(3compat) Manual Page+nn_poll(3compat)+NAME
+
-nn_poll - poll sockets (compatible API)
+
SYNOPSIS
-
-
-nn_reallocmsg(3compat) Manual Page+nn_reallocmsg(3compat)+NAME
+
-nn_reallocmsg - reallocate message (compatible API)
+
SYNOPSIS
-
+
-
-nn_recv(3compat) Manual Page+nn_recv(3compat)+NAME
-
nn_send - receive data (compatible API) +
+
nn_recv - receive data (compatible API) +SYNOPSIS
-
+
EAGAIN
-
-
-nn_recvmsg(3compat) Manual Page+nn_recvmsg(3compat)+NAME
+
-nn_recvmsg - receive message (compatible API)
+
SYNOPSIS
-
-
The values of
-
-
-nn_send(3compat) Manual Page+nn_send(3compat)+NAME
+
-nn_send - send data (compatible API)
+
SYNOPSIS
-
+
nn_allocmsg() or
nn_recvmsg(), using the same `NN_MSG size.
-In this case, the “ownership” of the message shall remain with
+In this case, the ownership of the message shall remain with
the caller, unless the function returns 0, indicating that the
function has taken responsibility for delivering or disposing of the
message.
@@ -503,5 +147,3 @@ completed before this function returns control to the caller.
-
-
-nn_sendmsg(3compat) Manual Page+nn_sendmsg(3compat)+NAME
+
-nn_sendmsg - send message (compatible API)
+
SYNOPSIS
-
-
The values of
- nn_setsockopt(3compat) Manual Page+nn_setsockopt(3compat)+NAME
+
-nn_setsockopt - set socket option (compatible API)
+
SYNOPSIS
-
+
|
-In nng buffers are sized as a count of messages rather than +In NNG buffers are sized as a count of messages rather than bytes, and so an attempt to estimate a conversion based upon a predetermined message size of 1kB is made. The value supplied is rounded up to the nearest value divisible by 1024, and @@ -551,7 +195,7 @@ The default is zero. |
This option was unreliable in early releases of libnanomsg, and
-is unsupported in nng and recent libnanomsg releases.
+is unsupported in NNG and recent libnanomsg releases.
Applications needing assurance of message delivery should either include an
explicit notification (automatic with the NN_REQ protocol) or allow
sufficient time for the socket to drain before closing the socket or exiting.
@@ -581,7 +225,7 @@ their different application-specific purposes.
NN_MAXTTLMaximum “hops” through proxies and devices a message may go through. + Maximum number of times a message may traverse devices or proxies. This value, if positive, provides some protection against forwarding loops in device chains. NN_WS_MSG_TYPEThis This
- nn_shutdown(3compat) Manual Page+nn_shutdown(3compat)+NAME
+
-nn_shutdown - shut down endpoint (compatible API)
+
SYNOPSIS
-
DESCRIPTION
-
The The
-
-nn_errno(3compat) Manual Page+nn_strerror(3compat)+NAME
+
-nn_strerror - return message for error (compatible API)
+
SYNOPSIS
-
-
-nn_term(3compat) Manual Page+nn_term(3compat)+NAME
+
-nn_term - terminate library (compatible API)
+
SYNOPSIS
-
-
-nng(7) Manual Page+nng(7)+NAME
+
-nng - nanomsg next generation
+
SYNOPSIS
-
cc ['flags'] 'files' -lnng ['libraries'] +cc ['flags'] 'files' -lnng ['libraries'] DESCRIPTION
-
@@ -393,33 +37,31 @@ publish/subscribe, and so forth.
as TCP, IPC, websockets, and so forth.
The nng library provides a common messaging framework intended to + NNG provides a common messaging framework intended to solve common communication problems in distributed applications. It offers a number of protocols, and also a number of transports.
-
The nng library is designed to permit easy creation of new transports and, + NNG is designed to permit easy creation of new transports and, to a lesser extent, new protocols.
-
The nng library is wire compatible with the SP protocols described in + NNG is wire compatible with the SP protocols described in the nanomsg project; projects using libnanomsg can inter-operate with nng as well as other conforming implementations. (One such implementation -is mangos.) Applications using nng -which wish to communicate with older libraries must ensure that they only -use protocols or transports offered by the earlier library. +is mangos.) +Applications using NNG +which wish to communicate with other libraries must ensure that they only +use protocols or transports offered by the other library.
-
The nng library also offers a compatible API, permitting legacy code to -be recompiled or relinked against nng. When doing this, support for + NNG also offers a compatible API, permitting legacy code to +be recompiled or relinked against NNG. When doing this, support for certain enhancements or features will likely be absent, requiring the application developer to use the new-style API.
-
-The nng library is implemented in pure C; if you need bindings for + NNG is implemented in pure C; if you need bindings for other languages please check the website.
- Protocols-
+
-
+
-Protocols
- Transports-
+
-
+
-Transports
- Conceptual Overview-
+
+ Conceptual Overview
-
nng presents a socket view of networking. + NNG presents a socket view of networking. The sockets are constructed using protocol-specific functions, as a given -socket implements precisely one nng protocol. +socket implements precisely one protocol.Each socket can be used to send and receive messages (if the protocol) @@ -578,18 +216,18 @@ For example, sub sockets automatically fil messages to discard those for topics that have not been subscribed.
-
nng sockets are message oriented, so that messages are either delivered + NNG sockets are message oriented, so that messages are either delivered wholly, or not at all. Partial delivery is not possible. -Furthermore, nng does not provide any other delivery or ordering guarantees; +Furthermore, NNG does not provide any other delivery or ordering guarantees; messages may be dropped or reordered (Some protocols, such as req may offer stronger guarantees by performing their own retry and validation schemes.)
-
Each socket can have zero, one, or many "endpoints", which are either + Each socket can have zero, one, or many endpoints, which are either listeners or dialers. (A given socket may freely choose whether it uses listeners, dialers, or both.) -These “endpoints” provide access to underlying transports, such as TCP, etc. +These endpoints provide access to underlying transports, such as TCP, etc.Each endpoint is associated with a URL, which is a service address. @@ -615,11 +253,10 @@ reconnecting. all; the socket abstraction should provide all the functionality needed other than in a few specific circumstances.
- Raw Mode+
+ Raw Mode
-
-Most applications will use nng sockets in “cooked” mode. + Most applications will use sockets in normal, or cooked, mode. This mode provides the full semantics of the protocol. For example, req sockets will automatically match a reply to a request, and resend requests periodically if no reply @@ -629,7 +266,7 @@ was received. There are situations, such as with proxies, where it is desirable to bypass these semantics and simply pass messages to and from the socket with no extra semantic handling. -This is possible using “raw” mode sockets. +This is possible using raw mode sockets.Raw mode sockets are generally constructed with a different function, @@ -654,17 +291,15 @@ processing is needed. |
-The nng library uses universal resource locators (URLs) +
NNG uses universal resource locators (URLs) following the format specified in RFC 3986, including some schemes that are unique to SP. - -The URLs used in nng are canonicalized as follows, mostly in +The URLs used in NNG are canonicalized as follows, mostly in accordance with RFC 3986 6.2.2:
The URL is parsed into scheme, userinfo, host, port, path, query and -fragment components. (Not all of these members are necessarily present.)
+ fragment components. (Not all of these members are necessarily present.)The scheme, hostname, and port if present, are converted to lower case.
Percent-encoded values for -unreserved characters -converted to their unencoded forms.
+ unreserved characters + converted to their unencoded forms.Additionally URL percent-encoded values for characters in the path -and with numeric values larger than 127 (i.e. not ASCII) are decoded.
+ and with numeric values larger than 127 (i.e. not ASCII) are decoded.The resulting path is checked for invalid UTF-8 sequences, consisting -of surrogate pairs, illegal byte sequences, or overlong encodings. -If this check fails, then the entire URL is considered invalid.
+ of surrogate pairs, illegal byte sequences, or overlong encodings. + If this check fails, then the entire URL is considered invalid.Path segments consisting of . and .. are resolved as per
-RFC 3986 6.2.2.3.
Further, empty path segments are removed, meaning that duplicate
-slash (/) separators are removed from the path.
/) separators are removed from the path.
Note that steps 4, 5, and 7 are not specified by RFC 3986, but performing -them is believed to improve both the usability and security of nng +them is believed to improve both the usability and security of applications, without violating RFC 3986 itself.
The library API is documented at libnng(3).
nng_aio - asynchronous I/O handle
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_aio nng_aio;
Asynchronous operations are performed without blocking calling application threads. -Instead the application registers a “callback” function to be executed +Instead the application registers a callback function to be executed when the operation is complete (whether successfully or not). This callback will be executed exactly once.
The asynchronous I/O framework in nng also supports cancellation of +
The asynchronous I/O framework also supports cancellation of
operations that are already in progress
(see nng_aio_cancel()), as well setting a maximum
timeout for them to complete within
@@ -432,10 +76,8 @@ and destroyed using nng_aio_free()nng_aio_stop(3),
nng_aio_wait(3),
nng_strerror(3),
-nng_aio(5),
+nng_aio(5),
nng(7)
nng_aio_abort - abort asynchronous I/O operation
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_aio_abort(nng_aio *aio, int err);
nng_aio_alloc - allocate asynchronous I/O handle
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_aio_alloc(nng_aio **aiop, void (*callb)(void *), void *arg);
nng_aio_begin - begin asynchronous I/O operation
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
bool nng_aio_begin(nng_aio *aio);
nng_aio_cancel - cancel asynchronous I/O operation
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_aio_cancel(nng_aio *aio);
nng_aio_count - return number of bytes transferred
#include <nng/nng.h>
-
-size_t nng_aio_count(nng_aio *aio);
+#include <nng/nng.h>
+
+size_t nng_aio_count(nng_aio *aio);
Some asynchronous operations do not provide meaningful data for this function; for example operations that establish connections do not -transfer user data (they may transfer protocol data though) — in this case +transfer user data (they may transfer protocol data though) -- in this case this function will generally return zero.
nng_aio_defer - defer asynchronous I/O operation
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef void (*nng_aio_cancelfn)(nng_aio *aio, void *arg, int err);
void nng_aio_defer(nng_aio *aio, nng_aio_cancelfn fn, void *arg);
@@ -492,5 +136,3 @@ although it is harmless if it does.
nng_aio_finish - finish asynchronous I/O operation
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_aio_finish(nng_aio *aio, int err);
nng_aio_free - free asynchronous I/O handle
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_aio_free(nng_aio *aio);
nng_aio_get_input - return input parameter
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void *nng_aio_get_input(nng_aio *aio, unsigned int index);
NULL is retu
nng_aio_get_msg - get message from asynchronous receive
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
nng_msg *nng_aio_get_msg(nng_aio *aio);
nng_aio must not have an operation
nng_aio_get_output - return output result
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void *nng_aio_get_output(nng_aio *aio, unsigned int index);
nng_aio_alloc(3), -nng_aio_get_output(3), +nng_aio_get_output(3), nng_aio_set_input(3), nng_aio_result(3), nng_aio(5), @@ -448,5 +92,3 @@ performed using the aio yet.
nng_aio_result - return result of asynchronous operation
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_aio_result(nng_aio *aio);
nng_aio_set_input - set input parameter
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_aio_set_input(nng_aio *aio, unsigned int index, void *param);
nng_aio_get_input() func
nng_aio_set_iov - set scatter/gather vector
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_aio_set_iov(nng_aio *aio, unsigned int niov, nng_iov *iov);
typedef struct nng_iov {
-void * iov_buf;
-size_t iov_len;
-};
+ typedef struct nng_iov {
+ void * iov_buf;
+ size_t iov_len;
+ };
nng_aio_set_msg - set message for asynchronous send
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_aio_set_msg(nng_aio *aio, nng_msg *msg);
nng_aio must not have an operation
nng_aio_set_output - set output result
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_aio_set_output(nng_aio *aio, unsigned int index, void *result);
nng_aio_get_output() fu
nng_aio_set_timeout - set asynchronous I/O timeout
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef int nng_duration;
void nng_aio_set_timeout(nng_aio *aio, nng_duration timeout);
If the timeout is NNG_DURATION_INFINITE, then no timeout is used.
-If the timeout is NNG_DURATION_DEFAULT, then a "default" or socket-specific
+If the timeout is NNG_DURATION_DEFAULT, then a "default" or socket-specific
timeout is used.
(This is frequently the same as NNG_DURATION_INFINITE.)
nng_aio_stop - stop asynchronous I/O operation
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_aio_stop(nng_aio *aio);
nng_aio_wait - wait for asynchronous I/O operation
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_aio_wait(nng_aio *aio);
nng_alloc - allocate memory
#include <nng/nng.h>
-
-void *nng_alloc(size_t size);
+#include <nng/nng.h>
+
+void *nng_alloc(size_t size);
NNG_ENOMEM.
nng_bus - bus protocol
#include <nng/protocol/bus0/bus.h>
+#include <nng/protocol/bus0/bus.h>
+
(protocol, bus) The bus protocol provides for building mesh networks where every peer is connected to every other peer. In this protocol, each message sent by a node is sent to every one of @@ -451,7 +95,7 @@ Sending messages will attempt to deliver to each directly connected peer.
When using a “raw” bus socket, received messages will +
When using a bus socket in raw mode, received messages will contain the incoming pipe ID as the sole element in the header. If a message containing such a header is sent using a raw bus socket, then, the message will be delivered to all connected pipes except the one @@ -463,7 +107,7 @@ capability prevents a message from being routed back to its source. If no header is present, then a message is sent to all connected pipes.
When using “cooked” bus sockets, no message headers are present.
+When using normal (cooked mode) bus sockets, no message headers are present.
nng_bus_open - create bus socket
#include <nng/nng.h>
-#include <nng/protocol/bus0/bus.h>
-
+#include <nng/nng.h>
+#include <nng/protocol/bus0/bus.h>
+
int nng_bus0_open(nng_socket *s);
int nng_bus0_open_raw(nng_socket *s);
@@ -392,7 +36,7 @@ title: nng_bus_open(3)
nng_clock - get time
#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
-typedef uint64_t nng_time;
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.h>
+
+typedef uint64_t nng_time;
nng_time nng_clock(void);
nng_cv_until()
nng_close - close socket
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_close(nng_socket s);
nng_compat - compatibility with nanomsg 1.0
#include <nanomsg/nn.h>
-
-#include <nanomsg/bus.h>
-#include <nanomsg/pair.h>
-#include <nanomsg/pipeline.h>
-#include <nanomsg/pubsub.h>
-#include <nanomsg/reqrep.h>
-#include <nanomsg/survey.h>
-
-#include <nanomsg/inproc.h>
-#include <nanomsg/ipc.h>
-#include <nanomsg/tcp.h>
-#include <nanomsg/ws.h>
+#include <nanomsg/nn.h>
+
+#include <nanomsg/bus.h>
+#include <nanomsg/pair.h>
+#include <nanomsg/pipeline.h>
+#include <nanomsg/pubsub.h>
+#include <nanomsg/reqrep.h>
+#include <nanomsg/survey.h>
+
+#include <nanomsg/inproc.h>
+#include <nanomsg/ipc.h>
+#include <nanomsg/tcp.h>
+#include <nanomsg/ws.h>
-The nng library provides source-level compatibility for -most nanomsg 1.0 applications.
+NNG provides source-level compatibility for +most libnanomsg 1.0 applications.
| This is intended to facilitate converting legacy applications to -use the nng library. -New applications should use the newer nng API instead. +use NNG. +New applications should use the newer NNG API instead. |
When compiling legacy nanomsg applications, it will generally be
-necessary to change the include search path to add the “compat” subdirectory
+necessary to change the include search path to add the compat subdirectory
of the directory where headers were installed.
-For example, if nng is installed in $prefix, then header files will
+For example, if NNG is installed in $prefix, then header files will
normally be located in $prefix/include/nng.
-In this case, to build legacy nanomsg apps against nng you would
+In this case, to build legacy nanomsg apps against NNG you would
add $prefix/include/nng/compat to your compiler’s search path.
#include <nanomsg/nn.h>
-#include <nanomsg/reqrep.h>
+#include <nanomsg/nn.h>
+#include <nanomsg/reqrep.h>
#include <nng/compat/nanomsg/nn.h>
-#include <nng/compat/nanomsg/reqrep.h>
+#include <nng/compat/nanomsg/nn.h>
+#include <nng/compat/nanomsg/reqrep.h>
Legacy applications built using these methods should be linked against libnng -instead of libnn, just like any other nng application.
+instead of libnn, just like any other NNG application.The following functions are provided:
ifndef::backend-pdf[]
+|
- terminate library +terminate library +endif::[] +ifdef::backend-pdf[] |
| + | create socket |
+
| + | get socket option |
+
| + | set socket option |
+
| + | accept connections from remote peers |
+
| + | connect to remote peer |
+
| + | send data |
+
| + | receive data |
+
| + | shut down endpoint |
+
| + | close socket |
+
| + | poll sockets |
+
| + | create forwarding device |
+
| + | receive message |
+
| + | send message |
+
| + | message control data |
+
| + | get statistic (stub) |
+
| + | allocate message |
+
| + | reallocate message |
+
| + | free message |
+
| + | return most recent error |
+
| + | return message for error |
+
| + | terminate library |
+
endif::[]
+The following caveats apply when using the legacy API with nng.
+The following caveats apply when using the legacy API with NNG.
Socket numbers can be quite large. -The legacy libnanomsg attempted to reuse socket numbers, like -file descriptors in UNIX systems. -The nng library avoids this to prevent accidental reuse or -collision after a descriptor is closed. -Consequently, socket numbers can become quite large, and should -probably not be used for array indices.
+ The legacy libnanomsg attempted to reuse socket numbers, like + file descriptors in UNIX systems. + NNG avoids this to prevent accidental reuse or + collision after a descriptor is closed. + Consequently, socket numbers can become quite large, and should + probably not be used for array indices.The following options (nn_getsockopt) are unsupported:
-NN_SNDPRIO, NN_RCVPRIO, NN_IPV4ONLY.
-The priority options may be supported in the future, when
-the underlying capability is present in nng.
NN_SNDPRIO, NN_RCVPRIO, NN_IPV4ONLY.
+ The priority options may be supported in the future, when
+ the underlying capability is present in NNG.
Access to statistics using this legacy API
-(nn_get_statistic()) is unsupported.
nn_get_statistic()) is unsupported.
Some transports can support longer URLs than legacy libnanomsg can. -It is a good idea to use short pathnames in URLs if interoperability -is a concern.
+ It is a good idea to use short pathnames in URLs if interoperability + is a concern.Only absolute paths are supported in ipc:// URLs.
-For example, ipc:///tmp/mysocket is acceptable, but ipc://mysocket is not.
ipc:///tmp/mysocket is acceptable, but ipc://mysocket is not.
The WebSocket transport in this implementation (ws:// URLs)
-only supports BINARY frames.
Some newer transports are unusable from this mode. -In particular, this legacy API offers no way to configure -TLS or ZeroTier parameters that may be required for use.
+ In particular, this legacy API offers no way to configure + TLS or ZeroTier parameters that may be required for use.ABI versioning of the compatibility layer is not supported,
-and the NN_VERSION_ macros are not present.
NN_VERSION_ macros are not present.
Runtime symbol information is not implemented.
-Specifically, there is no nn_symbol() function yet.
-(This may be addressed later if there is a need.)
nn_symbol() function yet.
+ (This may be addressed later if there is a need.)
The TCP transport (tcp:// URLs) does not support specifying the local
-address or interface when binding. (This could be fixed in the future,
-but most likely this will be available only using the new API.)
The values of NN_RCVMAXSIZE are constrained.
-Specifically, values set larger than 2GB using the new API will be reported
-as unlimited (-1) in the new API, and the value 0 will disable any
-enforcement, just like -1.
-(There is no practical reason to ever want to limit the receive size to
-zero.)
-1) in the new API, and the value 0 will disable any
+ enforcement, just like -1.
+ (There is no practical reason to ever want to limit the receive size to
+ zero.)
This implementation counts buffers in terms of messages rather than bytes.
-As a result, the buffer sizes accessed with NN_SNDBUF and NN_RCVBUF are
-rounded up to a whole number of kilobytes, then divided by 1024, in order
-to approximate buffering assuming 1 KB messages.
-Few applications should need to adjust the default values.
NN_SNDBUF and NN_RCVBUF are
+ rounded up to a whole number of kilobytes, then divided by 1024, in order
+ to approximate buffering assuming 1 KB messages.
+ Few applications should need to adjust the default values.
nng_ctx - protocol context
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_ctx_s nng_ctx
An nng_ctx is a handle to an underlying “context” object,
+
An nng_ctx is a handle to an underlying context object,
which keeps the protocol state for some stateful protocols.
The purpose of a separate context object is to permit applications to
share a single socket, with its various underlying
@@ -433,16 +77,15 @@ contexts.
Protocols that make use of contexts will also have a “default” context +
Protocols that make use of contexts will also have a default context that is used when the socket global operations are used. Operations using the global context will generally not interfere with any other contexts, except that certain socket options may affect socket global behavior.
-Historically, applications wanting to use a stateful protocol concurrently -would have to resort to raw mode sockets, which bypasses +
Historically, applications wanting to use a stateful protocol concurrently +would have to resort to raw mode sockets, which bypasses much of the various protocol handling, leaving it to up to the application to do so. Contexts make it possible to still benefit from advanced protocol handling, @@ -456,7 +99,7 @@ concurrently.
NNG_OPT_RECVFD or
-NNG_OPT_SENDFD options) while contexts
+NNG_OPT_RECVFD or
+NNG_OPT_SENDFD options) while contexts
are in use on the same socket is not supported, and may lead to unpredictable
behavior.
These asynchronous methods should not be mixed on the same socket.
@@ -513,39 +156,39 @@ to the sender.
+
struct echo_context {
-nng_ctx ctx;
-nng_aio *aio;
-enum { INIT, RECV, SEND } state;
+ nng_ctx ctx;
+ nng_aio *aio;
+ enum { INIT, RECV, SEND } state;
};
void
echo(void *arg)
{
-struct echo_context *ec = arg;
+ struct echo_context *ec = arg;
-switch (ec->state) {
-case INIT:
-ec->state = RECV;
-nng_ctx_recv(ec->ctx, ec->aio);
-return;
-case RECV:
-if (nng_aio_result(ec->aio) != 0) {
-// ... handle error
-}
-// We reuse the message on the ec->aio
-ec->state = SEND;
-nng_ctx_send(ec->ctx, ec->aio);
-return;
-case SEND:
-if (nng_aio_result(ec->aio) != 0) {
-// ... handle error
-}
-ec->state = RECV;
-nng_ctx_recv(ec->ctx, ec->aio);
-return;
-}
+ switch (ec->state) {
+ case INIT:
+ ec->state = RECV;
+ nng_ctx_recv(ec->ctx, ec->aio);
+ return;
+ case RECV:
+ if (nng_aio_result(ec->aio) != 0) {
+ // ... handle error
+ }
+ // We reuse the message on the ec->aio
+ ec->state = SEND;
+ nng_ctx_send(ec->ctx, ec->aio);
+ return;
+ case SEND:
+ if (nng_aio_result(ec->aio) != 0) {
+ // ... handle error
+ }
+ ec->state = RECV;
+ nng_ctx_recv(ec->ctx, ec->aio);
+ return;
+ }
}
nng_listen().
#define CONCURRENCY 1024
-
+#define CONCURRENCY 1024
+
echo_context ecs[CONCURRENCY];
void
start_echo_service(nng_socket rep_socket)
{
-for (int i = 0; i < CONCURRENCY; i++) {
-// error checks elided for clarity
-nng_ctx_open(ec[i].ctx, rep_socket)
-nng_aio_alloc(ec[i].aio, echo, &e[i]);
-ec[i].state = INIT;
-echo(&ec[i]); // start it running
-}
+ for (int i = 0; i < CONCURRENCY; i++) {
+ // error checks elided for clarity
+ nng_ctx_open(ec[i].ctx, rep_socket)
+ nng_aio_alloc(ec[i].aio, echo, &e[i]);
+ ec[i].state = INIT;
+ echo(&ec[i]); // start it running
+ }
}
nng_listen().
-
-
diff --git a/man/tip/nng_ctx_close.3.html b/man/tip/nng_ctx_close.3.html
index 6d7f3105..341d04cc 100644
--- a/man/tip/nng_ctx_close.3.html
+++ b/man/tip/nng_ctx_close.3.html
@@ -1,379 +1,23 @@
---
version: tip
-layout: manpage
-title: nng_ctx_close(3)
+layout: manpage_v2
---
-
-nng_ctx_close - close context
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_ctx_close(nng_ctx ctx);
nng_ctx_get - get context option
#include <nng/nng.h>
-
-int nng_ctx_get(nng_ctx ctx, const char *opt, void *val, size_t *valszp);
+#include <nng/nng.h>
+
+int nng_ctx_get(nng_ctx ctx, const char *opt, void *val, size_t *valszp);
int nng_ctx_get_bool(nng_ctx ctx, const char *opt, bool *bvalp);
@@ -382,11 +26,11 @@ title: nng_ctx_get(3)
int nng_ctx_get_ms(nng_ctx ctx, const char *opt, nng_duration *durp);
-int nng_ctx_get_size(nng_ctx ctx, const char *opt, size_t *zp);
+int nng_ctx_get_size(nng_ctx ctx, const char *opt, size_t *zp);
int nng_ctx_get_string(nng_ctx ctx, const char *opt, char **strp);
-int nng_ctx_get_uint64(nng_ctx ctx, const char *opt, uint64_t *u64p);
+int nng_ctx_get_uint64(nng_ctx ctx, const char *opt, uint64_t *u64p);
-The nng_ctx_get() functions are used to retrieve option values for
+
The nng_ctx_get() functions are used to retrieve option values for
the context ctx.
The actual options that may be retrieved in this way vary.
A number of them are documented in nng_options(5).
nng_ctx_getopt - get context option
#include <nng/nng.h>
-
-int nng_ctx_getopt(nng_ctx ctx, const char *opt, void *val, size_t *valszp);
+#include <nng/nng.h>
+
+int nng_ctx_getopt(nng_ctx ctx, const char *opt, void *val, size_t *valszp);
int nng_ctx_getopt_bool(nng_ctx ctx, const char *opt, bool *bvalp);
@@ -382,11 +26,11 @@ title: nng_ctx_getopt(3)
int nng_ctx_getopt_ms(nng_ctx ctx, const char *opt, nng_duration *durp);
-int nng_ctx_getopt_size(nng_ctx ctx, const char *opt, size_t *zp);
+int nng_ctx_getopt_size(nng_ctx ctx, const char *opt, size_t *zp);
int nng_ctx_getopt_string(nng_ctx ctx, const char *opt, char **strp);
-int nng_ctx_getopt_uint64(nng_ctx ctx, const char *opt, uint64_t *u64p);
+int nng_ctx_getopt_uint64(nng_ctx ctx, const char *opt, uint64_t *u64p);
-The nng_ctx_getopt() functions are used to retrieve option values for
+
The nng_ctx_getopt() functions are used to retrieve option values for
the context ctx.
The actual options that may be retrieved in this way vary.
A number of them are documented in nng_options(5).
nng_ctx_id - return numeric context identifier
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_ctx_id(nng_ctx c);
nng_ctx_open() function.
Contexts that are allocated on the stack or statically should be
initialized with the macro
-NNG_CTX_INITIALIZER to ensure that
+NNG_CTX_INITIALIZER to ensure that
they cannot be confused with a valid context before they are opened.
nng_ctx_open - create context
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_ctx_open(nng_ctx *ctxp, nng_socket s);
-TIP: Using contexts is an excellent way to write simpler concurrent +
TIP: Using contexts is an excellent way to write simpler concurrent applications, while retaining the benefits of the protocol-specific advanced processing, avoiding the need to bypass that with -raw mode sockets.
+raw mode sockets.| -Use of contexts with raw mode sockets is +Use of contexts with raw mode sockets is nonsensical, and not supported. | @@ -479,5 +122,3 @@ nonsensical, and not supported. - - diff --git a/man/tip/nng_ctx_recv.3.html b/man/tip/nng_ctx_recv.3.html index fbb0ce12..9c950fe1 100644 --- a/man/tip/nng_ctx_recv.3.html +++ b/man/tip/nng_ctx_recv.3.html @@ -1,379 +1,23 @@ --- version: tip -layout: manpage -title: nng_ctx_recv(3) +layout: manpage_v2 --- - -
-The operation will be “completed”, and the callback associated
+The operation will be completed, and the callback associated
with the aio executed, as soon as the socket accepts the message
for sending.
This does not indicate that the message was actually delivered, as it
@@ -542,5 +186,3 @@ If a synchronous operation is needed, one can be constructed by using a
-
-
diff --git a/man/tip/nng_ctx_set.3.html b/man/tip/nng_ctx_set.3.html
index 7a9ec496..6b4c001e 100644
--- a/man/tip/nng_ctx_set.3.html
+++ b/man/tip/nng_ctx_set.3.html
@@ -1,380 +1,24 @@
---
version: tip
-layout: manpage
-title: nng_ctx_set(3)
+layout: manpage_v2
---
-
-
- nng_ctx_set(3) Manual Page+nng_ctx_set(3)+NAME
+
-nng_ctx_set - set context option
+
SYNOPSIS
-
|
-These functions are deprecated. Please see nng_ctx_set. +These functions are deprecated. Please see nng_ctx_set. |
-The nng_ctx_set() functions are used to configure options for
+
The nng_ctx_set() functions are used to configure options for
the context ctx.
The actual options that may be configured in this way vary, and are
specified by opt.
This function is used to pass configure a string, str.
Strings passed this way must be legal UTF-8 or ASCII strings, terminated
-with a NUL (0) byte.
+with a NUL (\0) byte.
(Other constraints may apply as well, see the documentation for each option
for details.)
nng_ctx_setopt - set context option
#include <nng/nng.h>
-
-int nng_ctx_setopt(nng_ctx ctx, const char *opt, const void *val, size_t valsz);
+#include <nng/nng.h>
+
+int nng_ctx_setopt(nng_ctx ctx, const char *opt, const void *val, size_t valsz);
int nng_ctx_setopt_bool(nng_ctx ctx, const char *opt, int bval);
@@ -382,11 +26,11 @@ title: nng_ctx_setopt(3)
int nng_ctx_setopt_ms(nng_ctx ctx, const char *opt, nng_duration dur);
-int nng_ctx_setopt_size(nng_ctx ctx, const char *opt, size_t z);
+int nng_ctx_setopt_size(nng_ctx ctx, const char *opt, size_t z);
int nng_ctx_setopt_string(nng_ctx ctx, const char *opt, const char *str);
-int nng_ctx_setopt_uint64(nng_ctx ctx, const char *opt, uint64_t u64);
+int nng_ctx_setopt_uint64(nng_ctx ctx, const char *opt, uint64_t u64);
-The nng_ctx_setopt() functions are used to configure options for
+
The nng_ctx_setopt() functions are used to configure options for
the context ctx.
The actual options that may be configured in this way vary, and are
specified by opt.
This function is used to pass configure a string, str.
Strings passed this way must be legal UTF-8 or ASCII strings, terminated
-with a NUL (0) byte.
+with a NUL (\0) byte.
(Other constraints may apply as well, see the documentation for each option
for details.)
nng_cv_alloc - allocate condition variable
#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.h>
+
typedef struct nng_cv nng_cv;
int nng_cv_alloc(nng_cv **cvp, nng_mtx *mtx);
@@ -440,5 +84,3 @@ The mutex must also be owned when signaling the condition using the
nng_cv_free - free condition variable
#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.h>
+
void nng_cv_free(nng_cv *cv);
nng_cv_until - wait for condition or timeout
#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.h>
+
int nng_cv_until(nng_cv *cv, nng_time when);
-nng_mtx_lock(m); // assume cv was allocated using m
-while (!condition_true) {
-if (nng_cv_wait(cv) == NNG_ETIMEDOUT) {
-printf("Time out reached!n");
-break;
-}
-}
-// condition_true is true
-nng_mtx_unlock(m);
+
+ nng_mtx_lock(m); // assume cv was allocated using m
+ while (!condition_true) {
+ if (nng_cv_wait(cv) == NNG_ETIMEDOUT) {
+ printf("Time out reached!\n");
+ break;
+ }
+ }
+ // condition_true is true
+ nng_mtx_unlock(m);
nng_mtx_lock(m);
-condition_true = true;
-nng_cv_wake(cv);
-nng_mtx_unlock(m);
+ nng_mtx_lock(m);
+ condition_true = true;
+ nng_cv_wake(cv);
+ nng_mtx_unlock(m);
nng_cv_wait - wait for condition
#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.h>
+
void nng_cv_wait(nng_cv *cv);
-nng_mtx_lock(m); // assume cv was allocated using m
-while (!condition_true) {
-nng_cv_wait(cv);
-}
-// condition_true is true
-nng_mtx_unlock(m);
+
+ nng_mtx_lock(m); // assume cv was allocated using m
+ while (!condition_true) {
+ nng_cv_wait(cv);
+ }
+ // condition_true is true
+ nng_mtx_unlock(m);
nng_mtx_lock(m);
-condition_true = true;
-cv_wake(cv);
-nng_mtx_unlock(m);
+ nng_mtx_lock(m);
+ condition_true = true;
+ nng_cv_wake(cv);
+ nng_mtx_unlock(m);
nng_cv_wake - wake all waiters
#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.h>
+
void nng_cv_wake(nng_cv *cv);
nng_cv_wake1() for a solution to this problem.
nng_cv_wake1() for a solu
nng_cv_wake1 - wake one waiter
#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.h>
+
void nng_cv_wake1(nng_cv *cv);
-The nng_dialer_setopt() functions are used to configure options for
+
The nng_dialer_setopt() functions are used to configure options for
the dialer d.
The actual options that may be configured in this way
vary, and many are documented in nng_options(5).
This function is used to pass configure a string, str.
Strings passed this way must be legal UTF-8 or ASCII strings, terminated
-with a NUL (0) byte.
+with a NUL (\0) byte.
(Other constraints may apply as well, see the documentation for each option
for details.)
nng_dialer_start - start dialer
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_dialer_start(nng_dialer d, int flags);
nng_duration - relative time in milliseconds
#include <nng/nng.h>
+#include <nng/nng.h>
+
+typedef int32_t nng_duration;
-typedef int32_t nng_duration;
-
-#define NNG_DURATION_INFINITE (-1)
-#define NNG_DURATION_DEFAULT (-2)
-#define NNG_DURATION_ZERO (0)
+#define NNG_DURATION_INFINITE (-1)
+#define NNG_DURATION_DEFAULT (-2)
+#define NNG_DURATION_ZERO (0)
NNG_DURATION_DEFAULTIndicates a context-specific default value should be used.
-NNG_DURATION_INFINITEEffectively an infinite duration; used most often to disable timeouts.
@@ -410,6 +55,9 @@ This type is most often used in conjunction with timers and timeouts.nng_free - free memory
#include <nng/nng.h>
-
-void nng_free(void *ptr, size_t size);
+#include <nng/nng.h>
+
+void nng_free(void *ptr, size_t size);
nng_getopt - get socket option
#include <nng/nng.h>
-
-int nng_getopt(nng_socket s, const char *opt, void *val, size_t *valszp);
+#include <nng/nng.h>
+
+int nng_getopt(nng_socket s, const char *opt, void *val, size_t *valszp);
int nng_getopt_bool(nng_socket s, const char *opt, bool *bvalp);
@@ -384,11 +28,11 @@ title: nng_getopt(3)
int nng_getopt_ptr(nng_socket s, const char *opt, void **ptr);
-int nng_getopt_size(nng_socket s, const char *opt, size_t *zp);
+int nng_getopt_size(nng_socket s, const char *opt, size_t *zp);
int nng_getopt_string(nng_socket s, const char *opt, char **strp);
-int nng_getopt_uint64(nng_socket s, const char *opt, uint64_t *u64p);
+int nng_getopt_uint64(nng_socket s, const char *opt, uint64_t *u64p);
-The nng_getopt() functions are used to retrieve option values for
+
The nng_getopt() functions are used to retrieve option values for
the socket s.
The actual options that may be retrieved in this way vary.
A number of them are documented in nng_options(5).
nng_http_client_alloc - allocate HTTP client
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
int nng_http_client_alloc(nng_http_client *clientp, const nng_url *url);
nng_http_client_connect - establish HTTP client connection
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
void nng_http_client_connect(nng_http_client *client, nng_aio *aio);
nng_aio *aio;
-nng_url *url;
-nng_http_client *client;
-nng_http_conn *conn;
-int rv;
-
-// Error checks elided for clarity.
-nng_url_parse(&url, "http://www.google.com");
-nng_aio_alloc(&aio, NULL, NULL);
-nng_http_client_alloc(&client, url);
+ nng_aio *aio;
+ nng_url *url;
+ nng_http_client *client;
+ nng_http_conn *conn;
+ int rv;
-nng_http_client_connect(client, aio);
+ // Error checks elided for clarity.
+ nng_url_parse(&url, "http://www.google.com");
+ nng_aio_alloc(&aio, NULL, NULL);
+ nng_http_client_alloc(&client, url);
-// Wait for connection to establish (or attempt to fail).
-nng_aio_wait(aio);
+ nng_http_client_connect(client, aio);
-if ((rv = nng_aio_result(aio)) != 0) {
-printf("Connection failed: %sn", nng_strerror(rv));
-} else {
-// Connection established, get it.
-conn = nng_aio_get_output(aio, 0);
+ // Wait for connection to establish (or attempt to fail).
+ nng_aio_wait(aio);
-// ... do something with it here
+ if ((rv = nng_aio_result(aio)) != 0) {
+ printf("Connection failed: %s\n", nng_strerror(rv));
+ } else {
+ // Connection established, get it.
+ conn = nng_aio_get_output(aio, 0);
-// Close the connection when done to avoid leaking it.
-nng_http_conn_close(conn);
-}
+ // ... do something with it here
+
+ // Close the connection when done to avoid leaking it.
+ nng_http_conn_close(conn);
+ }
nng_http_client_free - free HTTP client
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
void nng_http_client_free(nng_http_client *client);
nng_http_client_get_tls - get HTTP client TLS configuration
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
int nng_http_client_get_tls(nng_http_client *client, nng_tls_config **cfgp);
nng_http_client_set_tls - set HTTP client TLS configuration
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
int nng_http_client_set_tls(nng_http_client *client, nng_tls_config *cfg);
nng_http_client_transact - perform one HTTP transaction
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
void nng_http_client_transact(nng_http_client *client, nng_http_req *req,
-nng_http_res *res, nng_aio *aio);
+ nng_http_res *res, nng_aio *aio);
nng_http_conn_close - close HTTP connection
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
void nng_http_conn_close(nng_http_conn *conn);
nng_http_conn_read - read from HTTP connection
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
void nng_http_conn_read(nng_http_conn *conn, nng_aio *aio);
nng_http_conn_read_all - read all from HTTP connection
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
void nng_http_conn_read_all(nng_http_conn *conn, nng_aio *aio);
Content-Length).
nng_http_conn_read_req - read HTTP request
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
void nng_http_conn_read_req(nng_http_conn *conn, nng_http_req *req,
-nng_aio *aio);
+ nng_aio *aio);
nng_http_conn_read_res - read HTTP response
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
void nng_http_conn_read_res(nng_http_conn *conn, nng_http_res *res,
-nng_aio *aio);
+ nng_aio *aio);
nng_http_conn_transact - perform one HTTP transaction on connection
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
void nng_http_conn_transact(nng_http_conn *conn, nng_http_req *req,
-nng_http_res *res, nng_aio *aio);
+ nng_http_res *res, nng_aio *aio);
nng_http_conn_write - write to HTTP connection
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
void nng_http_conn_write(nng_http_conn *conn, nng_aio *aio);
nng_http_conn_write_all - write all to HTTP connection
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
void nng_http_conn_write_all(nng_http_conn *conn, nng_aio *aio);
nng_http_conn_write_req - write HTTP request
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
void nng_http_conn_write_req(nng_http_conn *conn, nng_http_req *req,
-nng_aio *aio);
+ nng_aio *aio);
nng_http_conn_write_res - write HTTP response
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
void nng_http_conn_write_res(nng_http_conn *conn, nng_http_res *res,
-nng_aio *aio);
+ nng_aio *aio);
nng_http_handler_alloc - allocate HTTP server handler
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
typedef struct nng_http_handler nng_http_handler;
int nng_http_handler_alloc(nng_http_handler **hp, const char *path,
-void (*func)(nng_aio *);
+ void (*func)(nng_aio *);
int nng_http_handler_alloc_directory(nng_http_handler **hp, const char *path,
-const char *dirname);
+ const char *dirname);
int nng_http_handler_alloc_file(nng_http_handler **hp, const char *path,
-const char *filename);
+ const char *filename);
int nng_http_handler_alloc_redirect(nng_http_handler **hp, const char *path,
-uint16_t status, const char *location);
+ uint16_t status, const char *location);
int nng_http_handler_alloc_static(nng_http_handler **hp, const char *path,
-const void *data, size_t size, const char *content_type);
+ const void *data, size_t size, const char *content_type);
Additionally each handler has a method it is registered to handle
(the default is GET, see
nng_http_handler_set_method()), and
-optionally a 'Host' header it can be matched against (see
+optionally a 'Host' header it can be matched against (see
nng_http_handler_set_host()).
application/octet-stream is used.
The directory handler is created as a tree handler initially in exclusive mode (see -nng_http_handler_set_tree_exclusive -). This can be changed by calling nng_http_handler_set_tree(3http) after creating the directory handler.
+nng_http_handler_set_tree_exclusive). +This can be changed by calling +nng_http_handler_set_tree(3http) +after creating the directory handler.nng_http_handler_set_tr
to redirect an entire tree.
For example, it is possible to redirect an entire HTTP site to another
HTTPS site by specifying / as the path and then using the base
-of the new site, such as https://newsite.example.com as the
+of the new site, such as `https://newsite.example.com` as the
new location.
@@ -648,5 +293,3 @@ sent the data, with Content-Length of size bytes,
nng_http_handler_collect_body - set HTTP handler to collect request body
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
-int nng_http_handler_collect_body(nng_http_handler *handler, bool want, size_t maxsz);
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
+int nng_http_handler_collect_body(nng_http_handler *handler, bool want, size_t maxsz);
nng_http_req before the handler is called.
Furthermore, the data that the client may sent is limited by the
value of maxsz.
If the client attempts to send more data than maxsz, then the
-request will be terminated with a 400 “Bad Request” status.
+request will be terminated with a 400 Bad Request status.
| -The server will automatically call "GET" handlers if the client -sends a "HEAD" request, and will suppress HTTP body data in the responses +The server will automatically call "GET" handlers if the client +sends a "HEAD" request, and will suppress HTTP body data in the responses sent for such requests. | @@ -468,5 +112,3 @@ insist that the actual method sent over the wire be capitalized.The library does not contain support for versions of HTTP other than -"HTTP/1.0" and "HTTP/1.1". +"HTTP/1.0" and "HTTP/1.1". Specifying any other version may result in unspecified behavior. | @@ -464,5 +108,3 @@ Specifying any other version may result in unspecified behavior.
When displaying status information to users (or logging such information),
-consider also including the “reason phrase” obtained with
+consider also including the reason obtained with
nng_http_res_get_reason().
|
@@ -499,5 +143,3 @@ consider also including the “reason phrase” obtained with
The reason is never parsed automatically, but it can be a hint for humans -to help them understand the nature of any erroneous result. + to help them understand the nature of any erroneous result. |
nng_http_res_set_status - set HTTP response status
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
-int nng_http_res_set_status(nng_http_res *res, uint16_t status);
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
+int nng_http_res_set_status(nng_http_res *res, uint16_t status);
enum {
-NNG_HTTP_STATUS_CONTINUE = 100,
-NNG_HTTP_STATUS_SWITCHING = 101,
-NNG_HTTP_STATUS_PROCESSING = 102,
-NNG_HTTP_STATUS_OK = 200,
-NNG_HTTP_STATUS_CREATED = 201,
-NNG_HTTP_STATUS_ACCEPTED = 202,
-NNG_HTTP_STATUS_NOT_AUTHORITATIVE = 203,
-NNG_HTTP_STATUS_NO_CONTENT = 204,
-NNG_HTTP_STATUS_RESET_CONTENT = 205,
-NNG_HTTP_STATUS_PARTIAL_CONTENT = 206,
-NNG_HTTP_STATUS_MULTI_STATUS = 207,
-NNG_HTTP_STATUS_ALREADY_REPORTED = 208,
-NNG_HTTP_STATUS_IM_USED = 226,
-NNG_HTTP_STATUS_MULTIPLE_CHOICES = 300,
-NNG_HTTP_STATUS_STATUS_MOVED_PERMANENTLY = 301,
-NNG_HTTP_STATUS_FOUND = 302,
-NNG_HTTP_STATUS_SEE_OTHER = 303,
-NNG_HTTP_STATUS_NOT_MODIFIED = 304,
-NNG_HTTP_STATUS_USE_PROXY = 305,
-NNG_HTTP_STATUS_TEMPORARY_REDIRECT = 307,
-NNG_HTTP_STATUS_PERMANENT_REDIRECT = 308,
-NNG_HTTP_STATUS_BAD_REQUEST = 400,
-NNG_HTTP_STATUS_UNAUTHORIZED = 401,
-NNG_HTTP_STATUS_PAYMENT_REQUIRED = 402,
-NNG_HTTP_STATUS_FORBIDDEN = 403,
-NNG_HTTP_STATUS_NOT_FOUND = 404,
-NNG_HTTP_STATUS_METHOD_NOT_ALLOWED = 405,
-NNG_HTTP_STATUS_NOT_ACCEPTABLE = 406,
-NNG_HTTP_STATUS_PROXY_AUTH_REQUIRED = 407,
-NNG_HTTP_STATUS_REQUEST_TIMEOUT = 408,
-NNG_HTTP_STATUS_CONFLICT = 409,
-NNG_HTTP_STATUS_GONE = 410,
-NNG_HTTP_STATUS_LENGTH_REQUIRED = 411,
-NNG_HTTP_STATUS_PRECONDITION_FAILED = 412,
-NNG_HTTP_STATUS_PAYLOAD_TOO_LARGE = 413,
-NNG_HTTP_STATUS_ENTITY_TOO_LONG = 414,
-NNG_HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE = 415,
-NNG_HTTP_STATUS_RANGE_NOT_SATISFIABLE = 416,
-NNG_HTTP_STATUS_EXPECTATION_FAILED = 417,
-NNG_HTTP_STATUS_TEAPOT = 418,
-NNG_HTTP_STATUS_UNPROCESSABLE_ENTITY = 422,
-NNG_HTTP_STATUS_LOCKED = 423,
-NNG_HTTP_STATUS_FAILED_DEPENDENCY = 424,
-NNG_HTTP_STATUS_UPGRADE_REQUIRED = 426,
-NNG_HTTP_STATUS_PRECONDITION_REQUIRED = 428,
-NNG_HTTP_STATUS_TOO_MANY_REQUESTS = 429,
-NNG_HTTP_STATUS_HEADERS_TOO_LARGE = 431,
-NNG_HTTP_STATUS_UNAVAIL_LEGAL_REASONS = 451,
-NNG_HTTP_STATUS_INTERNAL_SERVER_ERROR = 500,
-NNG_HTTP_STATUS_NOT_IMPLEMENTED = 501,
-NNG_HTTP_STATUS_BAD_GATEWAY = 502,
-NNG_HTTP_STATUS_SERVICE_UNAVAILABLE = 503,
-NNG_HTTP_STATUS_GATEWAY_TIMEOUT = 504,
-NNG_HTTP_STATUS_HTTP_VERSION_NOT_SUPP = 505,
-NNG_HTTP_STATUS_VARIANT_ALSO_NEGOTIATES = 506,
-NNG_HTTP_STATUS_INSUFFICIENT_STORAGE = 507,
-NNG_HTTP_STATUS_LOOP_DETECTED = 508,
-NNG_HTTP_STATUS_NOT_EXTENDED = 510,
-NNG_HTTP_STATUS_NETWORK_AUTH_REQUIRED = 511,
+enum {
+ NNG_HTTP_STATUS_CONTINUE = 100,
+ NNG_HTTP_STATUS_SWITCHING = 101,
+ NNG_HTTP_STATUS_PROCESSING = 102,
+ NNG_HTTP_STATUS_OK = 200,
+ NNG_HTTP_STATUS_CREATED = 201,
+ NNG_HTTP_STATUS_ACCEPTED = 202,
+ NNG_HTTP_STATUS_NOT_AUTHORITATIVE = 203,
+ NNG_HTTP_STATUS_NO_CONTENT = 204,
+ NNG_HTTP_STATUS_RESET_CONTENT = 205,
+ NNG_HTTP_STATUS_PARTIAL_CONTENT = 206,
+ NNG_HTTP_STATUS_MULTI_STATUS = 207,
+ NNG_HTTP_STATUS_ALREADY_REPORTED = 208,
+ NNG_HTTP_STATUS_IM_USED = 226,
+ NNG_HTTP_STATUS_MULTIPLE_CHOICES = 300,
+ NNG_HTTP_STATUS_STATUS_MOVED_PERMANENTLY = 301,
+ NNG_HTTP_STATUS_FOUND = 302,
+ NNG_HTTP_STATUS_SEE_OTHER = 303,
+ NNG_HTTP_STATUS_NOT_MODIFIED = 304,
+ NNG_HTTP_STATUS_USE_PROXY = 305,
+ NNG_HTTP_STATUS_TEMPORARY_REDIRECT = 307,
+ NNG_HTTP_STATUS_PERMANENT_REDIRECT = 308,
+ NNG_HTTP_STATUS_BAD_REQUEST = 400,
+ NNG_HTTP_STATUS_UNAUTHORIZED = 401,
+ NNG_HTTP_STATUS_PAYMENT_REQUIRED = 402,
+ NNG_HTTP_STATUS_FORBIDDEN = 403,
+ NNG_HTTP_STATUS_NOT_FOUND = 404,
+ NNG_HTTP_STATUS_METHOD_NOT_ALLOWED = 405,
+ NNG_HTTP_STATUS_NOT_ACCEPTABLE = 406,
+ NNG_HTTP_STATUS_PROXY_AUTH_REQUIRED = 407,
+ NNG_HTTP_STATUS_REQUEST_TIMEOUT = 408,
+ NNG_HTTP_STATUS_CONFLICT = 409,
+ NNG_HTTP_STATUS_GONE = 410,
+ NNG_HTTP_STATUS_LENGTH_REQUIRED = 411,
+ NNG_HTTP_STATUS_PRECONDITION_FAILED = 412,
+ NNG_HTTP_STATUS_PAYLOAD_TOO_LARGE = 413,
+ NNG_HTTP_STATUS_ENTITY_TOO_LONG = 414,
+ NNG_HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE = 415,
+ NNG_HTTP_STATUS_RANGE_NOT_SATISFIABLE = 416,
+ NNG_HTTP_STATUS_EXPECTATION_FAILED = 417,
+ NNG_HTTP_STATUS_TEAPOT = 418,
+ NNG_HTTP_STATUS_UNPROCESSABLE_ENTITY = 422,
+ NNG_HTTP_STATUS_LOCKED = 423,
+ NNG_HTTP_STATUS_FAILED_DEPENDENCY = 424,
+ NNG_HTTP_STATUS_UPGRADE_REQUIRED = 426,
+ NNG_HTTP_STATUS_PRECONDITION_REQUIRED = 428,
+ NNG_HTTP_STATUS_TOO_MANY_REQUESTS = 429,
+ NNG_HTTP_STATUS_HEADERS_TOO_LARGE = 431,
+ NNG_HTTP_STATUS_UNAVAIL_LEGAL_REASONS = 451,
+ NNG_HTTP_STATUS_INTERNAL_SERVER_ERROR = 500,
+ NNG_HTTP_STATUS_NOT_IMPLEMENTED = 501,
+ NNG_HTTP_STATUS_BAD_GATEWAY = 502,
+ NNG_HTTP_STATUS_SERVICE_UNAVAILABLE = 503,
+ NNG_HTTP_STATUS_GATEWAY_TIMEOUT = 504,
+ NNG_HTTP_STATUS_HTTP_VERSION_NOT_SUPP = 505,
+ NNG_HTTP_STATUS_VARIANT_ALSO_NEGOTIATES = 506,
+ NNG_HTTP_STATUS_INSUFFICIENT_STORAGE = 507,
+ NNG_HTTP_STATUS_LOOP_DETECTED = 508,
+ NNG_HTTP_STATUS_NOT_EXTENDED = 510,
+ NNG_HTTP_STATUS_NETWORK_AUTH_REQUIRED = 511,
};
nng_http_set_reason().
This will help any humans who may have to diagnose a failure.
nng_http_res_set_version - set HTTP response protocol version
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
int nng_http_res_set_version(nng_http_res *res, const char *version);
The nng_http_res_set_version() sets the HTTP protocol version associated with
the response res to version.
The version must be a string containing
-a valid HTTP protocol version, such as "HTTP/1.0".
-The default value is "HTTP/1.1".
A local copy of the version is made in the response res.
@@ -413,7 +57,7 @@ No validation of the version supplied is performed.nng_http_server_add_handler - add HTTP server handler
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
int nng_http_server_add_handler(nng_http_server *s, nng_http_handler *h);
nng_http_server_del_handler - delete HTTP server handler
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
int nng_http_server_del_handler(nng_http_server *s, nng_http_handler *h);
nng_http_server_get_addr - get HTTP server address
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
int nng_http_server_get_addr(nng_http_server *server, nng_sockaddr *sap);
nng_http_server_get_tls - get HTTP server TLS configuration
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
int nng_http_server_get_tls(nng_http_server *s, nng_tls_config **cfgp);
nng_http_server_hold - get and hold HTTP server instance
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
int nng_http_server_hold(nng_http_server **serverp, const nng_url *url);
nng_http_server_release - release HTTP server instance
#include <nng/nng.h>
-#include <nng/supplemental/http/http.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/http/http.h>
+
void nng_http_server_release(nng_http_server *server);
This effectively drops the reference count on the server instance. When the reference count drops to zero, then the server and all resources associated with it (e.g. HTTP handlers, connections, etc.) are deallocated. -(If the server is "running" when this occurs, then the server is stopped.)
+(If the server is "running" when this occurs, then the server is stopped.)
While inproc accepts the option
-NNG_OPT_RECVMAXSZ for
+NNG_OPT_RECVMAXSZ for
compatibility, the value of the option is ignored with no enforcement.
As inproc peers are in the same address space, they are implicitly trusted,
and thus it makes no sense to spend cycles protecting a program from itself.
@@ -460,5 +104,3 @@ and thus it makes no sense to spend cycles protecting a program from itself.
-
-
diff --git a/man/tip/nng_inproc_register.3.html b/man/tip/nng_inproc_register.3.html
index 8dbe8d02..63921d0c 100644
--- a/man/tip/nng_inproc_register.3.html
+++ b/man/tip/nng_inproc_register.3.html
@@ -1,379 +1,23 @@
---
version: tip
-layout: manpage
-title: nng_inproc_register(3)
+layout: manpage_v2
---
-
-
-
-
-nng_inproc_register(3) Manual Page+nng_inproc_register(3)+NAME
+
-nng_inproc_register - register inproc transport
+
SYNOPSIS
-
The
-
-nng_iov(5) Manual Page+nng_iov(5)+NAME
+
-nng_iov - scatter/gather element
+
SYNOPSIS
-
nng_aio structure using the
iov_bufThis is a pointer to the first byte within the memory being -referenced by this scatter/gather element. + referenced by this scatter/gather element.iov_len
- nng_ipc(7) Manual Page+nng_ipc(7)+NAME
+
-nng_ipc - IPC transport
+
SYNOPSIS
-
DESCRIPTION
- + (transport, ipc) The ipc transport provides communication support between -nng sockets within different processes on the same host. +sockets within different processes on the same host. For POSIX platforms, this is implemented using UNIX domain sockets. For Windows, this is implemented using Windows Named Pipes. Other platforms may have different implementation strategies. @@ -393,14 +37,14 @@ Other platforms may have different implementation strategies.Registration
-
The ipc transport is generally built-in to the nng core, so + This transport is generally built-in to the core, so no extra steps to use it should be necessary. URI Format
-
@@ -411,7 +55,7 @@ name in the file system where the socket or named pipe should be created.
+ (URI, |
-On Windows, all names are prefixed by \.pipe and do not
+On Windows, all names are prefixed by \\.\pipe\ and do not
reside in the normal file system.
On POSIX platforms, the path is taken literally, and is relative to
the current directory, unless it begins with /, in which case it is
@@ -470,31 +114,31 @@ where supported by the underlying platform.
- nng_ipc_options(5) Manual Page+nng_ipc_options(5)+NAME
+
-nng_ipc_options - IPC-specific options
+
SYNOPSIS
-
+
This page documents the various standard options that can be set or -retrieved on objects using IPC in the nng library. +retrieved on objects using IPC.The option names should always be used by their symbolic definitions. @@ -421,7 +65,7 @@ as the implementations of IPC are quite different on Windows and POSIX systems.IPC Options
|
NNG_OPT_IPC_PEER_UIDNNG_OPT_IPC_PEER_UID(uint64_t)
This read-only option provides a connected peer’s user id.
@@ -461,13 +105,13 @@ This is the effective user id of the peer when either the underlying
listen() or connect() calls were made, and is not forgeable.
This option is generally only available on POSIX systems.
NNG_OPT_IPC_PEER_ZONEIDNNG_OPT_IPC_PEER_ZONEID(uint64_t)
This read-only option provides a connected peer’s the zone id.
Zones (and this option) are only supported on Solaris and illumos systems.
NNG_OPT_IPC_PERMISSIONSNNG_OPT_IPC_PERMISSIONS(int)
This write-only option may be applied to a listener to configure the
@@ -535,7 +179,7 @@ permission.
NNG_OPT_IPC_SECURITY_DESCRIPTORNNG_OPT_IPC_SECURITY_DESCRIPTOR(PSECURITY_DESCRIPTOR)
This write-only option may be used on listeners on Windows platforms to
@@ -556,10 +200,10 @@ when appropriate for the context:
nng_ipc_register - register ipc transport
#include <nng/transport/ipc/ipc.h>
-
+#include <nng/transport/ipc/ipc.h>
+
int nng_ipc_register(void);
The nng_ipc_register() function registers the
-ipc transport for use.
nng_listen - create and start listener
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_listen(nng_socket s, const char *url, nng_listener *lp, int flags);
nng_listener - listener
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_listener_s nng_listener;
-An nng_listener is a handle to a “listener” object, which is responsible for
+
An nng_listener is a handle to a listener object, which is responsible for
creating nng_pipe objects by accepting incoming connections.
A given listener object may create many pipes at the same time, much like an
HTTP server can have many connections to multiple clients simultaneously.
Listener objects are created by the
nng_listener_create()
-or nng_listen() functions, and are always “owned”
-by a single nng_socket.
nng_listen() functions, and are always associated
+with a single nng_socket.
-While it is convenient to think of listeners as “servers”, the
+While it is convenient to think of listeners as servers, the
relationship between the listener or dialer is orthogonal to any server or
client status that might be associated with a given protocol.
For example, a req socket might have associated dialers,
@@ -493,5 +137,3 @@ simpler nng_listen() function inste
-
-
diff --git a/man/tip/nng_listener_get.3.html b/man/tip/nng_listener_get.3.html
index 7f961cbc..a772f136 100644
--- a/man/tip/nng_listener_get.3.html
+++ b/man/tip/nng_listener_get.3.html
@@ -1,380 +1,24 @@
---
version: tip
-layout: manpage
-title: nng_listener_get(3)
+layout: manpage_v2
---
-
-
- nng_listener_get(3) Manual Page+nng_listener_get(3)+NAME
+
-nng_listener_get - get listener option
+
SYNOPSIS
-
DESCRIPTION
-
-The The
- nng_listener_getopt(3) Manual Page+nng_listener_getopt(3)+NAME
+
-nng_listener_getopt - get listener option
+
SYNOPSIS
-
|
-The nng_listener_getopt() functions are used to retrieve option values for
+
The nng_listener_getopt() functions are used to retrieve option values for
the listener l.
The actual options that may be retrieved in this way
vary, and many are documented in nng_options(5).
nng_listener_id - return numeric listener identifier
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_listener_id(nng_listener l);
nng_listen() functions.
listeners that are allocated on the stack or statically should be
initialized with the macro
-NNG_LISTENER_INITIALIZER to ensure that
+NNG_LISTENER_INITIALIZER to ensure that
they cannot be confused with a valid listener before they are created properly.
nng_listener_set - set listener option
#include <nng/nng.h>
-
-int nng_listener_set(nng_listener l, const char *opt, const void *val,
-size_t valsz);
+#include <nng/nng.h>
+
+int nng_listener_set(nng_listener l, const char *opt, const void *val,
+ size_t valsz);
int nng_listener_set_bool(nng_listener l, const char *opt, bool bval);
@@ -385,11 +29,11 @@ title: nng_listener_set(3)
int nng_listener_set_ptr(nng_listener l, const char *opt, void *ptr);
-int nng_listener_set_size(nng_listener l, const char *opt, size_t z);
+int nng_listener_set_size(nng_listener l, const char *opt, size_t z);
int nng_listener_set_string(nng_listener l, const char *opt, const char *str);
-int nng_listener_set_uint64(nng_listener l, const char *opt, uint64_t u64);
+int nng_listener_set_uint64(nng_listener l, const char *opt, uint64_t u64);
-The nng_listener_set() functions are used to configure options for
+
The nng_listener_set() functions are used to configure options for
the listener l.
The actual options that may be configured in this way
vary, and many are documented in nng_options(5).
This function is used to pass configure a string, str.
Strings passed this way must be legal UTF-8 or ASCII strings, terminated
-with a NUL (0) byte.
+with a NUL (\0) byte.
(Other constraints may apply as well, see the documentation for each option
for details.)
nng_listener_setopt - set listener option
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_listener_setopt(nng_listener l, const char *opt, const void *val,
-size_t valsz);
-
+ size_t valsz);
+
int nng_listener_setopt_bool(nng_listener l, const char *opt, bool bval);
int nng_listener_setopt_int(nng_listener l, const char *opt, int ival);
@@ -385,11 +29,11 @@ title: nng_listener_setopt(3)
int nng_listener_setopt_ptr(nng_listener l, const char *opt, void *ptr);
-int nng_listener_setopt_size(nng_listener l, const char *opt, size_t z);
+int nng_listener_setopt_size(nng_listener l, const char *opt, size_t z);
int nng_listener_setopt_string(nng_listener l, const char *opt, const char *str);
-int nng_listener_setopt_uint64(nng_listener l, const char *opt, uint64_t u64);
+int nng_listener_setopt_uint64(nng_listener l, const char *opt, uint64_t u64);
-The nng_listener_setopt() functions are used to configure options for
+
The nng_listener_setopt() functions are used to configure options for
the listener l.
The actual options that may be configured in this way
vary, and many are documented in nng_options(5).
This function is used to pass configure a string, str.
Strings passed this way must be legal UTF-8 or ASCII strings, terminated
-with a NUL (0) byte.
+with a NUL (\0) byte.
(Other constraints may apply as well, see the documentation for each option
for details.)
nng_listener_start - start listener
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_listener_start(nng_listener l, int flags);
nng_msg - message
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_msg nng_msg;
nng_msg_alloc - allocate a message
#include <nng/nng.h>
-
-int nng_msg_alloc(nng_msg **msgp, size_t size);
+#include <nng/nng.h>
+
+int nng_msg_alloc(nng_msg **msgp, size_t size);
nng_msg_append - append to message body
#include <nng/nng.h>
-
-int nng_msg_append(nng_msg *msg, const void *val, size_t size);
-int nng_msg_append_u16(nng_msg *msg, uint16_t val16);
-int nng_msg_append_u32(nng_msg *msg, uint32_t val32);
-int nng_msg_append_u64(nng_msg *msg, uint64_t val64);
+#include <nng/nng.h>
+
+int nng_msg_append(nng_msg *msg, const void *val, size_t size);
+int nng_msg_append_u16(nng_msg *msg, uint16_t val16);
+int nng_msg_append_u32(nng_msg *msg, uint32_t val32);
+int nng_msg_append_u64(nng_msg *msg, uint64_t val64);
nng_msg_body - return message body
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void *nng_msg_body(nng_msg *msg);
nng_msg_insert() variants.
nng_msg_chop - remove data from end of message body
#include <nng/nng.h>
-
-int nng_msg_chop(nng_msg *msg, size_t size);
-int nng_msg_chop_u16(nng_msg *msg, uint16_t *val16);
-int nng_msg_chop_u32(nng_msg *msg, uint32_t *val32);
-int nng_msg_chop_u64(nng_msg *msg, uint64_t *val64);
+#include <nng/nng.h>
+
+int nng_msg_chop(nng_msg *msg, size_t size);
+int nng_msg_chop_u16(nng_msg *msg, uint16_t *val16);
+int nng_msg_chop_u32(nng_msg *msg, uint32_t *val32);
+int nng_msg_chop_u64(nng_msg *msg, uint64_t *val64);
nng_msg_clear - clear message body content
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_msg_clear(nng_msg *msg);
nng_msg_dup - duplicate a message
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_msg_dup(nng_msg **dup, nng_msg_t *orig);
nng_msg_free - free a message
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_msg_free(nng_msg *msg);
nng_msg_get_pipe - get pipe for message
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
nng_pipe nng_msg_get_pipe(nng_msg *msg);
nng_msg_header - return message header
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void *nng_msg_header(nng_msg *msg);
NNG_OPT_RAW option.)
+NNG_OPT_RAW option.)
@@ -449,5 +93,3 @@ functions that modify the message or the header content.
nng_msg_header_append - append to message header
#include <nng/nng.h>
-
-int nng_msg_header_append(nng_msg *msg, const void *val, size_t size);
-int nng_msg_header_append_u16(nng_msg *msg, uint16_t val16);
-int nng_msg_header_append_u32(nng_msg *msg, uint32_t val32);
-int nng_msg_header_append_u64(nng_msg *msg, uint64_t val64);
+#include <nng/nng.h>
+
+int nng_msg_header_append(nng_msg *msg, const void *val, size_t size);
+int nng_msg_header_append_u16(nng_msg *msg, uint16_t val16);
+int nng_msg_header_append_u32(nng_msg *msg, uint32_t val32);
+int nng_msg_header_append_u64(nng_msg *msg, uint64_t val64);
nng_msg_header_chop - remove data from end of message header
#include <nng/nng.h>
-
-int nng_msg_header_chop(nng_msg *msg, size_t size);
-int nng_msg_header_chop_u16(nng_msg *msg, uint16_t *val16);
-int nng_msg_header_chop_u32(nng_msg *msg, uint32_t *val32);
-int nng_msg_header_chop_u64(nng_msg *msg, uint64_t *val64);
+#include <nng/nng.h>
+
+int nng_msg_header_chop(nng_msg *msg, size_t size);
+int nng_msg_header_chop_u16(nng_msg *msg, uint16_t *val16);
+int nng_msg_header_chop_u32(nng_msg *msg, uint32_t *val32);
+int nng_msg_header_chop_u64(nng_msg *msg, uint64_t *val64);
nng_msg_header_clear - clear message header
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_msg_header_clear(nng_msg *msg);
nng_msg_header_insert - prepend to message header
#include <nng/nng.h>
-
-int nng_msg_header_insert(nng_msg *msg, const void *val, size_t size);
-int nng_msg_header_insert_u16(nng_msg *msg, uint16_t val16);
-int nng_msg_header_insert_u32(nng_msg *msg, uint32_t val32);
-int nng_msg_header_insert_u64(nng_msg *msg, uint64_t val64);
+#include <nng/nng.h>
+
+int nng_msg_header_insert(nng_msg *msg, const void *val, size_t size);
+int nng_msg_header_insert_u16(nng_msg *msg, uint16_t val16);
+int nng_msg_header_insert_u32(nng_msg *msg, uint32_t val32);
+int nng_msg_header_insert_u64(nng_msg *msg, uint64_t val64);
nng_msg_header_len - return message header length
#include <nng/nng.h>
-
-size_t nng_msg_header_len(nng_msg *msg);
+#include <nng/nng.h>
+
+size_t nng_msg_header_len(nng_msg *msg);
nng_msg_header_trim - remove data from start of message header
#include <nng/nng.h>
-
-int nng_msg_header_trim(nng_msg *msg, size_t size);
-int nng_msg_header_trim_u16(nng_msg *msg, uint16_t *val16);
-int nng_msg_header_trim_u32(nng_msg *msg, uint32_t *val32);
-int nng_msg_header_trim_u64(nng_msg *msg, uint64_t *val64);
+#include <nng/nng.h>
+
+int nng_msg_header_trim(nng_msg *msg, size_t size);
+int nng_msg_header_trim_u16(nng_msg *msg, uint16_t *val16);
+int nng_msg_header_trim_u32(nng_msg *msg, uint32_t *val32);
+int nng_msg_header_trim_u64(nng_msg *msg, uint64_t *val64);
nng_msg_insert - prepend to message body
#include <nng/nng.h>
-
-int nng_msg_insert(nng_msg *msg, const void *val, size_t size);
-int nng_msg_insert(nng_msg *msg, uint16_t val16);
-int nng_msg_insert(nng_msg *msg, uint32_t val32);
-int nng_msg_insert(nng_msg *msg, uint64_t val64);
+#include <nng/nng.h>
+
+int nng_msg_insert(nng_msg *msg, const void *val, size_t size);
+int nng_msg_insert_u16(nng_msg *msg, uint16_t val16);
+int nng_msg_insert_u32(nng_msg *msg, uint32_t val32);
+int nng_msg_insert_u64(nng_msg *msg, uint64_t val64);
nng_msg_len - return message body length
#include <nng/nng.h>
-
-size_t nng_msg_len(nng_msg *msg);
+#include <nng/nng.h>
+
+size_t nng_msg_len(nng_msg *msg);
nng_msg_realloc - reallocate a message
#include <nng/nng.h>
-
-int nng_msg_realloc(nng_msg *msg, size_t size);
+#include <nng/nng.h>
+
+int nng_msg_realloc(nng_msg *msg, size_t size);
nng_msg_set_pipe - set pipe for message
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_msg_set_pipe(nng_msg *msg, nng_pipe p);
nng_msg_trim - remove data from start of message body
#include <nng/nng.h>
-
-int nng_msg_trim(nng_msg *msg, size_t size);
-int nng_msg_trim_u16(nng_msg *msg, uint16_t *val16);
-int nng_msg_trim_u32(nng_msg *msg, uint32_t *val32);
-int nng_msg_trim_u64(nng_msg *msg, uint64_t *val64);
+#include <nng/nng.h>
+
+int nng_msg_trim(nng_msg *msg, size_t size);
+int nng_msg_trim_u16(nng_msg *msg, uint16_t *val16);
+int nng_msg_trim_u32(nng_msg *msg, uint32_t *val32);
+int nng_msg_trim_u64(nng_msg *msg, uint64_t *val64);
nng_msleep - sleep milliseconds
#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.h>
+
void nng_msleep(nng_duration msec);
nng_mtx_alloc - allocate mutex
#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.h>
+
typedef struct nng_mtx nng_mtx;
int nng_mtx_alloc(nng_mtx **mtxp);
@@ -395,7 +39,7 @@ Every effort has been made to use light-weight underlying primitives when availa
Mutex (mutual exclusion) objects can be thought of as binary semaphores, -where only a single thread of execution is permitted to “own” the semaphore.
+where only a single thread of execution is permitted to acquire the semaphore.Furthermore, a mutex can only be unlocked by the thread that locked it.
@@ -440,5 +84,3 @@ where only a single thread of execution is permitted to “own” the senng_mtx_free - free mutex
#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.h>
+
void nng_mtx_free(nng_mtx *mtx);
nng_mtx_lock - lock mutex
#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.h>
+
void nng_mtx_lock(nng_mtx *mtx);
nng_mtx_unlock - unlock mutex
#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/util/platform.h>
+
void nng_mtx_unlock(nng_mtx *mtx);
nng_options - socket, dialer, listener, and pipe options
#include <nng/nng.h>
-
-#define NNG_OPT_SOCKNAME "socket-name"
-#define NNG_OPT_RAW "raw"
-#define NNG_OPT_PROTO "protocol"
-#define NNG_OPT_PROTONAME "protocol-name"
-#define NNG_OPT_PEER "peer"
-#define NNG_OPT_PEERNAME "peer-name"
-#define NNG_OPT_RECVBUF "recv-buffer"
-#define NNG_OPT_SENDBUF "send-buffer"
-#define NNG_OPT_RECVFD "recv-fd"
-#define NNG_OPT_SENDFD "send-fd"
-#define NNG_OPT_RECVTIMEO "recv-timeout"
-#define NNG_OPT_SENDTIMEO "send-timeout"
-#define NNG_OPT_LOCADDR "local-address"
-#define NNG_OPT_REMADDR "remote-address"
-#define NNG_OPT_URL "url"
-#define NNG_OPT_MAXTTL "ttl-max"
-#define NNG_OPT_RECVMAXSZ "recv-size-max"
-#define NNG_OPT_RECONNMINT "reconnect-time-min"
-#define NNG_OPT_RECONNMAXT "reconnect-time-max"
+#include <nng/nng.h>
+
+#define NNG_OPT_SOCKNAME "socket-name"
+#define NNG_OPT_RAW "raw"
+#define NNG_OPT_PROTO "protocol"
+#define NNG_OPT_PROTONAME "protocol-name"
+#define NNG_OPT_PEER "peer"
+#define NNG_OPT_PEERNAME "peer-name"
+#define NNG_OPT_RECVBUF "recv-buffer"
+#define NNG_OPT_SENDBUF "send-buffer"
+#define NNG_OPT_RECVFD "recv-fd"
+#define NNG_OPT_SENDFD "send-fd"
+#define NNG_OPT_RECVTIMEO "recv-timeout"
+#define NNG_OPT_SENDTIMEO "send-timeout"
+#define NNG_OPT_LOCADDR "local-address"
+#define NNG_OPT_REMADDR "remote-address"
+#define NNG_OPT_URL "url"
+#define NNG_OPT_MAXTTL "ttl-max"
+#define NNG_OPT_RECVMAXSZ "recv-size-max"
+#define NNG_OPT_RECONNMINT "reconnect-time-min"
+#define NNG_OPT_RECONNMAXT "reconnect-time-max"
This page documents the various standard options that can be set or -retrieved on objects in the nng library.
+retrieved on objects.Sockets (nng_socket objects) use the functions
@@ -468,19 +112,17 @@ choose a random ephemeral port instead.
NNG_OPT_RAW
-
-(bool)
-This read-only option indicates whether the socket is in “raw” mode.
-If true, the socket is in “raw” mode, and if false the socket is
-in “cooked” mode.
(bool)
+This read-only option indicates whether the socket is in raw mode.
+If true, the socket is in raw mode, and if false the socket is
+in normal mode.
Raw mode sockets generally do not have any protocol-specific semantics applied to them; instead the application is expected to perform such semantics itself. -(For example, in “cooked” mode a rep socket would +(For example, in normal mode a rep socket would automatically copy message headers from a received message to the corresponding -reply, whereas in “raw” mode this is not done.) -See Raw Mode for more details.
+reply, whereas in raw mode this is not done.) +See Raw Mode for more details.NNG_OPT_RECONNMINT
-(nng_duration)
+
(nng_duration)
This is the minimum amount of time (milliseconds) to wait before attempting
to establish a connection after a previous attempt has failed.
This can be set on a socket, but it can also be overridden on an individual
@@ -503,8 +144,7 @@ The option is irrelevant for listeners.
NNG_OPT_RECONNMAXT- +
(NNG_OPT_RECONNMAXT)
(nng_duration)
This is the maximum amount of time
(milliseconds) to wait before attempting to establish a connection after
@@ -525,9 +165,7 @@ The option is irrelevant for listeners.
NNG_OPT_RECVBUF
-
-(int)
+
(int)
This is the depth of the socket’s receive buffer as a number of messages.
Messages received by a transport may be buffered until the application
has accepted them for delivery.
@@ -541,10 +179,7 @@ For example req can only deal with a singl
NNG_OPT_RECVFD
-
-
-(int)
+
(int)
This read-only option is used to obtain an integer file descriptor suitable
for use with
poll(),
@@ -605,8 +240,7 @@ See nng_aio_alloc().
NNG_OPT_RECVMAXSZ
-(size_t)
+
(size_t)
This is the maximum message size that the will be accepted from a remote peer.
If a peer attempts to send a message larger than this, then the message
will be discarded.
@@ -648,9 +282,7 @@ Some transports may have further message size restrictions.
NNG_OPT_RECVTIMEO
-
-(nng_duration)
+
(nng_duration)
This is the socket receive timeout in milliseconds.
When no message is available for receiving at the socket for this period of
time, receive operations will fail with a return value of NNG_ETIMEDOUT.
NNG_OPT_SENDBUF
-
-(int)
+
(int)
This is the depth of the socket send buffer as a number of messages.
Messages sent by an application may be buffered by the socket until a
transport is ready to accept them for delivery.
@@ -700,10 +330,7 @@ simply discard messages when they cannot be delivered immediately.
NNG_OPT_SENDFD
-
-
-(int)
+
(int)
This read-only option is used to obtain an integer file descriptor suitable
for use with
poll(),
@@ -766,9 +393,7 @@ See nng_aio_alloc().
NNG_OPT_SENDTIMEO
-
-(nng_duration)
+
(nng_duration)
This is the socket send timeout in milliseconds.
When a message cannot be queued for delivery by the socket for this period of
time (such as if send buffers are full), the operation will fail with a
@@ -780,8 +405,7 @@ return value of NNG_ETIMEDOUT.
NNG_OPT_SOCKNAME-(string) +
(string) This the socket name. By default this is a string corresponding to the value of the socket. The string must fit within 64-bytes, including the terminating @@ -796,8 +420,8 @@ in the library itself.
NNG_OPT_MAXTTL(int)
-
-This is the maximum number of “hops” a message may traverse across
+(time-to-live)
+This is the maximum number of times a message may traverse across
a nng_device() forwarders.
The intention here is to prevent forwarding loops in device chains.
When this is supported, it can have a value between 1 and 255, inclusive.
NNG_OPT_URL- -(string) +
(string) This read-only option is used to obtain the URL with which a listener or dialer was configured. Accordingly it can only be used with dialers, listeners, and pipes.
@@ -917,5 +539,3 @@ the socket.nng_opts_parse - parse command line options
#include <nng/nng.h>
-#include <nng/supplemental/util/options.h>
-
+#include <nng/nng.h>
+#include <nng/supplemental/util/options.h>
+
typedef struct nng_optspec {
-const char *o_name; // Long style name (may be NULL for short only)
-int o_short; // Short option (no clustering!)
-int o_val; // Value stored on a good parse (>0)
-bool o_arg; // Option takes an argument if true
-} nng_optspec;
+ const char *o_name; // Long style name (may be NULL for short only)
+ int o_short; // Short option (no clustering!)
+ int o_val; // Value stored on a good parse (>0)
+ bool o_arg; // Option takes an argument if true
+} nng_optspec;
int nng_opts_parse(int argc, char *const *argv, const nng_optspec *spec, int *val, char **arg, int *idx);
Options are parsed as specified by spec (see Option Specification.) +
Options are parsed as specified by spec (see [Option Specification].) The value of the parsed option will be stored at the address indicated by val, and the value of idx will be incremented to reflect the next option to parse.
@@ -442,26 +86,26 @@ This structure has the following members:o_nameThe long style name for the option, such as "verbose".
-This will be parsed on the command line when it is prefixed with two dashes.
-It may be NULL if only a short option is to be supported.
The long style name for the option, such as "verbose".
+ This will be parsed on the command line when it is prefixed with two dashes.
+ It may be NULL if only a short option is to be supported.
o_shortThis is a single letter (at present only ASCII letters are supported). -These options appear as just a single letter, and are prefixed with a single dash on the command line. -The use of a slash in lieu of the dash is not supported, in order to avoid confusion with path name arguments. -This value may be set to 0 if no short option is needed.
+ These options appear as just a single letter, and are prefixed with a single dash on the command line. + The use of a slash in lieu of the dash is not supported, in order to avoid confusion with path name arguments. + This value may be set to 0 if no short option is needed.o_valThis is a numeric value that is unique to this option.
-This value is assigned by the application program, and must be non-zero
-for a valid option.
-If this is zero, then it indicates the end of the specifications, and the
-rest of this structure is ignored.
-The value will be returned to the caller in val by nng_opts_parse() when
-this option is parsed from the command line.
nng_opts_parse() when
+ this option is parsed from the command line.
o_argLong options are parsed from the argv array, and are indicated when
the element being scanned starts with two dashes.
-For example, the "verbose" option would be specified as --verbose on
+For example, the "verbose" option would be specified as --verbose on
the command line.
If a long option takes an argument, it can either immediately follow
the option as the next element in argv, or it can be appended to
@@ -523,46 +167,46 @@ unambiguously (meaning it must not match any other option specification.)
enum { OPT_LOGFILE, OPT_VERBOSE };
-char *logfile; // options to be set
-bool verbose;
+ enum { OPT_LOGFILE, OPT_VERBOSE };
+ char *logfile; // options to be set
+ bool verbose;
-static nng_optspec specs[] = {
-{
-.o_name = "logfile",
-.o_short = 'D',
-.o_val = OPT_LOGFILE,
-.o_arg = true,
-}, {
-.o_name = "verbose",
-.o_short = 'V',
-.o_val = OPT_VERBOSE,
-.o_arg = false,
-}, {
-.o_val = 0; // Terminate array
-}
-};
+ static nng_optspec specs[] = {
+ {
+ .o_name = "logfile",
+ .o_short = 'D',
+ .o_val = OPT_LOGFILE,
+ .o_arg = true,
+ }, {
+ .o_name = "verbose",
+ .o_short = 'V',
+ .o_val = OPT_VERBOSE,
+ .o_arg = false,
+ }, {
+ .o_val = 0; // Terminate array
+ }
+ };
-for (int idx = 1;;) {
-int rv, opt;
-char *arg;
-rv = nng_opts_parse(argc, argv, specs, &opt, &arg, &idx);
-if (rv != 0) {
-break;
-}
-switch (opt) {
-case OPT_LOGFILE:
-logfile = arg;
-break;
-case OPT_VERBOSE:
-verbose = true;
-break;
-}
-}
-if (rv != -1) {
-printf("Options error: %sn", nng_strerror(rv));
-exit(1);
-}
+ for (int idx = 1;;) {
+ int rv, opt;
+ char *arg;
+ rv = nng_opts_parse(argc, argv, specs, &opt, &arg, &idx);
+ if (rv != 0) {
+ break;
+ }
+ switch (opt) {
+ case OPT_LOGFILE:
+ logfile = arg;
+ break;
+ case OPT_VERBOSE:
+ verbose = true;
+ break;
+ }
+ }
+ if (rv != -1) {
+ printf("Options error: %s\n", nng_strerror(rv));
+ exit(1);
+ }
nng_pair - pair protocol
#include <nng/protocol/pair0/pair.h>
+#include <nng/protocol/pair0/pair.h>
#include <nng/protocol/pair1/pair.h>
+#include <nng/protocol/pair1/pair.h>
+
(protocol, pair) The pair protocol implements a peer-to-peer pattern, where relationships between peers are one-to-one.
nng_device()) or raw mode sockets
-(see NNG_OPT_RAW) where
+(see NNG_OPT_RAW) where
messages may be discarded.
Applications that require reliable delivery semantics should consider using
req sockets, or
@@ -530,15 +174,15 @@ to the sender.
NNG_OPT_MAXTTLNNG_OPT_MAXTTL(int, version 1 only). Maximum time-to-live.
NNG_OPT_PAIR1_POLY(bool, version 1 only) This option is no longer supported.
-Formerly it was used to configure polyamorous mode, but that mode
-is now established by using the nng_pair1_open_poly() function.
nng_pair1_open_poly() function.
nng_pair1_open_poly() function.
Version 1 of the pair protocol uses a single 32-bit unsigned value. The
-low-order (big-endian) byte of this value contains a "hop" count, and is
+low-order (big-endian) byte of this value contains a "hop" count, and is
used in conjunction with the
-NNG_OPT_MAXTTL option to guard against
+NNG_OPT_MAXTTL option to guard against
device forwarding loops.
This value is initialized to 1, and incremented each time the message is
received by a new node.
nng_pair_open - create pair socket
#include <nng/protocol/pair0/pair.h>
-
+#include <nng/protocol/pair0/pair.h>
+
int nng_pair0_open(nng_socket *s);
int nng_pair0_open_raw(nng_socket *s);
@@ -383,8 +27,8 @@ title: nng_pair_open(3)
Version 1
-#include <nng/protocol/pair1/pair.h>
-
+#include <nng/protocol/pair1/pair.h>
+
int nng_pair1_open(nng_socket *s);
int nng_pair1_open_raw(nng_socket *s);
@@ -406,7 +50,7 @@ create a pair version 0 or version 1
The nng_pair0_open_raw() and nng_pair1_open_raw() functions
create a pair version 0 or version 1
socket in
-raw mode and return it at the location pointed to by s.
+raw mode and return it at the location pointed to by s.
The nng_pair1_open_poly() function opens a pair version 1 socket in
@@ -470,5 +114,3 @@ The nng_pair1_open_poly() function will likely be removed in a futu
nng_pipe - communications pipe
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_pipe_s nng_pipe;
-An nng_pipe is a handle to a “pipe”, which can be thought of as a single
+
An nng_pipe is a handle to a pipe object, which can be thought of as a single
connection.
-(In most cases this is actually the case — the pipe is an abstraction for a
+(In most cases this is actually the case -- the pipe is an abstraction for a
single TCP or IPC connection.)
Pipes are associated with either the listener or dialer that created them,
and therefore are also automatically associated with a single socket.
Pipe objects are created by dialers (nng_dialer objects)
-and listeners (nng_listener objects), which can be
-thought of as “owning” the pipe.
nng_listener objects).
Pipe objects may be destroyed by the
nng_pipe_close() function.
-They are also closed when their “owning” dialer or listener is closed,
+They are also closed when the dialer or listener that created them is closed,
or when the remote peer closes the underlying connection.
nng_pipe p = NNG_PIPE_INITIALIZER;
+nng_pipe p = NNG_PIPE_INITIALIZER;
nng_pipe_close - close pipe
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_pipe_close(nng_pipe p);
nng_pipe_dialer - return dialer that created pipe
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
nng_dialer nng_pipe_dialer(nng_pipe p);
nng_pipe_get - get pipe option
#include <nng/nng.h>
-
-int nng_pipe_get(nng_pipe p, const char *opt, void *val, size_t *valszp);
+#include <nng/nng.h>
+
+int nng_pipe_get(nng_pipe p, const char *opt, void *val, size_t *valszp);
int nng_pipe_get_bool(nng_pipe p, const char *opt, bool *bvalp);
@@ -388,9 +32,9 @@ title: nng_pipe_get(3)
int nng_pipe_get_string(nng_pipe p, const char *opt, char **strp);
-int nng_pipe_get_size(nng_pipe p, const char *opt, size_t *zp);
+int nng_pipe_get_size(nng_pipe p, const char *opt, size_t *zp);
-int nng_pipe_get_uint64(nng_pipe p, const char *opt, uint64_t *u64p);
+int nng_pipe_get_uint64(nng_pipe p, const char *opt, uint64_t *u64p);
-The nng_pipe_get() functions are used to retrieve option values for
+
The nng_pipe_get() functions are used to retrieve option values for
the pipe p.
The actual options that may be retrieved in this way
vary, and many are documented in nng_options(5).
@@ -414,7 +57,7 @@ documented with the transports and protocols themselves.
nng_listener_set() or
nng_dialer_set().
@@ -607,5 +250,3 @@ related to identifiers, network numbers, and similar.
-
-
diff --git a/man/tip/nng_pipe_getopt.3.html b/man/tip/nng_pipe_getopt.3.html
index 5da187f8..fb422406 100644
--- a/man/tip/nng_pipe_getopt.3.html
+++ b/man/tip/nng_pipe_getopt.3.html
@@ -1,380 +1,24 @@
---
version: tip
-layout: manpage
-title: nng_pipe_getopt(3)
+layout: manpage_v2
---
-
-nng_pipe_getopt - get pipe option
#include <nng/nng.h>
-
-int nng_pipe_getopt(nng_pipe p, const char *opt, void *val, size_t *valszp);
+#include <nng/nng.h>
+
+int nng_pipe_getopt(nng_pipe p, const char *opt, void *val, size_t *valszp);
int nng_pipe_getopt_bool(nng_pipe p, const char *opt, bool *bvalp);
@@ -388,9 +32,9 @@ title: nng_pipe_getopt(3)
int nng_pipe_getopt_string(nng_pipe p, const char *opt, char **strp);
-int nng_pipe_getopt_size(nng_pipe p, const char *opt, size_t *zp);
+int nng_pipe_getopt_size(nng_pipe p, const char *opt, size_t *zp);
-int nng_pipe_getopt_uint64(nng_pipe p, const char *opt, uint64_t *u64p);
+int nng_pipe_getopt_uint64(nng_pipe p, const char *opt, uint64_t *u64p);
-The nng_pipe_getopt() functions are used to retrieve option values for
+
The nng_pipe_getopt() functions are used to retrieve option values for
the pipe p.
The actual options that may be retrieved in this way
vary, and many are documented in nng_options(5).
@@ -426,7 +69,7 @@ documented with the transports and protocols themselves.
nng_listener_setopt() or
nng_dialer_setopt().
@@ -619,5 +262,3 @@ related to identifiers, network numbers, and similar.
-
-
diff --git a/man/tip/nng_pipe_id.3.html b/man/tip/nng_pipe_id.3.html
index 8fd5b722..6f84b84d 100644
--- a/man/tip/nng_pipe_id.3.html
+++ b/man/tip/nng_pipe_id.3.html
@@ -1,379 +1,23 @@
---
version: tip
-layout: manpage
-title: nng_pipe_id(3)
+layout: manpage_v2
---
-
-nng_pipe_id - return numeric pipe identifier
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_pipe_id(nng_pipe p);
-1.
A pipe is considered valid if it was ever created by the socket.
Pipes that are allocated on the stack or statically should be
initialized with the macro
-NNG_PIPE_INITIALIZER to ensure that
+NNG_PIPE_INITIALIZER to ensure that
they cannot be confused with a valid pipe.
nng_pipe_listener - return listener that created pipe
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
nng_listener nng_pipe_listener(nng_pipe p);
nng_pipe_notify - register pipe notification callback
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef enum {
-NNG_PIPE_EV_ADD_PRE,
-NNG_PIPE_EV_ADD_POST,
-NNG_PIPE_EV_REM_POST,
+ NNG_PIPE_EV_ADD_PRE,
+ NNG_PIPE_EV_ADD_POST,
+ NNG_PIPE_EV_REM_POST,
} nng_pipe_ev;
typedef void (*nng_pipe_cb)(nng_pipe, nng_pipe_ev, void *);
@@ -509,5 +153,3 @@ This function ignores invalid values for ev.
nng_pipe_socket - return owning socket for pipe
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
nng_socket nng_pipe_socket(nng_pipe p);
The nng_pipe_socket() function returns the nng_socket
-that owns the pipe p.
| This protocol is useful in setting up RPC-like services. -It is also “reliable”, in that a the requester will keep retrying until +It is also reliable, in that a the requester will keep retrying until a reply is received. | @@ -425,7 +69,7 @@ was previously received. Any additional concurrent receive operations will result inThis protocol is useful in setting up RPC-like services. -It is also "reliable", in that a the requester will keep retrying until +It is also "reliable", in that a the requester will keep retrying until a reply is received. | @@ -418,10 +62,10 @@ some reason.)
+
(load-balancing)
The requester generally only has one outstanding request at a time unless
-in “raw” mode (via
-NNG_OPT_RAW),
+in raw mode (via
+NNG_OPT_RAW),
and it will generally attempt to spread work requests to different peer repliers.
NNG_OPT_REQ_RESENDTIME(nng_duration)
-When a new request is started, a timer of this duration is also started.
-If no reply is received before this timer expires, then the request will
-be resent.
-(Requests are also automatically resent if the peer to whom
-the original request was sent disconnects, or if a peer becomes available
-while the requester is waiting for an available peer.)
-This protocol uses a backtrace in the header. -This form uses a “stack” of 32-bit big-endian identifiers. +
This protocol uses a backtrace in the header. +This form uses a stack of 32-bit big-endian identifiers. There must be at least one identifier, the request ID, which will be the last element in the array, and must have the most significant bit set.
It may help to think of prepending a peer ID as “pushing” a peer ID onto the +
It may help to think of prepending a peer ID as pushing a peer ID onto the front of the stack of headers for the message. (It will use the peer ID it popped from the front to determine the next intermediate destination @@ -550,7 +193,7 @@ for the reply.)
that the request contained.A forwarding node can “pop” the peer ID it originally pushed on the +
A forwarding node can pop the peer ID it originally pushed on the message, stripping it from the front of the message as it does so.
nng_req_open - create req socket
#include <nng/nng.h>
-#include <nng/protocol/reqrep0/req.h>
-
+#include <nng/nng.h>
+#include <nng/protocol/reqrep0/req.h>
+
int nng_req0_open(nng_socket *s);
int nng_req0_open_raw(nng_socket *s);
@@ -392,7 +36,7 @@ title: nng_req_open(3)
nng_respondent - respondent protocol
#include <nng/protocol/survey0/respond.h>
+#include <nng/protocol/survey0/respond.h>
+
(protocol, respondent) The respondent protocol is one half of a survey pattern. In this pattern, a surveyor sends a survey, which is broadcast to all peer respondents. @@ -420,7 +64,7 @@ reply will be sent to surveyor from whom the last survey was received.
Respondents may discard a survey by simply not replying to it.
Raw mode sockets (set with NNG_OPT_RAW)
+
Raw mode sockets (set with NNG_OPT_RAW)
ignore all these restrictions.
-The respondent protocol uses a backtrace in the header. +
The respondent protocol uses a backtrace in the header. This is more fully documented in the surveyor manual.
nng_respondent_open - create respondent socket
#include <nng/nng.h>
-#include <nng/protocol/survey0/respond.h>
-
+#include <nng/nng.h>
+#include <nng/protocol/survey0/respond.h>
+
int nng_respondent0_open(nng_socket *s);
int nng_respondent0_open_raw(nng_socket *s);
@@ -395,7 +39,7 @@ pointed to by s.
The nng_respondent0_open_raw() function creates a
respondent
version 0 socket in
-raw mode and returns it at the location pointed to by s.
+raw mode and returns it at the location pointed to by s.
nng_send - send data
#include <nng/nng.h>
-
-int nng_send(nng_socket s, void *data, size_t size, int flags);
+#include <nng/nng.h>
+
+int nng_send(nng_socket s, void *data, size_t size, int flags);
NNG_FLAG_NONBLOCKThe function returns immediately, regardless of whether
-the socket is able to accept the data or not. If the socket is unable
-to accept the data (such as if backpressure exists because the peers
-are consuming messages too slowly, or no peer is present), then the
-function will return with NNG_EAGAIN. If this flag is not specified,
-then the function will block if such a condition exists.
NNG_EAGAIN. If this flag is not specified,
+ then the function will block if such a condition exists.
NNG_FLAG_ALLOCThe data was allocated using nng_alloc(), or was
-obtained from a call to nng_recv() with
-the NNG_FLAG_ALLOC flag.
-If this function returns success, then the data is "owned" by the
-function, and it will assume responsibility for calling
-nng_free() when it is no longer needed.
-In the absence of this flag, the data is copied by the implementation
-before the function returns to the caller.
nng_recv() with
+ the NNG_FLAG_ALLOC flag.
+ If this function returns success, then the data is "owned" by the
+ function, and it will assume responsibility for calling
+ nng_free() when it is no longer needed.
+ In the absence of this flag, the data is copied by the implementation
+ before the function returns to the caller.
nng_send_aio - send message asynchronously
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_send_aio(nng_socket s, nng_aio *aio);
The message to send must have previously been set on the aio
using the nng_aio_set_msg() function.
-The function assumes “ownership” of the message.
If the message was successfully queued for delivery to the socket, @@ -404,7 +48,7 @@ message when it is finished with it.
nng_sendmsg - send message
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_sendmsg(nng_socket s, nng_msg *msg, int flags);
If the function returns zero, indicating it has accepted the message for -delivery, then the msg is “owned” by the socket s, and the caller +delivery, then the msg is owned by the socket s, and the caller must not make any further use of it. The socket will free the message when it is finished.
NNG_FLAG_NONBLOCKThe function returns immediately, regardless of whether
-the socket is able to accept the data or not.
-If the socket is unable to accept the data (such as if backpressure exists
-because the peers are consuming messages too slowly, or no peer is present),
-then the function will return with NNG_EAGAIN.
-If this flag is not specified, then the function will block if such a
-condition exists.
NNG_EAGAIN.
+ If this flag is not specified, then the function will block if such a
+ condition exists.
nng_setopt - set socket option
#include <nng/nng.h>
-
-int nng_setopt(nng_socket s, const char *opt, const void *val, size_t valsz);
+#include <nng/nng.h>
+
+int nng_setopt(nng_socket s, const char *opt, const void *val, size_t valsz);
int nng_setopt_bool(nng_socket s, const char *opt, bool bval);
@@ -384,11 +28,11 @@ title: nng_setopt(3)
int nng_setopt_ptr(nng_socket s, const char *opt, void *ptr);
-int nng_setopt_size(nng_socket s, const char *opt, size_t z);
+int nng_setopt_size(nng_socket s, const char *opt, size_t z);
int nng_setopt_string(nng_socket s, const char *opt, const char *str);
-int nng_setopt_uint64(nng_socket s, const char *opt, uint64_t u64);
+int nng_setopt_uint64(nng_socket s, const char *opt, uint64_t u64);
-The nng_setopt() functions are used to configure options for
+
The nng_setopt() functions are used to configure options for
the socket s.
The actual options that may be configured in this way vary, and are
specified by opt.
@@ -500,7 +143,7 @@ message maximum sizes, and similar options.
This function is used to pass configure a string, str.
Strings passed this way must be legal UTF-8 or ASCII strings, terminated
-with a NUL (0) byte.
+with a NUL (\0) byte.
(Other constraints may apply as well, see the documentation for each option
for details.)
nng_sleep_aio - sleep asynchronously
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_sleep_aio(nng_duration msec, nng_aio *aio);
The nng_sleep_aio() function performs an asynchronous “sleep”,
+
The nng_sleep_aio() function provides an asynchronous delay mechanism,
causing the callback for aio to be executed after msec milliseconds.
If the sleep finishes completely, the result will always be zero.
NNG_ETIMEDOUT
nng_sockaddr - socket address
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef union nng_sockaddr {
-uint16_t s_family;
-nng_sockaddr_ipc s_ipc;
-nng_sockaddr_inproc s_inproc;
-nng_sockaddr_in s_in;
-nng_sockaddr_in6 s_in6;
-nng_sockaddr_zt s_zt;
+ uint16_t s_family;
+ nng_sockaddr_ipc s_ipc;
+ nng_sockaddr_inproc s_inproc;
+ nng_sockaddr_in s_in;
+ nng_sockaddr_in6 s_in6;
+ nng_sockaddr_zt s_zt;
} nng_sockaddr;
enum sockaddr_family {
-NNG_AF_UNSPEC = 0,
-NNG_AF_INPROC = 1,
-NNG_AF_IPC = 2,
-NNG_AF_INET = 3,
-NNG_AF_INET6 = 4,
-NNG_AF_ZT = 5,
+ NNG_AF_UNSPEC = 0,
+ NNG_AF_INPROC = 1,
+ NNG_AF_IPC = 2,
+ NNG_AF_INET = 3,
+ NNG_AF_INET6 = 4,
+ NNG_AF_ZT = 5,
};
-An nng_sockaddr is a structure used for
+
An nng_sockaddr is a structure used for
representing the addresses used by underlying transports, such as TCP/IP
addresses, IPC paths, and so forth.
The name sockaddr is based on its similarity with POSIX struct sockaddr,
-but in the nng library, these addresses are more closely affiliated with
+but in NNG, these addresses are more closely affiliated with
instances of nng_pipe
than of nng_socket.
The naming confusion is unfortunate.
Every member structure has as its first element a uint16_t field
-containing the “address family”.
+containing the address family.
This overlaps the s_family member of the union, and indicates which
specific member should be used.
nng_sockaddr_in - IPv4 socket address
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
enum sockaddr_family {
-NNG_AF_INET = 3,
+ NNG_AF_INET = 3,
};
typedef struct {
-uint16_t sa_family;
-uint16_t sa_port;
-uint32_t sa_addr;
+ uint16_t sa_family;
+ uint16_t sa_port;
+ uint32_t sa_addr;
} nng_sockaddr_in;
-An nng_sockaddr_in is the flavor of nng_sockaddr
+
An nng_sockaddr_in is the flavor of nng_sockaddr
used to represent TCP (and sometimes UDP) addresses,
including the Internet Protocol (IP) address and port number.
sa_portThis field holds the TCP or UDP port number, in network byte-order. -A zero value here is used when no specific port number is indicated.
+ A zero value here is used when no specific port number is indicated.sa_addrThis field holds the IP address in -network-byte order.
+ network-byte order.sockaddr_in, but it is
nng_sockaddr_in6 - IPv6 socket address
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
enum sockaddr_family {
-NNG_AF_INET6 = 4,
+ NNG_AF_INET6 = 4,
};
typedef struct {
-uint16_t sa_family;
-uint16_t sa_port;
-uint8_t sa_addr[16];
+ uint16_t sa_family;
+ uint16_t sa_port;
+ uint8_t sa_addr[16];
} nng_sockaddr_in6;
-An nng_sockaddr_in6 is the flavor of nng_sockaddr
+
An nng_sockaddr_in6 is the flavor of nng_sockaddr
used to represent TCP (and sometimes UDP) addresses,
including the Internet Protocol (IP) address and port number.
sa_portThis field holds the TCP or UDP port number, in network byte-order. -A zero value here is used when no specific port number is indicated.
+ A zero value here is used when no specific port number is indicated.sa_addrThis field holds the IP address in -network-byte order.
+ network-byte order.sockaddr_in6, but it is
nng_sockaddr_inproc - inproc socket address
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
enum sockaddr_family {
-NNG_AF_INPROC = 1,
+ NNG_AF_INPROC = 1,
};
typedef struct {
-uint16_t sa_family;
-uint16_t sa_name[128];
+ uint16_t sa_family;
+ uint16_t sa_name[128];
} nng_sockaddr_inproc;
-An nng_sockaddr_inproc is the flavor of nng_sockaddr
+
An nng_sockaddr_inproc is the flavor of nng_sockaddr
used to represent addresses associated with intra-process communication
using the inproc transport.
sa_nameThis field holds an arbitrary C string, which is the “name” of
-the address.
-The string must be NUL terminated, but no other restrictions exist.
This field holds an arbitrary C string, which is the name of the address.
+ The string must be NUL terminated, but no other restrictions exist.
nng_sockaddr_ipc - IPC socket address
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
enum sockaddr_family {
-NNG_AF_IPC = 2,
+ NNG_AF_IPC = 2,
};
typedef struct {
-uint16_t sa_family;
-uint16_t sa_path[128];
+ uint16_t sa_family;
+ uint16_t sa_path[128];
} nng_sockaddr_ipc;
-An nng_sockaddr_ipc is the flavor of nng_sockaddr
+
An nng_sockaddr_ipc is the flavor of nng_sockaddr
used to represent addresses associated with IPC communication
using the ipc transport.
sa_pathThis field holds the C string corresponding to path name where the
-IPC socket is located.
-For systems using UNIX domain sockets, this will be an absolute
-path name in the file system, where the UNIX domain socket is located.
-For Windows systems, this is the path name of the Named Pipe, without
-the leading \.pipe portion, which will be automatically added.
\\.pipe\ portion, which will be automatically added.
\.pipe portion, which will be automatically added.
ipc:// prefix.
nng_sockaddr_zt - ZeroTier socket address
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
enum sockaddr_family {
-NNG_AF_ZT = 5,
+ NNG_AF_ZT = 5,
};
typedef struct {
-uint16_t sa_family;
-uint64_t sa_nwid;
-uint64_t sa_nodeid;
-uint32_t sa_port;
+ uint16_t sa_family;
+ uint64_t sa_nwid;
+ uint64_t sa_nodeid;
+ uint32_t sa_port;
} nng_sockaddr_zt;
-An nng_sockaddr_zt is the flavor of nng_sockaddr
+
An nng_sockaddr_zt is the flavor of nng_sockaddr
used to represent ZeroTier addresses, including the
port number used by the
zt transport.
sa_nwid-This field holds the ZeroTier network number (or ID). -This value is in native byte order.
+This field holds the ZeroTier network number (or ID). + This value is in native byte order.
sa_nodeidThis field holds the ZeroTier node ID. -This value is in native byte order, and only the lower 40 bits -are significant. -(ZeroTier node numbers are 40 bits long.) -A zero value here is used for a wild-card to indicate that the -caller’s own node number be used.
+ This value is in native byte order, and only the lower 40 bits + are significant. + (ZeroTier node numbers are 40 bits long.) + A zero value here is used for a wild-card to indicate that the + caller’s own node number be used.sa_portThis field holds the “port number” used by the -zt transport to distinguish different -sockets. -This value in native byte order. -A zero value here indicates that a port number should be chosen -randomly from the ephemeral ports. -Only the lower 24 bits of the port number are used.
+This field holds the port number used by the + zt transport to distinguish different + sockets. + This value in native byte order. + A zero value here indicates that a port number should be chosen + randomly from the ephemeral ports. + Only the lower 24 bits of the port number are used.
nng_socket - socket handle
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_socket_s nng_socket;
An nng_socket is a handle to an underlying “socket” object.
+
An nng_socket is a handle to an underlying socket object.
All communication between the application and remote Scalability Protocol
peers is done through sockets.
A given socket can have multiple dialers (nng_dialer)
and/or listeners (nng_listener), and multiple
pipes (nng_pipe), and
may be connected to multiple transports at the same time.
-However, a given socket will have exactly one “protocol” associated with it,
+However, a given socket will have exactly one protocol associated with it,
and is responsible for any state machines or other protocol-specific logic.
nng_socket s = NNG_SOCKET_INITIALIZER;
+nng_socket s = NNG_SOCKET_INITIALIZER;
nng_socket_get - get socket option
#include <nng/nng.h>
-
-int nng_socket_get(nng_socket s, const char *opt, void *val, size_t *valszp);
+#include <nng/nng.h>
+
+int nng_socket_get(nng_socket s, const char *opt, void *val, size_t *valszp);
int nng_socket_get_bool(nng_socket s, const char *opt, bool *bvalp);
int nng_socket_get_int(nng_socket s, const char *opt, int *ivalp);
-int nng_socket_get_size(nng_socket s, const char *opt, size_t *zp);
+int nng_socket_get_size(nng_socket s, const char *opt, size_t *zp);
-int nng_socket_get_uint64(nng_socket s, const char *opt, uint64_t *u64p);
+int nng_socket_get_uint64(nng_socket s, const char *opt, uint64_t *u64p);
int nng_socket_get_string(nng_socket s, const char *opt, char **strp);
@@ -399,8 +43,7 @@ title: nng_socket_get(3)
DESCRIPTION
-
-The nng_socket_get() functions are used to retrieve option values for
+
The nng_socket_get() functions are used to retrieve option values for
the socket s.
The actual options that may be retrieved in this way vary.
A number of them are documented in nng_options(5).
@@ -585,5 +228,3 @@ numbers, and similar.
nng_socket_id - return numeric socket identifier
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_socket_id(nng_socket s);
nng_req0_open() function.
Sockets that are allocated on the stack or statically should be
initialized with the macro
-NNG_SOCKET_INITIALIZER
+NNG_SOCKET_INITIALIZER
to ensure that they cannot be confused with a valid socket before they are opened.
@@ -432,5 +76,3 @@ to ensure that they cannot be confused with a valid socket before they are opene
nng_socket_set - set socket option
#include <nng/nng.h>
-
-int nng_socket_set(nng_socket s, const char *opt, const void *val, size_t valsz);
+#include <nng/nng.h>
+
+int nng_socket_set(nng_socket s, const char *opt, const void *val, size_t valsz);
int nng_socket_set_bool(nng_socket s, const char *opt, bool bval);
@@ -384,11 +28,11 @@ title: nng_socket_set(3)
int nng_socket_set_ptr(nng_socket s, const char *opt, void *ptr);
-int nng_socket_set_size(nng_socket s, const char *opt, size_t z);
+int nng_socket_set_size(nng_socket s, const char *opt, size_t z);
int nng_socket_set_string(nng_socket s, const char *opt, const char *str);
-int nng_socket_set_uint64(nng_socket s, const char *opt, uint64_t u64);
+int nng_socket_set_uint64(nng_socket s, const char *opt, uint64_t u64);
-The nng_socket_set() functions are used to configure options for
+
The nng_socket_set() functions are used to configure options for
the socket s.
The actual options that may be configured in this way vary, and are
specified by opt.
@@ -488,7 +131,7 @@ message maximum sizes, and similar options.
This function is used to pass configure a string, str.
Strings passed this way must be legal UTF-8 or ASCII strings, terminated
-with a NUL (0) byte.
+with a NUL (\0) byte.
(Other constraints may apply as well, see the documentation for each option
for details.)
nng_stat - statistic
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_stat nng_stat;
nng_stat_child - get child statistic
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_stat nng_stat;
nng_stat *nng_stat_child(nng_stat *parent);
@@ -432,5 +76,3 @@ of NNG_STAT_SCOPE will have children.
nng_stat_desc - get statistic description
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_stat nng_stat;
const char *nng_stat_desc(nng_stat *stat);
@@ -443,5 +87,3 @@ At this time, only English descriptions are provided.
nng_stat_find - find statistic by name
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_stat nng_stat;
nng_stat *nng_stat_find(nng_stat *stat, const char *name);
@@ -434,5 +78,3 @@ If multiple statistics have that name, then only the first match is returned.
nng_stat_find_dialer - find dialer statistics
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_stat nng_stat;
typedef struct nng_dialer nng_dialer;
@@ -429,5 +73,3 @@ or by walking the tree with
nng_stat_find_listener - find listener statistics
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_stat nng_stat;
typedef struct nng_listener nng_listener;
@@ -429,5 +73,3 @@ or by walking the tree with
nng_stat_find_socket - find socket statistics
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_stat nng_stat;
typedef struct nng_socket nng_socket;
@@ -429,5 +73,3 @@ or by walking the tree with
nng_stat_name - get statistic name
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_stat nng_stat;
const char *nng_stat_name(nng_stat *stat);
@@ -394,7 +38,7 @@ title: nng_stat_name(3)
-The global root statistic will have the empty string ("") as it’s name.
+The global root statistic will have the empty string ("") as it’s name.
@@ -428,5 +72,3 @@ The global root statistic will have the empty string ("") as it’s name.
nng_stat_next - get next statistic
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_stat nng_stat;
nng_stat *nng_stat_next(nng_stat *stat);
@@ -419,5 +63,3 @@ If no more siblings are present, then NULL is returned.
nng_stat_string - get statistic string value
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_stat nng_stat;
const char *nng_stat_string(nng_stat *stat);
@@ -423,5 +67,3 @@ a string type.
nng_stat_timestamp - get statistic timestamp
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_stat nng_stat;
-uint64_t nng_stat_timestamp(nng_stat *stat);
+uint64_t nng_stat_timestamp(nng_stat *stat);
nng_stat_type - get statistic type
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_stat nng_stat;
enum {
-NNG_STAT_SCOPE,
-NNG_STAT_LEVEL,
-NNG_STAT_COUNTER,
-NNG_STAT_STRING,
-NNG_STAT_BOOLEAN,
-NNG_STAT_ID
+ NNG_STAT_SCOPE,
+ NNG_STAT_LEVEL,
+ NNG_STAT_COUNTER,
+ NNG_STAT_STRING,
+ NNG_STAT_BOOLEAN,
+ NNG_STAT_ID
};
int nng_stat_type(nng_stat *stat);
@@ -487,5 +131,3 @@ detail about the units measured by the static.
nng_stat_unit - get statistic unit
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_stat nng_stat;
enum {
-NNG_UNIT_NONE,
-NNG_UNIT_BYTES,
-NNG_UNIT_MESSAGES,
-NNG_UNIT_MILLIS,
-NNG_UNIT_EVENTS
+ NNG_UNIT_NONE,
+ NNG_UNIT_BYTES,
+ NNG_UNIT_MESSAGES,
+ NNG_UNIT_MILLIS,
+ NNG_UNIT_EVENTS
};
int nng_stat_unit(nng_stat *stat);
@@ -478,5 +122,3 @@ meaningless.
nng_stat_value - get statistic value
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_stat nng_stat;
-uint64_t nng_stat_value(nng_stat *stat);
+uint64_t nng_stat_value(nng_stat *stat);
nng_stat_type() for a descri
nng_stats_free - free statistics snapshot
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef nng_stat nng_stat;
void nng_stats_free(nng_stat *);
@@ -432,5 +76,3 @@ freed using this function.
nng_stats_get - get statistics snapshot
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_stat nng_stat;
int nng_stats_get(nng_stat **statsp)
@@ -505,5 +149,3 @@ and NULL otherwise.
nng_strdup - duplicate string
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
char *nng_strdup(const char *src);
This is logically equivalent to using nng_alloc()
-to allocate a region of memory of strlen(s) + 1 bytes, and then
+to allocate a region of memory of strlen(s) + 1 bytes, and then
using strcpy() to copy the string into the destination before
returning it.
NNG_ENOMEM.
nng_stream - byte stream
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_stream nng_stream;
nng_stream_listener_accept().
Byte streams are “reliable” in that data +
Byte streams are reliable in that data will not be delivered out of order, or with portions missing.
nng_stream_close - close byte stream
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_stream_close(nng_stream *s);
nng_stream_dialer - byte stream dialer
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
typedef struct nng_stream_dialer nng_stream_dialer;
-An nng_stream_dialer is a handle to a “dialer” for byte streams,
+
An nng_stream_dialer is a handle to a dialer for byte streams,
and is responsible for creating
nng_stream objects (corresponding to connected byte
streams) by connecting to remote peers.
nng_stream_dialer_alloc - allocate byte stream dialer
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_stream_dialer_alloc(nng_stream_dialer **dp, const char *addr);
int nng_stream_dialer_alloc_url(nng_stream_dialer **dp, const nng_url *url);
@@ -402,7 +46,7 @@ or pre-constructed
These functions may support different URL schemes, such as
-ipc://, tcp://, tls+tcp://, or ws://.
ipc://, tcp://, tls+tcp://, or ws://.
Both forms store the dialer in the location referenced by dp.
@@ -464,5 +108,3 @@ or pre-constructednng_stream_dialer_close - close byte stream dialer
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_stream_dialer_close(nng_stream_dialer *d);
nng_stream_dialer_dial - initiate outgoing byte stream connection
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_stream_dialer_dial(nng_stream_dialer *d, nng_aio *aio);
nng_stream_dialer_alloc() or
-nng_stream_dialer_alloc_url().
+nng_stream_dialer_alloc_url().
nng_stream_dialer_free - free byte stream dialer
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_stream_dialer_free(nng_stream_dialer *d);
nng_stream_dialer_get - get option from byte stream dialer
#include <nng/nng.h>
-
-int nng_stream_dialer_get(nng_stream_dialer *d, const char *opt, void *val, size_t *sizep);
+#include <nng/nng.h>
+
+int nng_stream_dialer_get(nng_stream_dialer *d, const char *opt, void *val, size_t *sizep);
int nng_stream_dialer_get_bool(nng_stream_dialer *d, const char *opt, bool *valp);
@@ -384,13 +28,13 @@ title: nng_stream_dialer_get(3str)
int nng_stream_dialer_get_ptr(nng_stream_dialer *d, const char *opt, void **valp);
-int nng_stream_dialer_get_size(nng_stream_dialer *d, const char *opt, size_t *valp);
+int nng_stream_dialer_get_size(nng_stream_dialer *d, const char *opt, size_t *valp);
int nng_stream_dialer_get_addr(nng_stream_dialer *d, const char *opt, nng_sockaddr *valp);
int nng_stream_dialer_get_string(nng_stream_dialer *d, const char *opt, char **valp);
-int nng_stream_dialer_get_uint64(nng_stream_dialer *d, const char *opt, uint64_t *valp);
+int nng_stream_dialer_get_uint64(nng_stream_dialer *d, const char *opt, uint64_t *valp);
There was insufficient space to receive the object. -The amount of data actually needed is returned in sizep.
+ The amount of data actually needed is returned in sizep.nng_stream_dialer_set - set option on byte stream dialer
#include <nng/nng.h>
-
-int nng_stream_dialer_set(nng_stream_dialer *d, const char *name, const void *data, size_t size);
+#include <nng/nng.h>
+
+int nng_stream_dialer_set(nng_stream_dialer *d, const char *name, const void *data, size_t size);
int nng_stream_dialer_set_bool(nng_stream_dialer *d, const char *opt, bool val);
@@ -384,11 +28,11 @@ title: nng_stream_dialer_set(3str)
int nng_stream_dialer_set_ptr(nng_stream_dialer *d, const char *opt, void *val);
-int nng_stream_dialer_set_size(nng_stream_dialer *d, const char *opt, size_t val);
+int nng_stream_dialer_set_size(nng_stream_dialer *d, const char *opt, size_t val);
int nng_stream_dialer_set_string(nng_stream_dialer *d, const char *opt, const char *val);
-int nng_stream_dialer_set_uint64(nng_stream_dialer *d, const char *opt, uint64_t val);
+int nng_stream_dialer_set_uint64(nng_stream_dialer *d, const char *opt, uint64_t val);
int nng_stream_dialer_set_addr(nng_stream_dialer *d, const char *opt, const nng_sockaddr *val);
This function is used to pass a pointer to structured data.
The data referenced by is generally managed by other functions.
For example, TLS configuration objects created with
-nng_tls_config_alloc()
+nng_tls_config_alloc()
can be passed this way.
|
There was insufficient space to receive the object. -The amount of data actually needed is returned in sizep. + The amount of data actually needed is returned in sizep. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was insufficient space to receive the object. -The amount of data actually needed is returned in sizep. + The amount of data actually needed is returned in sizep. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
nng_sub - subscriber protocol
#include <nng/nng.h>
-#include <nng/protocol/pubsub0/sub.h>
+#include <nng/nng.h>
+#include <nng/protocol/pubsub0/sub.h>
+
(protocol, sub) The sub protocol is one half of a publisher/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.
@@ -437,11 +81,11 @@ Attempts to send messages will result inNNG_ENOTSUP.
NNG_OPT_SUB_SUBSCRIBEThis option registers a topic that the subscriber is interested in. -The option is write-only, and takes an array of bytes, of arbitrary size. -Each incoming message is checked against the list of subscribed topics. -If the body begins with the entire set of bytes in the topic, then the -message is accepted. If no topic matches, then the message is -discarded.
+ The option is write-only, and takes an array of bytes, of arbitrary size. + Each incoming message is checked against the list of subscribed topics. + If the body begins with the entire set of bytes in the topic, then the + message is accepted. If no topic matches, then the message is + discarded.| - - | -
-The nng_tcp object is used for raw TCP connections, and
-should not be confused with a pipe object created using the
-nng_tcp(7) transport.
- |
-
| - - | --Most NNG applications should not use this, but instead use the -nng_tcp(7) transport instead. - | -
These objects are created either establishing an outgoing connection
-with nng_tcp_dialer_dial() or by
-accepting in incoming connection with
-nng_tcp_listener_accept().
TCP connections are byte streams, and are “reliable” in that data -will not be delivered out of order, or with portions missing.
-Data can be sent using nng_tcp_send() or
-received with nng_tcp_recv().
When the connection is no longer needed, it should be freed with
-nng_tcp_free().
| - - | -
-It is possible to close the connection, without freeing it, by
-using nng_tcp_close().
- |
-
The following options are applicable to TCP connections, and may be
-accessed using the nng_tcp_getopt() and
-nng_tcp_setopt() functions.
Other platform specific options may be available as well.
-nng_tcp - TCP/IP transport
#include <nng/transport/tcp/tcp.h>
-
+#include <nng/transport/tcp/tcp.h>
+
int nng_tcp_register(void);
+
(transport, tcp) The tcp transport provides communication support between -nng sockets across a TCP/IP network. +sockets across a TCP/IP network. Both IPv4 and IPv6 are supported when the underlying platform also supports it.
The nng_tcp transport is generally built-in to the nng core, so +
This transport is generally built-in to the core of NNG, so no extra steps to use it should be necessary.
+
(URI, tcp://)
This transport uses URIs using the scheme tcp://, followed by
an IP address or hostname, followed by a colon and finally a
TCP port number.
@@ -431,7 +75,7 @@ The details of this varies across operating systems.
tcp6:// and tcp4:// are nng extensions, and might not
+Both tcp6:// and tcp4:// are specific to NNG, and might not
be understood by other implementations.
tcp://[::1]:80.
The special value of 0 (INADDR_ANY)
+
The special value of 0 (INADDR_ANY)(INADDR_ANY)
can be used for a listener to indicate that it should listen on all
interfaces on the host.
A short-hand for this form is to either omit the address, or specify
@@ -503,19 +147,19 @@ where supported by the underlying platform.
nng_tcp_options - TTCP-specific options
+nng_tcp_options - TCP-specific options
+#include <nng/nng.h>
-
-#define NNG_OPT_TCP_NODELAY "tcp-nodelay"
-#define NNG_OPT_TCP_KEEPALIVE "tcp-keepalive"
-#define NNG_OPT_TCP_BOUND_PORT "tcp-bound-port"
+#include <nng/nng.h>
+
+#define NNG_OPT_TCP_NODELAY "tcp-nodelay"
+#define NNG_OPT_TCP_KEEPALIVE "tcp-keepalive"
+#define NNG_OPT_TCP_BOUND_PORT "tcp-bound-port"
This page documents the various standard options that can be set or -retrieved on objects using TCP in the nng library.
+retrieved on objects using TCP.The option names should always be used by their symbolic definitions.
@@ -412,7 +56,7 @@ TCP/IP communications.NNG_OPT_TCP_NODELAY(bool)
-This option is used to disable (or enable) the use of Nagle’s algorithm
+This option is used to disable (or enable) the use of Nagle's algorithm
for TCP connections.
|
-Thread objects created by this function may not be “real”
-threads capable of performing blocking I/O operations using normal blocking
+Thread objects created by this function may not be real system
+level threads capable of performing blocking I/O operations using normal blocking
system calls.
If use of blocking system calls is required (not including APIs provided
by the NNG library itself of course), then real OS-specific threads
@@ -509,5 +153,3 @@ Threads can be synchronized using
-
-
diff --git a/man/tip/nng_thread_destroy.3supp.html b/man/tip/nng_thread_destroy.3supp.html
index fd2bda10..25ddd748 100644
--- a/man/tip/nng_thread_destroy.3supp.html
+++ b/man/tip/nng_thread_destroy.3supp.html
@@ -1,380 +1,24 @@
---
version: tip
-layout: manpage
-title: nng_thread_destroy(3supp)
+layout: manpage_v2
---
-
-
-
-nng_thread_destroy(3supp) Manual Page+nng_thread_destroy(3supp)+NAME
+
-nng_thread_destroy - reap thread
+
SYNOPSIS
-
-
-nng_tls(5) Manual Page-NAME-
-
-nng_tls - TLS over TCP connection -
-
-
-
-SYNOPSIS-
-
-
-
-
-
-
-
-
-DESCRIPTION-
-
-
-
-An
-
-
-
-
-
-These objects are created either establishing an outgoing connection
-with
-
-TLS connections are byte streams, and are “reliable” in that data -will not be delivered out of order, or with portions missing. -
-
-Data can be sent using
-
-When the connection is no longer needed, it should be freed with
-
-
-
-
-Options-
-
-The following options are applicable to TLS connections, and may be
-accessed using the
-
-
-
-Other platform specific options may be available as well. -
-
-SEE ALSO- -
- nng_tls(7) Manual Page+nng_tls(7)+NAME
+
-nng_tls - TLS transport
+
SYNOPSIS
-
DESCRIPTION
- + (transport, tls) The tls transport provides communication support between -nng sockets across a TCP/IP network using +peers across a TCP/IP network using TLS v1.2 on top of TCP. Both IPv4 and IPv6 are supported when the underlying platform also supports it. @@ -418,7 +62,7 @@ or later is required.
Applications may need to add this library (or libraries) to
their link line, particularly when using a statically built
-nng library.
+library.
|
|
-This transport uses URIs using the scheme tls+tcp://, followed by
+
(URI, tls+tcp://)
+This transport uses URIs using the scheme tls+tcp://, followed by
an IP address or hostname, followed by a colon and finally a
TCP port number.
For example, to contact port 4433 on the localhost
-either of the following URIs could be used: tls+tcp://127.0.0.1:4433 or
-tls+tcp://localhost:4433.
tls+tcp://127.0.0.1:4433 or
+tls+tcp://localhost:4433.
A URI may be restricted to IPv6 using the scheme tls+tcp6://, and may
-be restricted to IPv4 using the scheme tls+tcp4://.
A URI may be restricted to IPv6 using the scheme tls+tcp6://, and may
+be restricted to IPv4 using the scheme tls+tcp4://.
-Specifying tls+tcp6:// may not prevent IPv4 hosts from being used with
+Specifying tls+tcp6:// may not prevent IPv4 hosts from being used with
IPv4-in-IPv6 addresses, particularly when using a wildcard hostname with
listeners.
The details of this varies across operating systems.
@@ -478,7 +122,7 @@ The details of this varies across operating systems.
|
-Both tls+tcp6:// and tls+tcp4:// are nng extensions, and may not
+Both tls+tcp6:// and tls+tcp4:// are specific to NNG, and may not
be understood by other implementations.
|
@@ -503,8 +147,8 @@ square brackets (
NNG_OPT_TLS_SERVER_NAMENNG_OPT_TLS_SERVER_NAME(string) This write-only option is used to specify the name of the server. @@ -473,7 +117,7 @@ indication, which is used as a hint by a multihosting server to choose the appropriate certificate to provide) and also is used to validate the name presented in the server’s x509 certificate.
NNG_OPT_TLS_VERIFIEDNNG_OPT_TLS_VERIFIED(bool)
This read-only option indicates whether the remote peer has been properly verified using TLS
@@ -492,16 +136,16 @@ when appropriate for the context:
nng_tls_register - register tls transport
#include <nng/transport/tls/tls.h>
-
+#include <nng/transport/tls/tls.h>
+
int nng_tls_register(void);
The nng_tls_register() function registers the
-tls transport for use.
nng_url - Universal Resource Locator object
+#include <nng/nng.h>
+
+typedef struct nng_url {
+ char *u_rawurl;
+ char *u_scheme;
+ char *u_userinfo;
+ char *u_host;
+ char *u_hostname;
+ char *u_port;
+ char *u_path;
+ char *u_query;
+ char *u_fragment;
+ char *u_requri;
+} nng_url;
+An nng_url is a structure used for
+representing URLs.
+These structures are created by parsing string formatted URLs with
+nng_url_parse().
Applications may access individual fields, but must not free or +alter them, as the underlying memory is managed by the library.
+The fields are as follows:
+
+u_rawurl
+ |
+
+ The unparsed URL string. This will never be |
+
+u_scheme
+ |
+
+ The URL scheme, such as "http" or "inproc". Always lower case. This will never be |
+
+u_userinfo
+ |
+
+ This username and password if supplied in the URL string. Will be |
+
+u_host
+ |
+
+ The full host part of the URL, including the port if present (separated by a colon.) + |
+
+u_hostname
+ |
+
+ The name of the host, and may be the empty string in some cases. + |
+
+u_port
+ |
+
+ The port. May be empty if irrelevant or not specified. + |
+
+u_path
+ |
+
+ The path, typically used with HTTP or WebSockets. Will be empty string if not specified. + |
+
+u_query
+ |
+
+ The query info (typically following |
+
+u_fragment
+ |
+
+ This is used for specifying an anchor, the part after |
+
+u_requri
+ |
+
+ The full Request-URI (path[?query][#fragment]). Will be the empty string if not specified. + |
+
| + + | ++Other fields may also be present, but only those documented here are safe for application use. + | +
| + + | ++More information about Universal Resource Locators can be found in +RFC 3986. + | +
nng_url_clone - clone URL structure
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_url_clone(nng_url **dup, nng_url *orig);
The new
+nng_url structure can be disposed of
+using
+nng_url_free() when it is no longer needed.
nng_url_free(3), nng_url_parse(3), nng_strerror(3), +nng_url(5), nng(7)
nng_url_free - free a URL structure
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
void nng_url_free(nng_url *url);
nng_url_parse - create URL structure from a string
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
int nng_url_parse(nng_url **urlp, const char *str);
The nng_url_parse() function parses the string str containing an
RFC 3986 compliant URL, and creates
-a structure containing the results. A pointer to the resulting structure
-is stored in urlp.
nng_url structure containing the results.
+A pointer to the resulting structure is stored in urlp.
The nng_url structure has at least the following members:
struct nng_url {
-char *u_rawurl; // Unparsed URL, with minimal canonicalization.
-char *u_scheme; // Scheme, such as "http"; always lower case.
-char *u_userinfo; // Userinfo component, or NULL.
-char *u_host; // Full host, including port if present.
-char *u_hostname; // Hostname only (or address), or empty string.
-char *u_port; // Port number, may be default or empty string.
-char *u_path; // Path if present, empty string otherwise.
-char *u_query; // Query info if present, NULL otherwise.
-char *u_fragment; // Fragment if present, NULL otherwise.
-char *u_requri; // Request-URI (path[?query][#fragment])
-};
-The structure may disposed of when no longer needed by calling
+nng_url_free().
The u_scheme, u_hostname, u_host, and u_port members are
-converted to lower case.
Percent-encoded values for -unreserved characters -converted to their unencoded forms.
+ unreserved characters + converted to their unencoded forms.Additionally URL percent-encoded values for characters in the path -and with numeric values larger than 127 (i.e. not ASCII) are decoded.
+ and with numeric values larger than 127 (i.e. not ASCII) are decoded.The resulting u_path is checked for invalid UTF-8 sequences, consisting
-of surrogate pairs, illegal byte sequences, or overlong encodings.
-If this check fails, then the entire URL is considered invalid, and
-the function returns NNG_EINVAL.
NNG_EINVAL.
Path segments consisting of . and .. are resolved as per
-RFC 3986 6.2.2.3.
Further, empty path segments are removed, meaning that duplicate
-slash (/) separators are removed from the path.
/) separators are removed from the path.
If a port was not specified, but the scheme defines a default
-port, then u_port will be filled in with the value of the default port.
u_port will be filled in with the value of the default port.
u_port will be filled in with the value of the default p
u_userinfo, u_query, and u_fragment members will ever be
-NULL. The other members will be filled in with either default values
-or the empty string if they cannot be determined from str.
+ NULL. The other members will be filled in with either default values
+ or the empty string if they cannot be determined from str.
nng_url_clone(3), nng_url_free(3), nng_strerror(3), +nng_url(5), nng(7)
nng_version - report library version
#include <nng/nng.h>
-
+#include <nng/nng.h>
+
const char * nng_version(void);
The nng_version() function returns a human readable version number
-for the nng library.
-This is intended for output in programs, and so forth.
Additionally, compile time version information is available via some predefined macros:
NNG_MAJOR_VERSION
+NNG_MAJOR_VERSION
+ |
+
Major version number. - -NNG_MINOR_VERSION |
+
+NNG_MINOR_VERSION
+ |
+
Minor version number. - -NNG_PATCH_VERSION |
+
+NNG_PATCH_VERSION
+ |
+
Patch version number. - - + |
+
The nng library is developed and released using +
NNG is developed and released using Semantic Versioning 2.0, and the version numbers reported refer to both the API and the library itself. -(The ABI — application binary interface — between the +(The ABI -- application binary interface -- between the library and the application is controlled in a similar, but different manner depending upon the link options and how the library is built.)
C string (NUL-terminated) containing the library version number.
Null-terminated string containing the library version number.
nng_ws - WebSocket transport
#include <nng/transport/websocket/ws.h>
-
+#include <nng/transport/websocket/ws.h>
+
int nng_ws_register(void);
int nng_wss_register(void);
+
(transport, ws and wss) The ws transport provides communication support between -nng sockets across a TCP/IP network using +peers across a TCP/IP network using WebSockets. Both IPv4 and IPv6 are supported when the underlying platform also supports it.
nng_wss_register() functi
+
(URI, ws://)
This transport uses URIs using the scheme ws://, followed by
an IP address or hostname, optionally followed by a colon and an
TCP port number, optionally followed by a path.
@@ -419,7 +63,7 @@ For example, the URI ws://localhost/app/pubsub would use
port 80 on localhost, with the path /app/pubsub.
Secure WebSockets +
Secure WebSockets (URI, wss://)
(if enabled) use the scheme wss://, and the default TCP port number of 443.
Otherwise the format is the same as for regular WebSockets.
This transport makes use of shared HTTP server +
This transport makes use of shared HTTP server instances, permitting multiple sockets or listeners to be configured with the same hostname and port. When creating a new listener, it is registered with an existing HTTP server @@ -595,5 +239,3 @@ May return incorrect results if peer authentication is disabled.
nng_ws_register - register WebSocket transport
#include <nng/transport/websocket/ws.h>
-
+#include <nng/transport/websocket/ws.h>
+
int nng_ws_register(void);
The nng_ws_register() function registers the
-ws transport for use.
nng_wss_register - register WebSocket secure transport
#include <nng/transport/websocket/ws.h>
-
+#include <nng/transport/websocket/ws.h>
+
int nng_wss_register(void);
The nng_wss_register() function registers the
-wss transport for use.
nng_zerotier - ZeroTier transport
#include <nng/transport/zerotier/zerotier.h>
-
+#include <nng/transport/zerotier/zerotier.h>
+
int nng_zt_register(void);
+
(transport, zt) The zt transport provides communication support for -nng applications over a ZeroTier network, +NNG applications over a ZeroTier network, using a Virtual Layer 2 packet facility.
libzerotiercore library at present is covered under different
-license terms than the rest of nng. Please be careful to review
+license terms than the rest of NNG. Please be careful to review
and adhere to the licensing terms.
+
(URI, zt://)
This transport uses URIs using the scheme zt://, followed by a node
number (ten hexadecimal digits) followed by a . delimited, and then
a network address (sixteen hexadecimal digits), followed by a colon (:)
@@ -502,7 +146,7 @@ the actual structure is of type
By default this transport creates an "ephemeral" node, and used the +
By default this transport creates an "ephemeral" node, and used the same ephemeral node for any additional endpoints created. As this node is ephemeral, the keys associated with it and all associated data are located in memory and are discarded upon application termination. @@ -516,8 +160,7 @@ using the same node, or using separate nodes.
-A ZeroTier node can be in one of the following states, which can be obtained +
A ZeroTier node can be in one of the following states, which can be obtained
with the NNG_OPT_ZT_NETWORK_STATUS option:
NNG_OPT_ZT_HOME(string) This option represents the “home directory”, where the transport -can store (and reuse) persistent state, such as key materials, node -identity, and federation membership. -This option must be set before the ZeroTier transport is first used. -If this value is empty, then an ephemeral ZeroTier node is created, -and no persistent state is used. -The default is to use an ephemeral node.
+(string) This option represents the home directory, where the transport + can store (and reuse) persistent state, such as key materials, node + identity, and federation membership. + This option must be set before the ZeroTier transport is first used. + If this value is empty, then an ephemeral ZeroTier node is created, + and no persistent state is used. + The default is to use an ephemeral node.
| -While legacy nanocat only supported one peer, nng can support +While legacy nanocat only supported one peer, nngcat can support more than one peer on a given connection. |