~ubuntu-branches/ubuntu/precise/zeromq/precise

« back to all changes in this revision

Viewing changes to doc/zmq_setsockopt.html

  • Committer: Bazaar Package Importer
  • Author(s): Martin Lucina
  • Date: 2011-05-13 12:43:09 UTC
  • mfrom: (7.2.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110513124309-m3gdt964ga67rcwu
Tags: 2.1.7-1
* New upstream version. (closes: #619374)
* --with-system-pgm is now used instead of the embedded OpenPGM library. 
* Added Debian watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
583
583
<h2 id="_synopsis">SYNOPSIS</h2>
584
584
<div class="sectionbody">
585
585
<div class="paragraph"><p><strong>int zmq_setsockopt (void <em>*socket</em>, int <em>option_name</em>, const void <em>*option_value</em>, size_t <em>option_len</em>);</strong></p></div>
 
586
<div class="paragraph"><p>Caution: All options, with the exception of ZMQ_SUBSCRIBE, ZMQ_UNSUBSCRIBE and
 
587
ZMQ_LINGER, only take effect for subsequent socket bind/connects.</p></div>
586
588
</div>
587
589
<h2 id="_description">DESCRIPTION</h2>
588
590
<div class="sectionbody">
760
762
</table></div>
761
763
<h3 id="_zmq_identity_set_socket_identity">ZMQ_IDENTITY: Set socket identity</h3><div style="clear:left"></div>
762
764
<div class="paragraph"><p>The <em>ZMQ_IDENTITY</em> option shall set the identity of the specified <em>socket</em>.
763
 
Socket identity determines if existing ØMQ infastructure (<em>message queues</em>,
 
765
Socket identity determines if existing ØMQ infrastructure (<em>message queues</em>,
764
766
<em>forwarding devices</em>) shall be identified with a specific application and
765
767
persist across multiple runs of the application.</p></div>
766
768
<div class="paragraph"><p>If the socket has no identity, each run of an application is completely
822
824
therefore you should call this option to establish an initial message filter.</p></div>
823
825
<div class="paragraph"><p>An empty <em>option_value</em> of length zero shall subscribe to all incoming
824
826
messages. A non-empty <em>option_value</em> shall subscribe to all messages beginning
825
 
with the specified prefix. Mutiple filters may be attached to a single
 
827
with the specified prefix. Multiple filters may be attached to a single
826
828
<em>ZMQ_SUB</em> socket, in which case a message shall be accepted if it matches at
827
829
least one filter.</p></div>
828
830
<div class="hdlist"><table>
982
984
<td class="icon">
983
985
<div class="title">Caution</div>
984
986
</td>
985
 
<td class="content">Excersize care when setting large recovery intervals as the data
 
987
<td class="content">Exercise care when setting large recovery intervals as the data
986
988
needed for recovery will be held in memory. For example, a 1 minute recovery
987
989
interval at a data rate of 1Gbps requires a 7GB in-memory buffer.</td>
988
990
</tr></table>
1033
1035
</td>
1034
1036
</tr>
1035
1037
</table></div>
1036
 
<h3 id="_zmq_mcast_loop_control_multicast_loopback">ZMQ_MCAST_LOOP: Control multicast loopback</h3><div style="clear:left"></div>
 
1038
<h3 id="_zmq_recovery_ivl_msec_set_multicast_recovery_interval_in_milliseconds">ZMQ_RECOVERY_IVL_MSEC: Set multicast recovery interval in milliseconds</h3><div style="clear:left"></div>
 
1039
<div class="paragraph"><p>The <em>ZMQ_RECOVERY_IVL_MSEC</em> option shall set the recovery interval, specified
 
1040
in milliseconds (ms) for multicast transports using the specified <em>socket</em>.
 
1041
The recovery interval determines the maximum time in milliseconds that a
 
1042
receiver can be absent from a multicast group before unrecoverable data loss
 
1043
will occur.</p></div>
 
1044
<div class="paragraph"><p>A non-zero value of the <em>ZMQ_RECOVERY_IVL_MSEC</em> option will take precedence
 
1045
over the <em>ZMQ_RECOVERY_IVL</em> option, but since the default for the
 
1046
<em>ZMQ_RECOVERY_IVL_MSEC</em> is -1, the default is to use the <em>ZMQ_RECOVERY_IVL</em>
 
1047
option value.</p></div>
 
1048
<div class="admonitionblock">
 
1049
<table><tr>
 
1050
<td class="icon">
 
1051
<div class="title">Caution</div>
 
1052
</td>
 
1053
<td class="content">Exercise care when setting large recovery intervals as the data
 
1054
needed for recovery will be held in memory. For example, a 1 minute recovery
 
1055
interval at a data rate of 1Gbps requires a 7GB in-memory buffer.</td>
 
1056
</tr></table>
 
1057
</div>
 
1058
<div class="hdlist"><table>
 
1059
<tr>
 
1060
<td class="hdlist1">
 
1061
Option value type
 
1062
<br />
 
1063
</td>
 
1064
<td class="hdlist2">
 
1065
<p style="margin-top: 0;">
 
1066
int64_t
 
1067
</p>
 
1068
</td>
 
1069
</tr>
 
1070
<tr>
 
1071
<td class="hdlist1">
 
1072
Option value unit
 
1073
<br />
 
1074
</td>
 
1075
<td class="hdlist2">
 
1076
<p style="margin-top: 0;">
 
1077
milliseconds
 
1078
</p>
 
1079
</td>
 
1080
</tr>
 
1081
<tr>
 
1082
<td class="hdlist1">
 
1083
Default value
 
1084
<br />
 
1085
</td>
 
1086
<td class="hdlist2">
 
1087
<p style="margin-top: 0;">
 
1088
-1
 
1089
</p>
 
1090
</td>
 
1091
</tr>
 
1092
<tr>
 
1093
<td class="hdlist1">
 
1094
Applicable socket types
 
1095
<br />
 
1096
</td>
 
1097
<td class="hdlist2">
 
1098
<p style="margin-top: 0;">
 
1099
all, when using multicast transports
 
1100
</p>
 
1101
</td>
 
1102
</tr>
 
1103
</table></div>
 
1104
<h3 id="_zmq_mcast_loop_control_multicast_loop_back">ZMQ_MCAST_LOOP: Control multicast loop-back</h3><div style="clear:left"></div>
1037
1105
<div class="paragraph"><p>The <em>ZMQ_MCAST_LOOP</em> option shall control whether data sent via multicast
1038
1106
transports using the specified <em>socket</em> can also be received by the sending
1039
 
host via loopback. A value of zero disables the loopback functionality, while
1040
 
the default value of 1 enables the loopback functionality. Leaving multicast
1041
 
loopback enabled when it is not required can have a negative impact on
 
1107
host via loop-back. A value of zero disables the loop-back functionality, while
 
1108
the default value of 1 enables the loop-back functionality. Leaving multicast
 
1109
loop-back enabled when it is not required can have a negative impact on
1042
1110
performance. Where possible, disable <em>ZMQ_MCAST_LOOP</em> in production
1043
1111
environments.</p></div>
1044
1112
<div class="hdlist"><table>
1189
1257
</td>
1190
1258
</tr>
1191
1259
</table></div>
 
1260
<h3 id="_zmq_linger_set_linger_period_for_socket_shutdown">ZMQ_LINGER: Set linger period for socket shutdown</h3><div style="clear:left"></div>
 
1261
<div class="paragraph"><p>The <em>ZMQ_LINGER</em> option shall set the linger period for the specified <em>socket</em>.
 
1262
The linger period determines how long pending messages which have yet to be
 
1263
sent to a peer shall linger in memory after a socket is closed with
 
1264
<a href="zmq_close.html">zmq_close(3)</a>, and further affects the termination of the socket&#8217;s
 
1265
context with <a href="zmq_term.html">zmq_term(3)</a>. The following outlines the different
 
1266
behaviours:</p></div>
 
1267
<div class="ulist"><ul>
 
1268
<li>
 
1269
<p>
 
1270
The default value of <em>-1</em> specifies an infinite linger period. Pending
 
1271
  messages shall not be discarded after a call to <em>zmq_close()</em>; attempting to
 
1272
  terminate the socket&#8217;s context with <em>zmq_term()</em> shall block until all
 
1273
  pending messages have been sent to a peer.
 
1274
</p>
 
1275
</li>
 
1276
<li>
 
1277
<p>
 
1278
The value of <em>0</em> specifies no linger period. Pending messages shall be
 
1279
  discarded immediately when the socket is closed with <em>zmq_close()</em>.
 
1280
</p>
 
1281
</li>
 
1282
<li>
 
1283
<p>
 
1284
Positive values specify an upper bound for the linger period in milliseconds.
 
1285
  Pending messages shall not be discarded after a call to <em>zmq_close()</em>;
 
1286
  attempting to terminate the socket&#8217;s context with <em>zmq_term()</em> shall block
 
1287
  until either all pending messages have been sent to a peer, or the linger
 
1288
  period expires, after which any pending messages shall be discarded.
 
1289
</p>
 
1290
<div class="hdlist"><table>
 
1291
<tr>
 
1292
<td class="hdlist1">
 
1293
Option value type
 
1294
<br />
 
1295
</td>
 
1296
<td class="hdlist2">
 
1297
<p style="margin-top: 0;">
 
1298
int
 
1299
</p>
 
1300
</td>
 
1301
</tr>
 
1302
<tr>
 
1303
<td class="hdlist1">
 
1304
Option value unit
 
1305
<br />
 
1306
</td>
 
1307
<td class="hdlist2">
 
1308
<p style="margin-top: 0;">
 
1309
milliseconds
 
1310
</p>
 
1311
</td>
 
1312
</tr>
 
1313
<tr>
 
1314
<td class="hdlist1">
 
1315
Default value
 
1316
<br />
 
1317
</td>
 
1318
<td class="hdlist2">
 
1319
<p style="margin-top: 0;">
 
1320
-1 (infinite)
 
1321
</p>
 
1322
</td>
 
1323
</tr>
 
1324
<tr>
 
1325
<td class="hdlist1">
 
1326
Applicable socket types
 
1327
<br />
 
1328
</td>
 
1329
<td class="hdlist2">
 
1330
<p style="margin-top: 0;">
 
1331
all
 
1332
</p>
 
1333
</td>
 
1334
</tr>
 
1335
</table></div>
 
1336
</li>
 
1337
</ul></div>
 
1338
<h3 id="_zmq_reconnect_ivl_set_reconnection_interval">ZMQ_RECONNECT_IVL: Set reconnection interval</h3><div style="clear:left"></div>
 
1339
<div class="paragraph"><p>The <em>ZMQ_RECONNECT_IVL</em> option shall set the initial reconnection interval for
 
1340
the specified <em>socket</em>.  The reconnection interval is the period ØMQ
 
1341
shall wait between attempts to reconnect disconnected peers when using
 
1342
connection-oriented transports.</p></div>
 
1343
<div class="admonitionblock">
 
1344
<table><tr>
 
1345
<td class="icon">
 
1346
<div class="title">Note</div>
 
1347
</td>
 
1348
<td class="content">The reconnection interval may be randomized by ØMQ to prevent
 
1349
reconnection storms in topologies with a large number of peers per socket.</td>
 
1350
</tr></table>
 
1351
</div>
 
1352
<div class="hdlist"><table>
 
1353
<tr>
 
1354
<td class="hdlist1">
 
1355
Option value type
 
1356
<br />
 
1357
</td>
 
1358
<td class="hdlist2">
 
1359
<p style="margin-top: 0;">
 
1360
int
 
1361
</p>
 
1362
</td>
 
1363
</tr>
 
1364
<tr>
 
1365
<td class="hdlist1">
 
1366
Option value unit
 
1367
<br />
 
1368
</td>
 
1369
<td class="hdlist2">
 
1370
<p style="margin-top: 0;">
 
1371
milliseconds
 
1372
</p>
 
1373
</td>
 
1374
</tr>
 
1375
<tr>
 
1376
<td class="hdlist1">
 
1377
Default value
 
1378
<br />
 
1379
</td>
 
1380
<td class="hdlist2">
 
1381
<p style="margin-top: 0;">
 
1382
100
 
1383
</p>
 
1384
</td>
 
1385
</tr>
 
1386
<tr>
 
1387
<td class="hdlist1">
 
1388
Applicable socket types
 
1389
<br />
 
1390
</td>
 
1391
<td class="hdlist2">
 
1392
<p style="margin-top: 0;">
 
1393
all, only for connection-oriented transports
 
1394
</p>
 
1395
</td>
 
1396
</tr>
 
1397
</table></div>
 
1398
<h3 id="_zmq_reconnect_ivl_max_set_maximum_reconnection_interval">ZMQ_RECONNECT_IVL_MAX: Set maximum reconnection interval</h3><div style="clear:left"></div>
 
1399
<div class="paragraph"><p>The <em>ZMQ_RECONNECT_IVL_MAX</em> option shall set the maximum reconnection interval
 
1400
for the specified <em>socket</em>.  This is the maximum period ØMQ shall wait between
 
1401
attempts to reconnect. On each reconnect attempt, the previous interval shall be
 
1402
doubled untill ZMQ_RECONNECT_IVL_MAX is reached. This allows for exponential
 
1403
backoff strategy. Default value means no exponential backoff is performed and
 
1404
reconnect interval calculations are only based on ZMQ_RECONNECT_IVL.</p></div>
 
1405
<div class="admonitionblock">
 
1406
<table><tr>
 
1407
<td class="icon">
 
1408
<div class="title">Note</div>
 
1409
</td>
 
1410
<td class="content">Values less than ZMQ_RECONNECT_IVL will be ignored.</td>
 
1411
</tr></table>
 
1412
</div>
 
1413
<div class="hdlist"><table>
 
1414
<tr>
 
1415
<td class="hdlist1">
 
1416
Option value type
 
1417
<br />
 
1418
</td>
 
1419
<td class="hdlist2">
 
1420
<p style="margin-top: 0;">
 
1421
int
 
1422
</p>
 
1423
</td>
 
1424
</tr>
 
1425
<tr>
 
1426
<td class="hdlist1">
 
1427
Option value unit
 
1428
<br />
 
1429
</td>
 
1430
<td class="hdlist2">
 
1431
<p style="margin-top: 0;">
 
1432
milliseconds
 
1433
</p>
 
1434
</td>
 
1435
</tr>
 
1436
<tr>
 
1437
<td class="hdlist1">
 
1438
Default value
 
1439
<br />
 
1440
</td>
 
1441
<td class="hdlist2">
 
1442
<p style="margin-top: 0;">
 
1443
0 (only use ZMQ_RECONNECT_IVL)
 
1444
</p>
 
1445
</td>
 
1446
</tr>
 
1447
<tr>
 
1448
<td class="hdlist1">
 
1449
Applicable socket types
 
1450
<br />
 
1451
</td>
 
1452
<td class="hdlist2">
 
1453
<p style="margin-top: 0;">
 
1454
all, only for connection-oriented transports
 
1455
</p>
 
1456
</td>
 
1457
</tr>
 
1458
</table></div>
 
1459
<h3 id="_zmq_backlog_set_maximum_length_of_the_queue_of_outstanding_connections">ZMQ_BACKLOG: Set maximum length of the queue of outstanding connections</h3><div style="clear:left"></div>
 
1460
<div class="paragraph"><p>The <em>ZMQ_BACKLOG</em> option shall set the maximum length of the queue of
 
1461
outstanding peer connections for the specified <em>socket</em>; this only applies to
 
1462
connection-oriented transports. For details refer to your operating system
 
1463
documentation for the <em>listen</em> function.</p></div>
 
1464
<div class="hdlist"><table>
 
1465
<tr>
 
1466
<td class="hdlist1">
 
1467
Option value type
 
1468
<br />
 
1469
</td>
 
1470
<td class="hdlist2">
 
1471
<p style="margin-top: 0;">
 
1472
int
 
1473
</p>
 
1474
</td>
 
1475
</tr>
 
1476
<tr>
 
1477
<td class="hdlist1">
 
1478
Option value unit
 
1479
<br />
 
1480
</td>
 
1481
<td class="hdlist2">
 
1482
<p style="margin-top: 0;">
 
1483
connections
 
1484
</p>
 
1485
</td>
 
1486
</tr>
 
1487
<tr>
 
1488
<td class="hdlist1">
 
1489
Default value
 
1490
<br />
 
1491
</td>
 
1492
<td class="hdlist2">
 
1493
<p style="margin-top: 0;">
 
1494
100
 
1495
</p>
 
1496
</td>
 
1497
</tr>
 
1498
<tr>
 
1499
<td class="hdlist1">
 
1500
Applicable socket types
 
1501
<br />
 
1502
</td>
 
1503
<td class="hdlist2">
 
1504
<p style="margin-top: 0;">
 
1505
all, only for connection-oriented transports.
 
1506
</p>
 
1507
</td>
 
1508
</tr>
 
1509
</table></div>
1192
1510
</div>
1193
1511
<h2 id="_return_value">RETURN VALUE</h2>
1194
1512
<div class="sectionbody">
1216
1534
</p>
1217
1535
</dd>
1218
1536
<dt class="hdlist1">
1219
 
<strong>EFAULT</strong>
1220
 
</dt>
1221
 
<dd>
1222
 
<p>
1223
 
The provided <em>socket</em> was not valid (NULL).
 
1537
<strong>ENOTSOCK</strong>
 
1538
</dt>
 
1539
<dd>
 
1540
<p>
 
1541
The provided <em>socket</em> was invalid.
 
1542
</p>
 
1543
</dd>
 
1544
<dt class="hdlist1">
 
1545
<strong>EINTR</strong>
 
1546
</dt>
 
1547
<dd>
 
1548
<p>
 
1549
The operation was interrupted by delivery of a signal.
1224
1550
</p>
1225
1551
</dd>
1226
1552
</dl></div>
1262
1588
</div>
1263
1589
<h2 id="_authors">AUTHORS</h2>
1264
1590
<div class="sectionbody">
1265
 
<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
 
1591
<div class="paragraph"><p>This ØMQ manual page was written by Martin Sustrik &lt;<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>&gt; and
1266
1592
Martin Lucina &lt;<a href="mailto:mato@kotelna.sk">mato@kotelna.sk</a>&gt;.</p></div>
1267
1593
</div>
1268
1594
</div>
1269
1595
<div id="footnotes"><hr /></div>
1270
1596
<div id="footer">
1271
1597
<div id="footer-text">
1272
 
ØMQ 2.0.10<br />
1273
 
Last updated 2010-10-15 19:40:36 CEST
 
1598
ØMQ 2.1.6<br />
 
1599
Last updated 2011-05-07 07:13:32 CEST
1274
1600
</div>
1275
1601
</div>
1276
1602
</body>