~ubuntu-branches/ubuntu/saucy/zeromq3/saucy

« back to all changes in this revision

Viewing changes to doc/zmq_poll.html

  • Committer: Package Import Robot
  • Author(s): Alessandro Ghedini
  • Date: 2012-06-04 21:21:09 UTC
  • Revision ID: package-import@ubuntu.com-20120604212109-b7b3m0rn21o8oo2q
Tags: upstream-3.1.0~beta+dfsg
Import upstream version 3.1.0~beta+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
 
2
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 
3
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 
4
<head>
 
5
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
 
6
<meta name="generator" content="AsciiDoc 8.6.3" />
 
7
<title>zmq_poll(3)</title>
 
8
<style type="text/css">
 
9
/* Sans-serif font. */
 
10
h1, h2, h3, h4, h5, h6,
 
11
div.title, caption.title,
 
12
thead, p.table.header,
 
13
div#toctitle,
 
14
span#author, span#revnumber, span#revdate, span#revremark,
 
15
div#footer {
 
16
  font-family: Arial,Helvetica,sans-serif;
 
17
}
 
18
 
 
19
/* Serif font. */
 
20
div.sectionbody {
 
21
  font-family: Georgia,"Times New Roman",Times,serif;
 
22
}
 
23
 
 
24
/* Monospace font. */
 
25
tt {
 
26
  font-size: inherit;
 
27
}
 
28
 
 
29
body {
 
30
  margin: 1em 5% 1em 5%;
 
31
}
 
32
 
 
33
a {
 
34
  color: blue;
 
35
  text-decoration: underline;
 
36
}
 
37
a:visited {
 
38
  color: fuchsia;
 
39
}
 
40
 
 
41
em {
 
42
  font-style: italic;
 
43
  color: navy;
 
44
}
 
45
 
 
46
strong {
 
47
  font-weight: bold;
 
48
  color: #083194;
 
49
}
 
50
 
 
51
tt {
 
52
  font-size: inherit;
 
53
  color: navy;
 
54
}
 
55
 
 
56
h1, h2, h3, h4, h5, h6 {
 
57
  color: #527bbd;
 
58
  margin-top: 1.2em;
 
59
  margin-bottom: 0.5em;
 
60
  line-height: 1.3;
 
61
}
 
62
 
 
63
h1, h2, h3 {
 
64
  border-bottom: 2px solid silver;
 
65
}
 
66
h2 {
 
67
  padding-top: 0.5em;
 
68
}
 
69
h3 {
 
70
  float: left;
 
71
}
 
72
h3 + * {
 
73
  clear: left;
 
74
}
 
75
 
 
76
div.sectionbody {
 
77
  margin-left: 0;
 
78
}
 
79
 
 
80
hr {
 
81
  border: 1px solid silver;
 
82
}
 
83
 
 
84
p {
 
85
  margin-top: 0.5em;
 
86
  margin-bottom: 0.5em;
 
87
}
 
88
 
 
89
ul, ol, li > p {
 
90
  margin-top: 0;
 
91
}
 
92
ul > li     { color: #aaa; }
 
93
ul > li > * { color: black; }
 
94
 
 
95
pre {
 
96
  padding: 0;
 
97
  margin: 0;
 
98
}
 
99
 
 
100
span#author {
 
101
  color: #527bbd;
 
102
  font-weight: bold;
 
103
  font-size: 1.1em;
 
104
}
 
105
span#email {
 
106
}
 
107
span#revnumber, span#revdate, span#revremark {
 
108
}
 
109
 
 
110
div#footer {
 
111
  font-size: small;
 
112
  border-top: 2px solid silver;
 
113
  padding-top: 0.5em;
 
114
  margin-top: 4.0em;
 
115
}
 
116
div#footer-text {
 
117
  float: left;
 
118
  padding-bottom: 0.5em;
 
119
}
 
120
div#footer-badges {
 
121
  float: right;
 
122
  padding-bottom: 0.5em;
 
123
}
 
124
 
 
125
div#preamble {
 
126
  margin-top: 1.5em;
 
127
  margin-bottom: 1.5em;
 
128
}
 
129
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
 
130
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
 
131
div.admonitionblock {
 
132
  margin-top: 1.0em;
 
133
  margin-bottom: 1.5em;
 
134
}
 
135
div.admonitionblock {
 
136
  margin-top: 2.0em;
 
137
  margin-bottom: 2.0em;
 
138
  margin-right: 10%;
 
139
  color: #606060;
 
140
}
 
141
 
 
142
div.content { /* Block element content. */
 
143
  padding: 0;
 
144
}
 
145
 
 
146
/* Block element titles. */
 
147
div.title, caption.title {
 
148
  color: #527bbd;
 
149
  font-weight: bold;
 
150
  text-align: left;
 
151
  margin-top: 1.0em;
 
152
  margin-bottom: 0.5em;
 
153
}
 
154
div.title + * {
 
155
  margin-top: 0;
 
156
}
 
157
 
 
158
td div.title:first-child {
 
159
  margin-top: 0.0em;
 
160
}
 
161
div.content div.title:first-child {
 
162
  margin-top: 0.0em;
 
163
}
 
164
div.content + div.title {
 
165
  margin-top: 0.0em;
 
166
}
 
167
 
 
168
div.sidebarblock > div.content {
 
169
  background: #ffffee;
 
170
  border: 1px solid #dddddd;
 
171
  border-left: 4px solid #f0f0f0;
 
172
  padding: 0.5em;
 
173
}
 
174
 
 
175
div.listingblock > div.content {
 
176
  border: 1px solid #dddddd;
 
177
  border-left: 5px solid #f0f0f0;
 
178
  background: #f8f8f8;
 
179
  padding: 0.5em;
 
180
}
 
181
 
 
182
div.quoteblock, div.verseblock {
 
183
  padding-left: 1.0em;
 
184
  margin-left: 1.0em;
 
185
  margin-right: 10%;
 
186
  border-left: 5px solid #f0f0f0;
 
187
  color: #777777;
 
188
}
 
189
 
 
190
div.quoteblock > div.attribution {
 
191
  padding-top: 0.5em;
 
192
  text-align: right;
 
193
}
 
194
 
 
195
div.verseblock > pre.content {
 
196
  font-family: inherit;
 
197
  font-size: inherit;
 
198
}
 
199
div.verseblock > div.attribution {
 
200
  padding-top: 0.75em;
 
201
  text-align: left;
 
202
}
 
203
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
 
204
div.verseblock + div.attribution {
 
205
  text-align: left;
 
206
}
 
207
 
 
208
div.admonitionblock .icon {
 
209
  vertical-align: top;
 
210
  font-size: 1.1em;
 
211
  font-weight: bold;
 
212
  text-decoration: underline;
 
213
  color: #527bbd;
 
214
  padding-right: 0.5em;
 
215
}
 
216
div.admonitionblock td.content {
 
217
  padding-left: 0.5em;
 
218
  border-left: 3px solid #dddddd;
 
219
}
 
220
 
 
221
div.exampleblock > div.content {
 
222
  border-left: 3px solid #dddddd;
 
223
  padding-left: 0.5em;
 
224
}
 
225
 
 
226
div.imageblock div.content { padding-left: 0; }
 
227
span.image img { border-style: none; }
 
228
a.image:visited { color: white; }
 
229
 
 
230
dl {
 
231
  margin-top: 0.8em;
 
232
  margin-bottom: 0.8em;
 
233
}
 
234
dt {
 
235
  margin-top: 0.5em;
 
236
  margin-bottom: 0;
 
237
  font-style: normal;
 
238
  color: navy;
 
239
}
 
240
dd > *:first-child {
 
241
  margin-top: 0.1em;
 
242
}
 
243
 
 
244
ul, ol {
 
245
    list-style-position: outside;
 
246
}
 
247
ol.arabic {
 
248
  list-style-type: decimal;
 
249
}
 
250
ol.loweralpha {
 
251
  list-style-type: lower-alpha;
 
252
}
 
253
ol.upperalpha {
 
254
  list-style-type: upper-alpha;
 
255
}
 
256
ol.lowerroman {
 
257
  list-style-type: lower-roman;
 
258
}
 
259
ol.upperroman {
 
260
  list-style-type: upper-roman;
 
261
}
 
262
 
 
263
div.compact ul, div.compact ol,
 
264
div.compact p, div.compact p,
 
265
div.compact div, div.compact div {
 
266
  margin-top: 0.1em;
 
267
  margin-bottom: 0.1em;
 
268
}
 
269
 
 
270
div.tableblock > table {
 
271
  border: 3px solid #527bbd;
 
272
}
 
273
thead, p.table.header {
 
274
  font-weight: bold;
 
275
  color: #527bbd;
 
276
}
 
277
tfoot {
 
278
  font-weight: bold;
 
279
}
 
280
td > div.verse {
 
281
  white-space: pre;
 
282
}
 
283
p.table {
 
284
  margin-top: 0;
 
285
}
 
286
/* Because the table frame attribute is overriden by CSS in most browsers. */
 
287
div.tableblock > table[frame="void"] {
 
288
  border-style: none;
 
289
}
 
290
div.tableblock > table[frame="hsides"] {
 
291
  border-left-style: none;
 
292
  border-right-style: none;
 
293
}
 
294
div.tableblock > table[frame="vsides"] {
 
295
  border-top-style: none;
 
296
  border-bottom-style: none;
 
297
}
 
298
 
 
299
 
 
300
div.hdlist {
 
301
  margin-top: 0.8em;
 
302
  margin-bottom: 0.8em;
 
303
}
 
304
div.hdlist tr {
 
305
  padding-bottom: 15px;
 
306
}
 
307
dt.hdlist1.strong, td.hdlist1.strong {
 
308
  font-weight: bold;
 
309
}
 
310
td.hdlist1 {
 
311
  vertical-align: top;
 
312
  font-style: normal;
 
313
  padding-right: 0.8em;
 
314
  color: navy;
 
315
}
 
316
td.hdlist2 {
 
317
  vertical-align: top;
 
318
}
 
319
div.hdlist.compact tr {
 
320
  margin: 0;
 
321
  padding-bottom: 0;
 
322
}
 
323
 
 
324
.comment {
 
325
  background: yellow;
 
326
}
 
327
 
 
328
.footnote, .footnoteref {
 
329
  font-size: 0.8em;
 
330
}
 
331
 
 
332
span.footnote, span.footnoteref {
 
333
  vertical-align: super;
 
334
}
 
335
 
 
336
#footnotes {
 
337
  margin: 20px 0 20px 0;
 
338
  padding: 7px 0 0 0;
 
339
}
 
340
 
 
341
#footnotes div.footnote {
 
342
  margin: 0 0 5px 0;
 
343
}
 
344
 
 
345
#footnotes hr {
 
346
  border: none;
 
347
  border-top: 1px solid silver;
 
348
  height: 1px;
 
349
  text-align: left;
 
350
  margin-left: 0;
 
351
  width: 20%;
 
352
  min-width: 100px;
 
353
}
 
354
 
 
355
div.colist td {
 
356
  padding-right: 0.5em;
 
357
  padding-bottom: 0.3em;
 
358
  vertical-align: top;
 
359
}
 
360
div.colist td img {
 
361
  margin-top: 0.3em;
 
362
}
 
363
 
 
364
@media print {
 
365
  div#footer-badges { display: none; }
 
366
}
 
367
 
 
368
div#toc {
 
369
  margin-bottom: 2.5em;
 
370
}
 
371
 
 
372
div#toctitle {
 
373
  color: #527bbd;
 
374
  font-size: 1.1em;
 
375
  font-weight: bold;
 
376
  margin-top: 1.0em;
 
377
  margin-bottom: 0.1em;
 
378
}
 
379
 
 
380
div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
 
381
  margin-top: 0;
 
382
  margin-bottom: 0;
 
383
}
 
384
div.toclevel2 {
 
385
  margin-left: 2em;
 
386
  font-size: 0.9em;
 
387
}
 
388
div.toclevel3 {
 
389
  margin-left: 4em;
 
390
  font-size: 0.9em;
 
391
}
 
392
div.toclevel4 {
 
393
  margin-left: 6em;
 
394
  font-size: 0.9em;
 
395
}
 
396
 
 
397
/* Overrides for manpage documents */
 
398
h1 {
 
399
  padding-top: 0.5em;
 
400
  padding-bottom: 0.5em;
 
401
  border-top: 2px solid silver;
 
402
  border-bottom: 2px solid silver;
 
403
}
 
404
h2 {
 
405
  border-style: none;
 
406
}
 
407
div.sectionbody {
 
408
  margin-left: 5%;
 
409
}
 
410
 
 
411
@media print {
 
412
  div#toc { display: none; }
 
413
}
 
414
 
 
415
</style>
 
416
<script type="text/javascript">
 
417
/*<![CDATA[*/
 
418
window.onload = function(){asciidoc.footnotes();}
 
419
var asciidoc = {  // Namespace.
 
420
 
 
421
/////////////////////////////////////////////////////////////////////
 
422
// Table Of Contents generator
 
423
/////////////////////////////////////////////////////////////////////
 
424
 
 
425
/* Author: Mihai Bazon, September 2002
 
426
 * http://students.infoiasi.ro/~mishoo
 
427
 *
 
428
 * Table Of Content generator
 
429
 * Version: 0.4
 
430
 *
 
431
 * Feel free to use this script under the terms of the GNU General Public
 
432
 * License, as long as you do not remove or alter this notice.
 
433
 */
 
434
 
 
435
 /* modified by Troy D. Hanson, September 2006. License: GPL */
 
436
 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
 
437
 
 
438
// toclevels = 1..4.
 
439
toc: function (toclevels) {
 
440
 
 
441
  function getText(el) {
 
442
    var text = "";
 
443
    for (var i = el.firstChild; i != null; i = i.nextSibling) {
 
444
      if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
 
445
        text += i.data;
 
446
      else if (i.firstChild != null)
 
447
        text += getText(i);
 
448
    }
 
449
    return text;
 
450
  }
 
451
 
 
452
  function TocEntry(el, text, toclevel) {
 
453
    this.element = el;
 
454
    this.text = text;
 
455
    this.toclevel = toclevel;
 
456
  }
 
457
 
 
458
  function tocEntries(el, toclevels) {
 
459
    var result = new Array;
 
460
    var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
 
461
    // Function that scans the DOM tree for header elements (the DOM2
 
462
    // nodeIterator API would be a better technique but not supported by all
 
463
    // browsers).
 
464
    var iterate = function (el) {
 
465
      for (var i = el.firstChild; i != null; i = i.nextSibling) {
 
466
        if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
 
467
          var mo = re.exec(i.tagName);
 
468
          if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
 
469
            result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
 
470
          }
 
471
          iterate(i);
 
472
        }
 
473
      }
 
474
    }
 
475
    iterate(el);
 
476
    return result;
 
477
  }
 
478
 
 
479
  var toc = document.getElementById("toc");
 
480
  var entries = tocEntries(document.getElementById("content"), toclevels);
 
481
  for (var i = 0; i < entries.length; ++i) {
 
482
    var entry = entries[i];
 
483
    if (entry.element.id == "")
 
484
      entry.element.id = "_toc_" + i;
 
485
    var a = document.createElement("a");
 
486
    a.href = "#" + entry.element.id;
 
487
    a.appendChild(document.createTextNode(entry.text));
 
488
    var div = document.createElement("div");
 
489
    div.appendChild(a);
 
490
    div.className = "toclevel" + entry.toclevel;
 
491
    toc.appendChild(div);
 
492
  }
 
493
  if (entries.length == 0)
 
494
    toc.parentNode.removeChild(toc);
 
495
},
 
496
 
 
497
 
 
498
/////////////////////////////////////////////////////////////////////
 
499
// Footnotes generator
 
500
/////////////////////////////////////////////////////////////////////
 
501
 
 
502
/* Based on footnote generation code from:
 
503
 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
 
504
 */
 
505
 
 
506
footnotes: function () {
 
507
  var cont = document.getElementById("content");
 
508
  var noteholder = document.getElementById("footnotes");
 
509
  var spans = cont.getElementsByTagName("span");
 
510
  var refs = {};
 
511
  var n = 0;
 
512
  for (i=0; i<spans.length; i++) {
 
513
    if (spans[i].className == "footnote") {
 
514
      n++;
 
515
      // Use [\s\S] in place of . so multi-line matches work.
 
516
      // Because JavaScript has no s (dotall) regex flag.
 
517
      note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
 
518
      noteholder.innerHTML +=
 
519
        "<div class='footnote' id='_footnote_" + n + "'>" +
 
520
        "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
 
521
        n + "</a>. " + note + "</div>";
 
522
      spans[i].innerHTML =
 
523
        "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
 
524
        "' title='View footnote' class='footnote'>" + n + "</a>]";
 
525
      var id =spans[i].getAttribute("id");
 
526
      if (id != null) refs["#"+id] = n;
 
527
    }
 
528
  }
 
529
  if (n == 0)
 
530
    noteholder.parentNode.removeChild(noteholder);
 
531
  else {
 
532
    // Process footnoterefs.
 
533
    for (i=0; i<spans.length; i++) {
 
534
      if (spans[i].className == "footnoteref") {
 
535
        var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
 
536
        href = href.match(/#.*/)[0];  // Because IE return full URL.
 
537
        n = refs[href];
 
538
        spans[i].innerHTML =
 
539
          "[<a href='#_footnote_" + n +
 
540
          "' title='View footnote' class='footnote'>" + n + "</a>]";
 
541
      }
 
542
    }
 
543
  }
 
544
}
 
545
 
 
546
}
 
547
/*]]>*/
 
548
</script>
 
549
</head>
 
550
<body class="manpage">
 
551
<div id="header">
 
552
<h1>
 
553
zmq_poll(3) Manual Page
 
554
</h1>
 
555
<h2>NAME</h2>
 
556
<div class="sectionbody">
 
557
<p>zmq_poll -
 
558
   input/output multiplexing
 
559
</p>
 
560
</div>
 
561
</div>
 
562
<div id="content">
 
563
<div class="sect1">
 
564
<h2 id="_synopsis">SYNOPSIS</h2>
 
565
<div class="sectionbody">
 
566
<div class="paragraph"><p><strong>int zmq_poll (zmq_pollitem_t <em>*items</em>, int <em>nitems</em>, long <em>timeout</em>);</strong></p></div>
 
567
</div>
 
568
</div>
 
569
<div class="sect1">
 
570
<h2 id="_description">DESCRIPTION</h2>
 
571
<div class="sectionbody">
 
572
<div class="paragraph"><p>The <em>zmq_poll()</em> function provides a mechanism for applications to multiplex
 
573
input/output events in a level-triggered fashion over a set of sockets. Each
 
574
member of the array pointed to by the <em>items</em> argument is a <strong>zmq_pollitem_t</strong>
 
575
structure. The <em>nitems</em> argument specifies the number of items in the <em>items</em>
 
576
array. The <strong>zmq_pollitem_t</strong> structure is defined as follows:</p></div>
 
577
<div class="literalblock">
 
578
<div class="content">
 
579
<pre><tt>typedef struct
 
580
{
 
581
    void <em>*socket</em>;
 
582
    int <em>fd</em>;
 
583
    short <em>events</em>;
 
584
    short <em>revents</em>;
 
585
} zmq_pollitem_t;</tt></pre>
 
586
</div></div>
 
587
<div class="paragraph"><p>For each <strong>zmq_pollitem_t</strong> item, <em>zmq_poll()</em> shall examine either the ØMQ
 
588
socket referenced by <em>socket</em> <strong>or</strong> the standard socket specified by the file
 
589
descriptor <em>fd</em>, for the event(s) specified in <em>events</em>. If both <em>socket</em> and
 
590
<em>fd</em> are set in a single <strong>zmq_pollitem_t</strong>, the ØMQ socket referenced by
 
591
<em>socket</em> shall take precedence and the value of <em>fd</em> shall be ignored.</p></div>
 
592
<div class="paragraph"><p>For each <strong>zmq_pollitem_t</strong> item, <em>zmq_poll()</em> shall first clear the <em>revents</em>
 
593
member, and then indicate any requested events that have occurred by setting the
 
594
bit corresponding to the event condition in the <em>revents</em> member.</p></div>
 
595
<div class="paragraph"><p>If none of the requested events have occurred on any <strong>zmq_pollitem_t</strong> item,
 
596
<em>zmq_poll()</em> shall wait <em>timeout</em> milliseconds for an event to occur on
 
597
any of the requested items. If the value of <em>timeout</em> is <tt>0</tt>, <em>zmq_poll()</em>
 
598
shall return immediately. If the value of <em>timeout</em> is <tt>-1</tt>, <em>zmq_poll()</em> shall
 
599
block indefinitely until a requested event has occurred on at least one
 
600
<strong>zmq_pollitem_t</strong>.</p></div>
 
601
<div class="paragraph"><p>The <em>events</em> and <em>revents</em> members of <strong>zmq_pollitem_t</strong> are bit masks constructed
 
602
by OR&#8217;ing a combination of the following event flags:</p></div>
 
603
<div class="dlist"><dl>
 
604
<dt class="hdlist1">
 
605
<strong>ZMQ_POLLIN</strong>
 
606
</dt>
 
607
<dd>
 
608
<p>
 
609
For ØMQ sockets, at least one message may be received from the <em>socket</em> without
 
610
blocking. For standard sockets this is equivalent to the <em>POLLIN</em> flag of the
 
611
<em>poll()</em> system call and generally means that at least one byte of data may be
 
612
read from <em>fd</em> without blocking.
 
613
</p>
 
614
</dd>
 
615
<dt class="hdlist1">
 
616
<strong>ZMQ_POLLOUT</strong>
 
617
</dt>
 
618
<dd>
 
619
<p>
 
620
For ØMQ sockets, at least one message may be sent to the <em>socket</em> without
 
621
blocking. For standard sockets this is equivalent to the <em>POLLOUT</em> flag of the
 
622
<em>poll()</em> system call and generally means that at least one byte of data may be
 
623
written to <em>fd</em> without blocking.
 
624
</p>
 
625
</dd>
 
626
<dt class="hdlist1">
 
627
<strong>ZMQ_POLLERR</strong>
 
628
</dt>
 
629
<dd>
 
630
<p>
 
631
For standard sockets, this flag is passed through <em>zmq_poll()</em> to the
 
632
underlying <em>poll()</em> system call and generally means that some sort of error
 
633
condition is present on the socket specified by <em>fd</em>. For ØMQ sockets this flag
 
634
has no effect if set in <em>events</em>, and shall never be returned in <em>revents</em> by
 
635
<em>zmq_poll()</em>.
 
636
</p>
 
637
</dd>
 
638
</dl></div>
 
639
<div class="admonitionblock">
 
640
<table><tr>
 
641
<td class="icon">
 
642
<div class="title">Note</div>
 
643
</td>
 
644
<td class="content">The <em>zmq_poll()</em> function may be implemented or emulated using operating
 
645
system interfaces other than <em>poll()</em>, and as such may be subject to the limits
 
646
of those interfaces in ways not defined in this documentation.</td>
 
647
</tr></table>
 
648
</div>
 
649
</div>
 
650
</div>
 
651
<div class="sect1">
 
652
<h2 id="_return_value">RETURN VALUE</h2>
 
653
<div class="sectionbody">
 
654
<div class="paragraph"><p>Upon successful completion, the <em>zmq_poll()</em> function shall return the number
 
655
of <strong>zmq_pollitem_t</strong> structures with events signaled in <em>revents</em> or <tt>0</tt> if no
 
656
events have been signaled. Upon failure, <em>zmq_poll()</em> shall return <tt>-1</tt> and set
 
657
<em>errno</em> to one of the values defined below.</p></div>
 
658
</div>
 
659
</div>
 
660
<div class="sect1">
 
661
<h2 id="_errors">ERRORS</h2>
 
662
<div class="sectionbody">
 
663
<div class="dlist"><dl>
 
664
<dt class="hdlist1">
 
665
<strong>ETERM</strong>
 
666
</dt>
 
667
<dd>
 
668
<p>
 
669
At least one of the members of the <em>items</em> array refers to a <em>socket</em> whose
 
670
associated ØMQ <em>context</em> was terminated.
 
671
</p>
 
672
</dd>
 
673
<dt class="hdlist1">
 
674
<strong>EFAULT</strong>
 
675
</dt>
 
676
<dd>
 
677
<p>
 
678
The provided <em>items</em> was not valid (NULL).
 
679
</p>
 
680
</dd>
 
681
<dt class="hdlist1">
 
682
<strong>EINTR</strong>
 
683
</dt>
 
684
<dd>
 
685
<p>
 
686
The operation was interrupted by delivery of a signal before any events were
 
687
available.
 
688
</p>
 
689
</dd>
 
690
</dl></div>
 
691
</div>
 
692
</div>
 
693
<div class="sect1">
 
694
<h2 id="_example">EXAMPLE</h2>
 
695
<div class="sectionbody">
 
696
<div class="listingblock">
 
697
<div class="title">Polling indefinitely for input events on both a ØMQ socket and a standard socket.</div>
 
698
<div class="content">
 
699
<pre><tt>zmq_pollitem_t items [2];
 
700
/* First item refers to 0MQ socket 'socket' */
 
701
items[0].socket = socket;
 
702
items[0].events = ZMQ_POLLIN;
 
703
/* Second item refers to standard socket 'fd' */
 
704
items[1].socket = NULL;
 
705
items[1].fd = fd;
 
706
items[1].events = ZMQ_POLLIN;
 
707
/* Poll for events indefinitely */
 
708
int rc = zmq_poll (items, 2, -1);
 
709
assert (rc &gt;= 0);
 
710
/* Returned events will be stored in items[].revents */</tt></pre>
 
711
</div></div>
 
712
</div>
 
713
</div>
 
714
<div class="sect1">
 
715
<h2 id="_see_also">SEE ALSO</h2>
 
716
<div class="sectionbody">
 
717
<div class="paragraph"><p><a href="zmq_socket.html">zmq_socket(3)</a>
 
718
<a href="zmq_send.html">zmq_send(3)</a>
 
719
<a href="zmq_recv.html">zmq_recv(3)</a>
 
720
<a href="zmq.html">zmq(7)</a></p></div>
 
721
<div class="paragraph"><p>Your operating system documentation for the <em>poll()</em> system call.</p></div>
 
722
</div>
 
723
</div>
 
724
<div class="sect1">
 
725
<h2 id="_authors">AUTHORS</h2>
 
726
<div class="sectionbody">
 
727
<div class="paragraph"><p>The ØMQ documentation was written by Martin Sustrik &lt;<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>&gt; and
 
728
Martin Lucina &lt;<a href="mailto:martin@lucina.net">martin@lucina.net</a>&gt;.</p></div>
 
729
</div>
 
730
</div>
 
731
</div>
 
732
<div id="footnotes"><hr /></div>
 
733
<div id="footer">
 
734
<div id="footer-text">
 
735
ØMQ 3.1.0<br />
 
736
Last updated 2011-12-18 11:17:56 CET
 
737
</div>
 
738
</div>
 
739
</body>
 
740
</html>