kschiess.bitbucket.org / nanomsg / pair.html

<!DOCTYPE html><html><head><title>nanomsg (Ruby)</title><meta content="width=device-width, initial-scale=1.0" name="viewport" /><link href="stylesheets/bootstrap.min.css" media="screen" rel="stylesheet" type="text/css" /><link href="stylesheets/bootstrap-theme.min.css" media="screen" rel="stylesheet" type="text/css" /><link href="stylesheets/code.css" media="screen" rel="stylesheet" type="text/css" /><link href="stylesheets/nanomsg.css" media="screen" rel="stylesheet" type="text/css" /><script src="javascripts/bootstrap.min.js" type="text/javascript"></script></head><body><div class="container menu"><div class="row"><div class="col-md-2 menu-item"><a href="/">ABOUT</a></div></div><div class="row"><div class="col-md-2 menu-item active">PAIR</div><div class="col-md-2 menu-item">REQ/REP</div><div class="col-md-2 menu-item">PUB/SUB</div><div class="col-md-2 menu-item">SURVEY/RESPOND</div><div class="col-md-2 menu-item">PUSH/PULL</div><div class="col-md-2 menu-item">BUS</div></div><div class="row"><div class="col-md-2 menu-item">DOCUMENTATION</div><div class="col-md-2 menu-item">CONTRIB</div></div><div class="row"><div class="schema"><img src="images/pair.png" /></div><div class="caption">Messages travel both ways. 
No order or protocol imposed.</div></div><div class="row text"><div class="col-md-6 sample"><pre class="highlight ruby"><span class="nb">require</span> <span class="s1">'nanomsg'</span>

<span class="n">socket</span> <span class="o">=</span> <span class="no">NanoMsg</span><span class="o">::</span><span class="no">PairSocket</span><span class="nf">.new</span>
<span class="n">socket</span><span class="nf">.connect</span> <span class="s1">'inproc://b'</span>
<span class="n">socket</span><span class="nf">.send</span> <span class="s1">'m1'</span>
</pre></div><div class="col-md-6 sample"><pre class="highlight ruby"><span class="nb">require</span> <span class="s1">'nanomsg'</span>

<span class="n">socket</span> <span class="o">=</span> <span class="no">NanoMsg</span><span class="o">::</span><span class="no">PairSocket</span><span class="nf">.new</span>
<span class="n">socket</span><span class="nf">.bind</span> <span class="s1">'inproc://b'</span>
<span class="n">socket</span><span class="nf">.recv</span> <span class="c1"># =&gt; 'm1'</span>
</pre></div></div></div></body></html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.