diff --git a/assets/hierarchy.js b/assets/hierarchy.js index bac6ee43..f0f46db2 100644 --- a/assets/hierarchy.js +++ b/assets/hierarchy.js @@ -1 +1 @@ -window.hierarchyData="eJydlFFPgzAUhf9Ln6uuLbCyZ3120QeXmD0U6EKzDrQtS8yy/247ZHaKpfOFEHr47uFy7j0A1bZGg8UrnkOUQExoBskaAsU3kpdGtI09PADiLg3bcbAAL0oYVkgOINiKpgILnGYQdEraM9EYrjas5PpukN3WZiettpRMWxYwurpx792cte6wFrJSvLFGEueCwGyWQjrDMM8JRIhSiNLMWpwn9i5PcogRoesjBCjxrD1xVkVYG2T/sJYgOmKNuMsva3juWXvY88Y8d4UulSi4mnD4Q32tUZzOTg4SvzlLJr7LIkyHsieorenO/yzUP3AfRfwsLLtCCl3zMHgQTdNtez36SLtG8BFtOvPtr7uIy3vHtQnBvyTTZBuIC/Kb/AhzrWCaaiPmUe85k+Fe9Ipproutb7ftTBjcKyLA5AK87KQMR0PKCKgd/QuorsNQXUdA7bx60FVUlFdXZNntAr9AXJpX18TZbRp/XozibBeclZMiZspp5oPbcsuDc9IrJsBjez6wUMcXvtttnrXHQnO1D/d00Ex99/H4Ce92Nbs="; \ No newline at end of file +window.hierarchyData="eJydlVFvmzAUhf/Lfb5tsQFjeJu0PC/aHhapiipIXIHqQGebSlWV/z45jMRs1Ji9IISPv3N8dX35ANV1RkPxSFkWIc2QJEhjzjDeIyjxLMXBNF2rofiA2D7a8iSggJ+qMWUlBSC8NO0RCpoyhF5JKKBpjVDP5UHoh1F2X5uTBISDLLWGAow+3tl9d1etXawbeVSiheIxsSliZFGKPKKY5zESwjmSlGVIsoQjyZMcKYn5/oxAEifad1EeA6KNsv+IlhA+Ey22j3+i0cyJtnkTrfnRV/qgmkqohYR/qdcGpWl0SZC4xdmWzc2WUD7aXqBCP9j1T42GD/ZQsdsL276Sja6FHzyKlukJ4Q59plwz+IAyXfksSift8qsX2vjgfyTLZB7RCflVvvu5r/J9mZrnbrW/ilL6azEolrm2bd24XW/84EERAI4n4G0vpb81pAyApiybQHXth+o6AJolbtJdUCvvVvSynQWuQVg379a0s5007n0xSpQn7125KEJuOWcuuDu8CO89GRQL4Lk57xmo8wPfzjYn2rdKC/Xmr+moCTg3o5Hbaaoz3UapbmleP13e21I+3d/2BEztwdKdSV96U690vG4JNWTuUNko1a49421PqGUWTS1XugUZTX+BjEZoa4v2vPvz+fwbxVHTzA=="; \ No newline at end of file diff --git a/assets/highlight.css b/assets/highlight.css index 1dd2209d..7df305dc 100644 --- a/assets/highlight.css +++ b/assets/highlight.css @@ -1 +1 @@ -:root{--light-hl-0:#795e26;--dark-hl-0:#dcdcaa;--light-hl-1:#000;--dark-hl-1:#d4d4d4;--light-hl-2:#a31515;--dark-hl-2:#ce9178;--light-hl-3:#001080;--dark-hl-3:#9cdcfe;--light-hl-4:#00f;--dark-hl-4:#569cd6;--light-hl-5:#af00db;--dark-hl-5:#c586c0;--light-hl-6:green;--dark-hl-6:#6a9955;--light-hl-7:#0070c1;--dark-hl-7:#4fc1ff;--light-hl-8:#267f99;--dark-hl-8:#4ec9b0;--light-hl-9:#098658;--dark-hl-9:#b5cea8;--light-hl-10:#000;--dark-hl-10:#d4d4d4;--light-code-background:#fff;--dark-code-background:#1e1e1e}@media (prefers-color-scheme:light){:root{--hl-0:var(--light-hl-0);--hl-1:var(--light-hl-1);--hl-2:var(--light-hl-2);--hl-3:var(--light-hl-3);--hl-4:var(--light-hl-4);--hl-5:var(--light-hl-5);--hl-6:var(--light-hl-6);--hl-7:var(--light-hl-7);--hl-8:var(--light-hl-8);--hl-9:var(--light-hl-9);--hl-10:var(--light-hl-10);--code-background:var(--light-code-background)}}@media (prefers-color-scheme:dark){:root{--hl-0:var(--dark-hl-0);--hl-1:var(--dark-hl-1);--hl-2:var(--dark-hl-2);--hl-3:var(--dark-hl-3);--hl-4:var(--dark-hl-4);--hl-5:var(--dark-hl-5);--hl-6:var(--dark-hl-6);--hl-7:var(--dark-hl-7);--hl-8:var(--dark-hl-8);--hl-9:var(--dark-hl-9);--hl-10:var(--dark-hl-10);--code-background:var(--dark-code-background)}}:root[data-theme=light]{--hl-0:var(--light-hl-0);--hl-1:var(--light-hl-1);--hl-2:var(--light-hl-2);--hl-3:var(--light-hl-3);--hl-4:var(--light-hl-4);--hl-5:var(--light-hl-5);--hl-6:var(--light-hl-6);--hl-7:var(--light-hl-7);--hl-8:var(--light-hl-8);--hl-9:var(--light-hl-9);--hl-10:var(--light-hl-10);--code-background:var(--light-code-background)}:root[data-theme=dark]{--hl-0:var(--dark-hl-0);--hl-1:var(--dark-hl-1);--hl-2:var(--dark-hl-2);--hl-3:var(--dark-hl-3);--hl-4:var(--dark-hl-4);--hl-5:var(--dark-hl-5);--hl-6:var(--dark-hl-6);--hl-7:var(--dark-hl-7);--hl-8:var(--dark-hl-8);--hl-9:var(--dark-hl-9);--hl-10:var(--dark-hl-10);--code-background:var(--dark-code-background)}.hl-0{color:var(--hl-0)}.hl-1{color:var(--hl-1)}.hl-2{color:var(--hl-2)}.hl-3{color:var(--hl-3)}.hl-4{color:var(--hl-4)}.hl-5{color:var(--hl-5)}.hl-6{color:var(--hl-6)}.hl-7{color:var(--hl-7)}.hl-8{color:var(--hl-8)}.hl-9{color:var(--hl-9)}.hl-10{color:var(--hl-10)}code,pre{background:var(--code-background)} \ No newline at end of file +:root{--light-hl-0:#795e26;--dark-hl-0:#dcdcaa;--light-hl-1:#000;--dark-hl-1:#d4d4d4;--light-hl-2:#a31515;--dark-hl-2:#ce9178;--light-hl-3:#af00db;--dark-hl-3:#c586c0;--light-hl-4:#001080;--dark-hl-4:#9cdcfe;--light-hl-5:green;--dark-hl-5:#6a9955;--light-hl-6:#00f;--dark-hl-6:#569cd6;--light-hl-7:#0070c1;--dark-hl-7:#4fc1ff;--light-hl-8:#267f99;--dark-hl-8:#4ec9b0;--light-hl-9:#098658;--dark-hl-9:#b5cea8;--light-hl-10:#000;--dark-hl-10:#d4d4d4;--light-code-background:#fff;--dark-code-background:#1e1e1e}@media (prefers-color-scheme:light){:root{--hl-0:var(--light-hl-0);--hl-1:var(--light-hl-1);--hl-2:var(--light-hl-2);--hl-3:var(--light-hl-3);--hl-4:var(--light-hl-4);--hl-5:var(--light-hl-5);--hl-6:var(--light-hl-6);--hl-7:var(--light-hl-7);--hl-8:var(--light-hl-8);--hl-9:var(--light-hl-9);--hl-10:var(--light-hl-10);--code-background:var(--light-code-background)}}@media (prefers-color-scheme:dark){:root{--hl-0:var(--dark-hl-0);--hl-1:var(--dark-hl-1);--hl-2:var(--dark-hl-2);--hl-3:var(--dark-hl-3);--hl-4:var(--dark-hl-4);--hl-5:var(--dark-hl-5);--hl-6:var(--dark-hl-6);--hl-7:var(--dark-hl-7);--hl-8:var(--dark-hl-8);--hl-9:var(--dark-hl-9);--hl-10:var(--dark-hl-10);--code-background:var(--dark-code-background)}}:root[data-theme=light]{--hl-0:var(--light-hl-0);--hl-1:var(--light-hl-1);--hl-2:var(--light-hl-2);--hl-3:var(--light-hl-3);--hl-4:var(--light-hl-4);--hl-5:var(--light-hl-5);--hl-6:var(--light-hl-6);--hl-7:var(--light-hl-7);--hl-8:var(--light-hl-8);--hl-9:var(--light-hl-9);--hl-10:var(--light-hl-10);--code-background:var(--light-code-background)}:root[data-theme=dark]{--hl-0:var(--dark-hl-0);--hl-1:var(--dark-hl-1);--hl-2:var(--dark-hl-2);--hl-3:var(--dark-hl-3);--hl-4:var(--dark-hl-4);--hl-5:var(--dark-hl-5);--hl-6:var(--dark-hl-6);--hl-7:var(--dark-hl-7);--hl-8:var(--dark-hl-8);--hl-9:var(--dark-hl-9);--hl-10:var(--dark-hl-10);--code-background:var(--dark-code-background)}.hl-0{color:var(--hl-0)}.hl-1{color:var(--hl-1)}.hl-2{color:var(--hl-2)}.hl-3{color:var(--hl-3)}.hl-4{color:var(--hl-4)}.hl-5{color:var(--hl-5)}.hl-6{color:var(--hl-6)}.hl-7{color:var(--hl-7)}.hl-8{color:var(--hl-8)}.hl-9{color:var(--hl-9)}.hl-10{color:var(--hl-10)}code,pre{background:var(--code-background)} \ No newline at end of file diff --git a/assets/navigation.js b/assets/navigation.js index 12b76b2b..aaa74286 100644 --- a/assets/navigation.js +++ b/assets/navigation.js @@ -1 +1 @@ -window.navigationData="eJyNlU1PwkAQhv9LzyiCgspVPanBqIlNjIdtGeyGpa07WwIx/ne33RbYMgy9NfPu83T2o93P38DA2gST4C5Lq6dekAuT2EKsBCJgvw7OE7NUNl3IdBZMBsObv96WvQehQB+irs6R0whBryi2STj6RUiCLKsspbP1hsDKMssVkZKYUM1uI55XikKV4ilMKAoTjnqFXBFzrMo891MAEqegDlg2Kwy1OK7OkW9ZvADipa7OkkaDWBJkVWfJIsJYy4jqeJdxhpA5EGGnExFyTYTdunhYQWooj7SfrZ6L2KpaY3zdcDT2DoCYiUgB6WlCVlDttv1ppBCbaW5kliItIwZyYrelHcTUQE78oaU5OuUm5ATV8u5os8mbNW9RF7fXg9GwTU7n75YgeRd1shx1dDE8A6L4PuDrckf6SS6OGcrolMV97Acb6zxeeMoUi1xEUkmz9wdcCS3LfcT+LvU9l56ifRvu8S46GzC4vbfQdkrhdcS9u7D33iNs/NttXqRxNfv+fu5rxld/X/++B54b"; \ No newline at end of file +window.navigationData="eJydl29v0zAQxr+LX3eMDTagQkhjFGkCtKpDUDRNk5tciVXXyfynNJr23VGSprEb7+zlXeV7nt+d4/TOuX0kGraajMlHJjRIQfknMiIF1RkZk3WeGg7q+L6N3b/K9JqTEVkxkZLx6YgkGeOpBEHGt3vUTZ6sQP8sC+hQIMzaAXUil/n+abQHXUhJy89muQT5i8G/jlZjljRxazuQH9R6dj4iCadKkTHRKj1i6gi2jZXYOVUpkisNkupcBjPa4oH5jM4mUkbkaoW9PBZtIqXIo3CdMsCLQg3d/WQDQl+kqQSlgmksLVpzpYsrfK8M8q4q04byKGQrxqjtWzMDbaSYgTJch+A+z7Dn3pL+MODpy5JblmG5pzJfMwXf2QpCOS3p4Fw67v/QKbFTu8mohNRqNCFszzBsHz3MZS6UliaJaFKYd2DP6ljuKeqyeLYlew7x9Yd3J2en8Y3iq73ZXq5W4k1io7YFFSkGqgVhjJY00SinVgzf9NVy8mAoV0iOVhKqtmsd7n+9D3SEw2u/LjTLBVb6ThGqfEqlZnbj7YF2iuG1TlmywvgsWQ2H/5ZM0wWHb1BiT8OWBV89t6FtqGSVtT+Uj05c1Ju4kpEu583V078o752V+TIX9a99vtoF6ngXcLEnp/Zt8QtQbpfaWpt1zHm9UCA3Pm8bwdxTyjzOahV1yXxbemzVMuozC85U5it2H8L9nPusnOMulflcKsNcMyi4Z4/1Mu57MKA8b8EugHpzo30Pp1nHnM0XSd/ZrKNOLYGuPc56HXWahUokW/gq7mIYYY68EPOoN2KOFTGPq6KevT6OdSU50GDXrBnQtOoyXk4bRAH1aV/mQkCie6PIhnmE6AWwPtIIsE+Igdv+74W1weBnyuGAqReD46QSXS/dD3bL34SiKM8yYgg/QCn6t+ffLUe6fRdSKxSiNH/2Zy4vTjBESmhBF4wzXfqmZxc9nJQ24nAaWv4m1B+0ln0DUrFc+Oy7EJbbyE11GXGn29KIpN79sR13Medvn+7+AwMvPvY="; \ No newline at end of file diff --git a/assets/search.js b/assets/search.js index 00940e8f..b1b4cfb1 100644 --- a/assets/search.js +++ b/assets/search.js @@ -1 +1 @@ -window.searchData="eJy9vd2O5EiSpfkqi+zbnGzTf9W625nuwRRmervQ1bOzQKGw8PCwyDBkhLuPu0dWZjf63cdMzIROCo/oD52ZNwEPM1JFqBQqlec7VPv3754f//by3R/+8u/f/XR6+PjdH+yhJBPs99893H09fveH7/7p+PJy9+Pxu++/+/b85fz/11+fji9/f/v0h8+vX7+cv7r/cvfycjw38913//F9o6X/cfpJae3yTb3FEKfW/tfz6fXuw5e3pk4Pr8fnT3f35/b4u2pj5mD91NrXb19eT/d3L6//7fHppdnk302bf75uPgvw/XdPd8/Hh9d5ikrQl+PDx//87dOn4/OfT//WPpC/u2z/gbZ/uW6/Pex/O/34+X/dneP8093zT32RP593+dtll6/XXbYH/9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8TGDz8Lbwjeu7f1xS19euyLM50fRgy8OF5RPvuOs891zgQTQyRok8iCbePfNgVSYt5PA2bHSSz78dv5w3OAJznZmv2ZQ6H63+dp5LSKo+Jzd805hG+NsffEuzfIdwTFU9n+PATz+RbxVpQsA8lcxcImV6b+2Q+i6gX6Anw8yRaup8KvxFeVd5/rJy7kzr3+6ePj5+vTstBrg092dwF/LziuV+cjyIeB6EAl/GgQehyDpT4t0z39DL5JA/vFnHOh0l56yPD58en++P6+Tzohf4kmAljG9ljmvac0kHvpVFFnsjP3om3j3zUZTJcnJ4Wxegh1v/9fvvnk5Px/NM8JzgX/76H//xfwDc8F69"; \ No newline at end of file +window.searchData="eJy8vW2P5EhyrflXFtVfSz3h7+6DxQK6mtHegTRXDc1oJaAxEKKyoqoCnZmRyojsqdZA/30RxnAmaTzmL0xWf6tKkm7mTiPpPM+hx9/ePZ/+en732x//9u6n4+PHd7/VuxSU0+/fPe4fDu9+++6Ph/N5//nw7v27l+f7d799d/nl6XD+ze2v33+5PNy/e//u7n5/Ph/O73777t3/vK+09M/Hn4TWrlvKLTo/tvbvz8fL/sP9a1PHx8vh+dP+7nD+Td5WbEzttB1be3i5vxzv9ufL/z49natNfjfu/mXYfRLg/bun/fPh8TJNUQh6Pjx+/F8vnz4dnv90/O96R7677v+B9j8P+68P+7+Pn7/8+/5yeP7j/vmntshfjp+//PV6yMNwyPrgfz4+HE4vl7awl3Hn5oB6Z+MsYFukrhCTSvzXw/6jVIl5W3slPh/uDsefD+W6mDX73e2QhtIYUy0Hr1YHjN9WII0pFGoEBq+VCQg7K5NbM83xVgf6cX/+5fHuD5fD8/5yev5LPSDtf7zt3xd2fv/90+nup8PlX54ux9Pjmd2BZ9ua78G///nwePnTy4fz3fPxw+EZ9YXtUnlgTMbp9Nja3He0Kx4WnqEU7NOn9mi0b284pV+j/bA/vo7VraHfXP9YHB2nXk/l3enxfHl+uRsqQmjou/leOGPKRbgUD9fenAsBxh1e276cP/7d8fx3x8cvh+fj5fCx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bTOIW3HfVpe/OkU3NjuiBCIeK10aBcAIRopARLGGSmHC2Ii3ZGiNRVT8UZ9yQvGt886tSYiO4jcBpeu2RKWBFnI3E26QM1uEFBXLRPIkqATU/C2CzktL2fjLVNcGMx+tzvv+8ON886tVsCxgWw5zOPthio8bMyxTiU87zphgsvd56KW1Bz0sRm3VEjVfDkd4E8JxKtEwlaxhkyJEZBXGCiqq41uslojQOSjfbD9kb75jyUN8B6PLE6wFpE8qREsM1YT6ZHUhAXfnzVGtZNL5IFmwdP2t+o3sQP3SbFXT1pUiCkRiJqIs/J+E3WWW/EhV9etV/spgfggi1+nFV//60kaXIiLcCBC8/FB44ucnIJEM10pzIgWhAXwKoqZ+Mm2DA2lF/6p2636e/Mba7aZxCLsch62Q/H5bBC2xAjaCjCX/9BSPNEiECzOnLHieonEyqKdtZJJQUTqbrw6Yz8Kpr/7H8tiusZt2BkrF7vTues2r53mapN49tJr+88ZtC+ZiBl+qrNgH+vx4fdZj3MILS0kzpcEhWR5yYCMBWBuQRQJGAuw7gVxIWUoerKiZvmHr1Z6377uNt3/a3yMjsPnA5OkGAZ8JqI0ySCZYb2zhS3BXHhV1SdFXLTqzSWgYNvnz+Nw9g/Ddv+05ev3/78+QuMch1w"; \ No newline at end of file diff --git a/classes/Context.html b/classes/Context.html index 258f7d37..03871082 100644 --- a/classes/Context.html +++ b/classes/Context.html @@ -1,3 +1,3 @@ -Context | zeromq.js

Class Context

A ØMQ context. Contexts manage the background I/O to send and receive messages of their associated sockets.

It is usually not necessary to instantiate a new context - the global context is used for new sockets by default. The global context is the only context that is shared between threads (when using worker_threads). Custom contexts can only be used in the same thread.

// Use default context (recommended).
const socket = new Dealer() -
// Use custom context.
const context = new Context()
const socket = new Dealer({context}) -

Note: By default all contexts (including the global context) will prevent the process from terminating if there are any messages in an outgoing queue, even if the associated socket was closed. For some applications this is unnecessary or unwanted. Consider setting Context.blocky to false or setting Socket.linger for each new socket.

Constructors

  • Creates a new ØMQ context and sets any provided context options. Sockets need to be explicitly associated with a new context during construction.

    Parameters

    • Optionaloptions: {
          blocky?: boolean;
          ioThreads?: number;
          ipv6?: boolean;
          maxMessageSize?: number;
          maxSockets?: number;
          threadPriority?: number;
          threadSchedulingPolicy?: number;
      }

      An optional object with options that will be set on the context during creation.

      • Optionalblocky?: boolean

        ZMQ_BLOCKY

        By default the context will block forever when closed at process exit. The assumption behind this behavior is that abrupt termination will cause message loss. Most real applications use some form of handshaking to ensure applications receive termination messages, and then terminate the context with Socket.linger set to zero on all sockets. This setting is an easier way to get the same result. When blocky is set to false, all new sockets are given a linger timeout of zero. You must still close all sockets before exiting.

      • OptionalioThreads?: number

        ZMQ_IO_THREADS

        Size of the ØMQ thread pool to handle I/O operations. If your application is using only the inproc transport for messaging you may set this to zero, otherwise set it to at least one (default).

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, a socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • OptionalmaxMessageSize?: number

        ZMQ_MAX_MSGSZ

        Maximum allowed size of a message sent in the context.

      • OptionalmaxSockets?: number

        ZMQ_MAX_SOCKETS

        Maximum number of sockets allowed on the context.

      • OptionalthreadPriority?: number

        ZMQ_THREAD_PRIORITY

        Scheduling priority for internal context's thread pool. This option is not available on Windows. Supported values for this option depend on chosen scheduling policy. Details can be found at http://man7.org/linux/man-pages/man2/sched_setscheduler.2.html. This option only applies before creating any sockets on the context.

      • OptionalthreadSchedulingPolicy?: number

        ZMQ_THREAD_SCHED_POLICY

        Scheduling policy for internal context's thread pool. This option is not available on Windows. Supported values for this option can be found at http://man7.org/linux/man-pages/man2/sched_setscheduler.2.html. This option only applies before creating any sockets on the context.

    Returns Context

Properties

blocky: boolean

ZMQ_BLOCKY

By default the context will block forever when closed at process exit. The assumption behind this behavior is that abrupt termination will cause message loss. Most real applications use some form of handshaking to ensure applications receive termination messages, and then terminate the context with Socket.linger set to zero on all sockets. This setting is an easier way to get the same result. When blocky is set to false, all new sockets are given a linger timeout of zero. You must still close all sockets before exiting.

ioThreads: number

ZMQ_IO_THREADS

Size of the ØMQ thread pool to handle I/O operations. If your application is using only the inproc transport for messaging you may set this to zero, otherwise set it to at least one (default).

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, a socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

maxMessageSize: number

ZMQ_MAX_MSGSZ

Maximum allowed size of a message sent in the context.

maxSockets: number

ZMQ_MAX_SOCKETS

Maximum number of sockets allowed on the context.

maxSocketsLimit: number

ZMQ_SOCKET_LIMIT

Largest number of sockets that can be set with maxSockets.

threadPriority: number

ZMQ_THREAD_PRIORITY

Scheduling priority for internal context's thread pool. This option is not available on Windows. Supported values for this option depend on chosen scheduling policy. Details can be found at http://man7.org/linux/man-pages/man2/sched_setscheduler.2.html. This option only applies before creating any sockets on the context.

threadSchedulingPolicy: number

ZMQ_THREAD_SCHED_POLICY

Scheduling policy for internal context's thread pool. This option is not available on Windows. Supported values for this option can be found at http://man7.org/linux/man-pages/man2/sched_setscheduler.2.html. This option only applies before creating any sockets on the context.

Methods

  • Parameters

    • option: number

    Returns boolean

  • Parameters

    • option: number

    Returns number

  • Parameters

    • option: number
    • value: boolean

    Returns void

  • Parameters

    • option: number
    • value: number

    Returns void

\ No newline at end of file +Context | zeromq.js

Class Context

A ØMQ context. Contexts manage the background I/O to send and receive messages of their associated sockets.

It is usually not necessary to instantiate a new context - the global context is used for new sockets by default. The global context is the only context that is shared between threads (when using worker_threads). Custom contexts can only be used in the same thread.

// Use default context (recommended).
const socket = new Dealer() +
// Use custom context.
const context = new Context()
const socket = new Dealer({context}) +

Note: By default all contexts (including the global context) will prevent the process from terminating if there are any messages in an outgoing queue, even if the associated socket was closed. For some applications this is unnecessary or unwanted. Consider setting Context.blocky to false or setting Socket.linger for each new socket.

Constructors

  • Creates a new ØMQ context and sets any provided context options. Sockets need to be explicitly associated with a new context during construction.

    Parameters

    • Optionaloptions: {
          blocky?: boolean;
          ioThreads?: number;
          ipv6?: boolean;
          maxMessageSize?: number;
          maxSockets?: number;
          threadPriority?: number;
          threadSchedulingPolicy?: number;
      }

      An optional object with options that will be set on the context during creation.

      • Optionalblocky?: boolean

        ZMQ_BLOCKY

        By default the context will block forever when closed at process exit. The assumption behind this behavior is that abrupt termination will cause message loss. Most real applications use some form of handshaking to ensure applications receive termination messages, and then terminate the context with Socket.linger set to zero on all sockets. This setting is an easier way to get the same result. When blocky is set to false, all new sockets are given a linger timeout of zero. You must still close all sockets before exiting.

      • OptionalioThreads?: number

        ZMQ_IO_THREADS

        Size of the ØMQ thread pool to handle I/O operations. If your application is using only the inproc transport for messaging you may set this to zero, otherwise set it to at least one (default).

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, a socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • OptionalmaxMessageSize?: number

        ZMQ_MAX_MSGSZ

        Maximum allowed size of a message sent in the context.

      • OptionalmaxSockets?: number

        ZMQ_MAX_SOCKETS

        Maximum number of sockets allowed on the context.

      • OptionalthreadPriority?: number

        ZMQ_THREAD_PRIORITY

        Scheduling priority for internal context's thread pool. This option is not available on Windows. Supported values for this option depend on chosen scheduling policy. Details can be found at http://man7.org/linux/man-pages/man2/sched_setscheduler.2.html. This option only applies before creating any sockets on the context.

      • OptionalthreadSchedulingPolicy?: number

        ZMQ_THREAD_SCHED_POLICY

        Scheduling policy for internal context's thread pool. This option is not available on Windows. Supported values for this option can be found at http://man7.org/linux/man-pages/man2/sched_setscheduler.2.html. This option only applies before creating any sockets on the context.

    Returns Context

Properties

blocky: boolean

ZMQ_BLOCKY

By default the context will block forever when closed at process exit. The assumption behind this behavior is that abrupt termination will cause message loss. Most real applications use some form of handshaking to ensure applications receive termination messages, and then terminate the context with Socket.linger set to zero on all sockets. This setting is an easier way to get the same result. When blocky is set to false, all new sockets are given a linger timeout of zero. You must still close all sockets before exiting.

ioThreads: number

ZMQ_IO_THREADS

Size of the ØMQ thread pool to handle I/O operations. If your application is using only the inproc transport for messaging you may set this to zero, otherwise set it to at least one (default).

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, a socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

maxMessageSize: number

ZMQ_MAX_MSGSZ

Maximum allowed size of a message sent in the context.

maxSockets: number

ZMQ_MAX_SOCKETS

Maximum number of sockets allowed on the context.

maxSocketsLimit: number

ZMQ_SOCKET_LIMIT

Largest number of sockets that can be set with maxSockets.

threadPriority: number

ZMQ_THREAD_PRIORITY

Scheduling priority for internal context's thread pool. This option is not available on Windows. Supported values for this option depend on chosen scheduling policy. Details can be found at http://man7.org/linux/man-pages/man2/sched_setscheduler.2.html. This option only applies before creating any sockets on the context.

threadSchedulingPolicy: number

ZMQ_THREAD_SCHED_POLICY

Scheduling policy for internal context's thread pool. This option is not available on Windows. Supported values for this option can be found at http://man7.org/linux/man-pages/man2/sched_setscheduler.2.html. This option only applies before creating any sockets on the context.

Methods

  • Parameters

    • option: number

    Returns boolean

  • Parameters

    • option: number

    Returns number

  • Parameters

    • option: number
    • value: boolean

    Returns void

  • Parameters

    • option: number
    • value: number

    Returns void

\ No newline at end of file diff --git a/classes/Dealer.html b/classes/Dealer.html index 7bc3cfe8..247b396f 100644 --- a/classes/Dealer.html +++ b/classes/Dealer.html @@ -1,9 +1,10 @@ -Dealer | zeromq.js

Class Dealer

A Dealer socket can be used to extend request/reply sockets. Each message sent is round-robined among all connected peers, and each message received is fair-queued from all connected peers.

When a Dealer socket enters the mute state due to having reached the high water mark for all peers, or if there are no peers at all, then any Writable.send() operations on the socket shall block until the mute state ends or at least one peer becomes available for sending; messages are not discarded.

When a Dealer is connected to a Reply socket, each message sent must consist of an empty message part, the delimiter, followed by one or more body parts.

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          conflate?: boolean;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          probeRouter?: boolean;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          routingId?: null | string;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • Optionalconflate?: boolean

        ZMQ_CONFLATE

        If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalprobeRouter?: boolean

        ZMQ_PROBE_ROUTER

        When set to true, the socket will automatically send an empty message when a new connection is made or accepted. You may set this on sockets connected to a Router socket. The application must filter such empty messages. This option provides the Router with an event signaling the arrival of a new peer.

        Warning:* Do not set this option on a socket that talks to any other socket type except Router: the results are undefined.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalroutingId?: null | string

        ZMQ_ROUTING_ID

        The identity of the specified socket when connecting to a Router socket.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Dealer

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

conflate: boolean

ZMQ_CONFLATE

If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

probeRouter: boolean

ZMQ_PROBE_ROUTER

When set to true, the socket will automatically send an empty message when a new connection is made or accepted. You may set this on sockets connected to a Router socket. The application must filter such empty messages. This option provides the Router with an event signaling the arrival of a new peer.

Warning:* Do not set this option on a socket that talks to any other socket type except Router: the results are undefined.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

routingId: null | string

ZMQ_ROUTING_ID

The identity of the specified socket when connecting to a Router socket.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

type: SocketType

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Asynchronously iterate over messages becoming available on the socket. When the socket is closed with Socket.close(), the iterator will return. Returning early from the iterator will not close the socket unless it also goes out of scope.

    for await (const [msg] of socket) {
    // handle messages
    } -

    Returns AsyncIterator<Buffer[]>

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disonnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() -

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error -

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) -

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Parameters

    • option: number
    • value: boolean

    Returns void

  • Parameters

    • option: number
    • value: null | string | Buffer

    Returns void

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file +Dealer | zeromq.js

Class Dealer

A Dealer socket can be used to extend request/reply sockets. Each message sent is round-robined among all connected peers, and each message received is fair-queued from all connected peers.

When a Dealer socket enters the mute state due to having reached the high water mark for all peers, or if there are no peers at all, then any Writable.send() operations on the socket shall block until the mute state ends or at least one peer becomes available for sending; messages are not discarded.

When a Dealer is connected to a Reply socket, each message sent must consist of an empty message part, the delimiter, followed by one or more body parts.

import {Dealer} from "zeromq"

import {Queue} from "./queue"

async function main() {
const sender = new Dealer()
await sender.bind("tcp://127.0.0.1:4444")
console.log("sender bound to port 4444")

const queue = new Queue(sender)

const sent = Promise.all([
queue.send("hello"),
queue.send("world!"),
queue.send(null),
])

const receiver = new Dealer()
receiver.connect("tcp://127.0.0.1:4444")
console.log("receiver connected to port 4444")

for await (const [msg] of receiver) {
if (msg.length === 0) {
receiver.close()
console.log("received: <empty message>")
} else {
console.log(`received: ${msg}`)
}
}

await sent
}

main().catch(err => {
console.error(err)
process.exit(1)
})
+

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          conflate?: boolean;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          probeRouter?: boolean;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          routingId?: null | string;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • Optionalconflate?: boolean

        ZMQ_CONFLATE

        If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalprobeRouter?: boolean

        ZMQ_PROBE_ROUTER

        When set to true, the socket will automatically send an empty message when a new connection is made or accepted. You may set this on sockets connected to a Router socket. The application must filter such empty messages. This option provides the Router with an event signaling the arrival of a new peer.

        Warning:* Do not set this option on a socket that talks to any other socket type except Router: the results are undefined.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalroutingId?: null | string

        ZMQ_ROUTING_ID

        The identity of the specified socket when connecting to a Router socket.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Dealer

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

conflate: boolean

ZMQ_CONFLATE

If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

probeRouter: boolean

ZMQ_PROBE_ROUTER

When set to true, the socket will automatically send an empty message when a new connection is made or accepted. You may set this on sockets connected to a Router socket. The application must filter such empty messages. This option provides the Router with an event signaling the arrival of a new peer.

Warning:* Do not set this option on a socket that talks to any other socket type except Router: the results are undefined.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

routingId: null | string

ZMQ_ROUTING_ID

The identity of the specified socket when connecting to a Router socket.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disconnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() +

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error +

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) +

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file diff --git a/classes/Observer.html b/classes/Observer.html index bbd0d805..7473d91b 100644 --- a/classes/Observer.html +++ b/classes/Observer.html @@ -1,5 +1,5 @@ -Observer | zeromq.js

Class Observer

An event observer for ØMQ sockets. This starts up a ZMQ monitoring socket internally that receives all socket events. The event observer can be used in one of two ways, which are mutually exclusive: with receive() or with event listeners attached with on().

Hierarchy (View Summary)

Constructors

Properties

Methods

Constructors

  • Creates a new ØMQ observer. It should not be necessary to instantiate a new observer. Access an existing observer for a socket with Socket.events.

    const socket = new Publisher()
    const events = socket.events -

    Parameters

    • socket: Socket

      The socket to observe.

    Returns Observer

Properties

closed: boolean

Whether the observer was closed, either manually or because the associated socket was closed.

Methods

  • Asynchronously iterate over socket events. When the socket is closed or when the observer is closed manually with Observer.close(), the iterator will return.

    for await (event of socket.events) {
    switch (event.type) {
    case "bind":
    console.log(`Socket bound to ${event.address}`)
    break
    // ...
    }
    } -

    Returns AsyncIterator<Event>

  • Closes the observer. Afterwards no new events will be received or emitted. Calling this method is optional.

    Returns void

  • Removes the specified listener function from the list of functions to call when the given event is observed.

    Type Parameters

    • E extends
          | "unknown"
          | "connect"
          | "disconnect"
          | "close"
          | "end"
          | "accept"
          | "accept:error"
          | "bind"
          | "bind:error"
          | "connect:delay"
          | "connect:retry"
          | "close:error"
          | "handshake"
          | "handshake:error:protocol"
          | "handshake:error:auth"
          | "handshake:error:other"

    Parameters

    • type: E

      The type of event that the listener was listening for.

    • listener: (data: EventOfType<E>) => void

      The previously registered listener function.

    Returns EventSubscriber

  • Adds a listener function which will be invoked when the given event type is observed. Calling this method will convert the Observer to event emitter mode, which will make it impossible to call Observer.receive() at the same time.

    socket.events.on("bind", event => {
    console.log(`Socket bound to ${event.address}`)
    // ...
    }) -

    Type Parameters

    • E extends
          | "unknown"
          | "connect"
          | "disconnect"
          | "close"
          | "end"
          | "accept"
          | "accept:error"
          | "bind"
          | "bind:error"
          | "connect:delay"
          | "connect:retry"
          | "close:error"
          | "handshake"
          | "handshake:error:protocol"
          | "handshake:error:auth"
          | "handshake:error:other"

    Parameters

    • type: E

      The type of event to listen for.

    • listener: (data: EventOfType<E>) => void

      The listener function that will be called with all event data when the event is observed.

    Returns EventSubscriber

  • Waits for the next event to become availeble on the observer. Reads an event immediately if possible. If no events are queued, it will wait asynchonously. The promise will be resolved with the next event when available.

    When reading events with receive() the observer may not be in event emitter mode. Avoid mixing calls to receive() with event handlers via attached with on().

    for await (event of socket.events) {
    switch (event.type) {
    case "bind":
    console.log(`Socket bound to ${event.address}`)
    break
    // ...
    }
    } -

    Returns Promise<Event>

    Resolved with the next event and its details. See Event.

\ No newline at end of file +Observer | zeromq.js

Class Observer

An event observer for ØMQ sockets. This starts up a ZMQ monitoring socket internally that receives all socket events. The event observer can be used in one of two ways, which are mutually exclusive: with receive() or with event listeners attached with on().

Hierarchy (View Summary)

Constructors

Properties

Methods

Constructors

  • Creates a new ØMQ observer. It should not be necessary to instantiate a new observer. Access an existing observer for a socket with Socket.events.

    const socket = new Publisher()
    const events = socket.events +

    Parameters

    • socket: Socket

      The socket to observe.

    Returns Observer

Properties

closed: boolean

Whether the observer was closed, either manually or because the associated socket was closed.

Methods

  • Asynchronously iterate over socket events. When the socket is closed or when the observer is closed manually with Observer.close(), the iterator will return.

    for await (event of socket.events) {
    switch (event.type) {
    case "bind":
    console.log(`Socket bound to ${event.address}`)
    break
    // ...
    }
    } +

    Returns AsyncIterator<Event>

  • Closes the observer. Afterwards no new events will be received or emitted. Calling this method is optional.

    Returns void

  • Removes the specified listener function from the list of functions to call when the given event is observed.

    Type Parameters

    • E extends
          | "unknown"
          | "connect"
          | "disconnect"
          | "close"
          | "end"
          | "accept"
          | "accept:error"
          | "bind"
          | "bind:error"
          | "connect:delay"
          | "connect:retry"
          | "close:error"
          | "handshake"
          | "handshake:error:protocol"
          | "handshake:error:auth"
          | "handshake:error:other"

    Parameters

    • type: E

      The type of event that the listener was listening for.

    • listener: (data: EventOfType<E>) => void

      The previously registered listener function.

    Returns EventSubscriber

  • Adds a listener function which will be invoked when the given event type is observed. Calling this method will convert the Observer to event emitter mode, which will make it impossible to call Observer.receive() at the same time.

    socket.events.on("bind", event => {
    console.log(`Socket bound to ${event.address}`)
    // ...
    }) +

    Type Parameters

    • E extends
          | "unknown"
          | "connect"
          | "disconnect"
          | "close"
          | "end"
          | "accept"
          | "accept:error"
          | "bind"
          | "bind:error"
          | "connect:delay"
          | "connect:retry"
          | "close:error"
          | "handshake"
          | "handshake:error:protocol"
          | "handshake:error:auth"
          | "handshake:error:other"

    Parameters

    • type: E

      The type of event to listen for.

    • listener: (data: EventOfType<E>) => void

      The listener function that will be called with all event data when the event is observed.

    Returns EventSubscriber

  • Waits for the next event to become available on the observer. Reads an event immediately if possible. If no events are queued, it will wait asynchronously. The promise will be resolved with the next event when available.

    When reading events with receive() the observer may not be in event emitter mode. Avoid mixing calls to receive() with event handlers via attached with on().

    for await (event of socket.events) {
    switch (event.type) {
    case "bind":
    console.log(`Socket bound to ${event.address}`)
    break
    // ...
    }
    } +

    Returns Promise<Event>

    Resolved with the next event and its details. See Event.

\ No newline at end of file diff --git a/classes/Pair.html b/classes/Pair.html index ef5dab3d..85669fa0 100644 --- a/classes/Pair.html +++ b/classes/Pair.html @@ -1,9 +1,9 @@ -Pair | zeromq.js

Class Pair

A Pair socket can only be connected to one other Pair at any one time. No message routing or filtering is performed on any messages.

When a Pair socket enters the mute state due to having reached the high water mark for the connected peer, or if no peer is connected, then any Writable.send() operations on the socket shall block until the peer becomes available for sending; messages are not discarded.

While Pair sockets can be used over transports other than inproc://, their inability to auto-reconnect coupled with the fact new incoming connections will be terminated while any previous connections (including ones in a closing state) exist makes them unsuitable for tcp:// in most cases.

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Pair

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

type: SocketType

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Asynchronously iterate over messages becoming available on the socket. When the socket is closed with Socket.close(), the iterator will return. Returning early from the iterator will not close the socket unless it also goes out of scope.

    for await (const [msg] of socket) {
    // handle messages
    } -

    Returns AsyncIterator<Buffer[]>

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disonnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() -

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error -

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) -

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Parameters

    • option: number
    • value: boolean

    Returns void

  • Parameters

    • option: number
    • value: null | string | Buffer

    Returns void

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file +Pair | zeromq.js

Class Pair

A Pair socket can only be connected to one other Pair at any one time. No message routing or filtering is performed on any messages.

When a Pair socket enters the mute state due to having reached the high water mark for the connected peer, or if no peer is connected, then any Writable.send() operations on the socket shall block until the peer becomes available for sending; messages are not discarded.

While Pair sockets can be used over transports other than inproc://, their inability to auto-reconnect coupled with the fact new incoming connections will be terminated while any previous connections (including ones in a closing state) exist makes them unsuitable for tcp:// in most cases.

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Pair

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disconnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() +

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error +

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) +

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file diff --git a/classes/Proxy.html b/classes/Proxy.html index 4a28ec67..16914a6d 100644 --- a/classes/Proxy.html +++ b/classes/Proxy.html @@ -1,2 +1,2 @@ -Proxy | zeromq.js

Class Proxy<F, B>

Proxy messages between two ØMQ sockets. The proxy connects a front-end socket to a back-end socket. Conceptually, data flows from front-end to back-end. Depending on the socket types, replies may flow in the opposite direction. The direction is conceptual only; the proxy is fully symmetric and there is no technical difference between front-end and back-end.

// Proxy between a router/dealer socket for 5 seconds.
const proxy = new Proxy(new Router, new Dealer)
await proxy.frontEnd.bind("tcp://*:3001")
await proxy.backEnd.bind("tcp://*:3002")
setTimeout(() => proxy.terminate(), 5000)
await proxy.run() -

Review the ØMQ documentation for an overview of some example applications of a proxy.

F The front-end socket type.

B The back-end socket type.

Type Parameters

Constructors

Properties

Methods

Constructors

  • Creates a new ØMQ proxy. Proxying will start between the front-end and back-end sockets when run() is called after both sockets have been bound or connected.

    Type Parameters

    Parameters

    • frontEnd: F

      The front-end socket.

    • backEnd: B

      The back-end socket.

    Returns Proxy<F, B>

Properties

backEnd: B

Returns the original back-end socket.

frontEnd: F

Returns the original front-end socket.

Methods

  • Temporarily suspends any proxy activity. Resume activity with resume().

    Returns void

  • Resumes proxy activity after suspending it with pause().

    Returns void

  • Starts the proxy loop in a worker thread and waits for its termination. Before starting, you must set any socket options, and connect or bind both front-end and back-end sockets.

    On termination the front-end and back-end sockets will be closed automatically.

    Returns Promise<void>

    Resolved when the proxy has terminated.

  • Gracefully shuts down the proxy. The front-end and back-end sockets will be closed automatically. There might be a slight delay between terminating and the run() method resolving.

    Returns void

\ No newline at end of file +Proxy | zeromq.js

Class Proxy<F, B>

Proxy messages between two ØMQ sockets. The proxy connects a front-end socket to a back-end socket. Conceptually, data flows from front-end to back-end. Depending on the socket types, replies may flow in the opposite direction. The direction is conceptual only; the proxy is fully symmetric and there is no technical difference between front-end and back-end.

// Proxy between a router/dealer socket for 5 seconds.
const proxy = new Proxy(new Router, new Dealer)
await proxy.frontEnd.bind("tcp://*:3001")
await proxy.backEnd.bind("tcp://*:3002")
setTimeout(() => proxy.terminate(), 5000)
await proxy.run() +

Review the ØMQ documentation for an overview of some example applications of a proxy.

Type Parameters

Constructors

Properties

Methods

Constructors

  • Creates a new ØMQ proxy. Proxying will start between the front-end and back-end sockets when run() is called after both sockets have been bound or connected.

    Type Parameters

    Parameters

    • frontEnd: F

      The front-end socket.

    • backEnd: B

      The back-end socket.

    Returns Proxy<F, B>

Properties

backEnd: B

Returns the original back-end socket.

frontEnd: F

Returns the original front-end socket.

Methods

  • Temporarily suspends any proxy activity. Resume activity with resume().

    Returns void

  • Resumes proxy activity after suspending it with pause().

    Returns void

  • Starts the proxy loop in a worker thread and waits for its termination. Before starting, you must set any socket options, and connect or bind both front-end and back-end sockets.

    On termination the front-end and back-end sockets will be closed automatically.

    Returns Promise<void>

    Resolved when the proxy has terminated.

  • Gracefully shuts down the proxy. The front-end and back-end sockets will be closed automatically. There might be a slight delay between terminating and the run() method resolving.

    Returns void

\ No newline at end of file diff --git a/classes/Publisher.html b/classes/Publisher.html index 80fbf3f1..fee160a5 100644 --- a/classes/Publisher.html +++ b/classes/Publisher.html @@ -1,6 +1,7 @@ -Publisher | zeromq.js

Class Publisher

A Publisher socket is used to distribute data to Subscribers. Messages sent are distributed in a fan out fashion to all connected peers. This socket cannot receive messages.

When a Publisher enters the mute state due to having reached the high water mark for a connected Subscriber, then any messages that would be sent to the subscriber in question shall instead be dropped until the mute state ends. The Writable.send() method will never block.

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          conflate?: boolean;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          invertMatching?: boolean;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          noDrop?: boolean;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • Optionalconflate?: boolean

        ZMQ_CONFLATE

        If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • OptionalinvertMatching?: boolean

        ZMQ_INVERT_MATCHING

        Causes messages to be sent to all connected sockets except those subscribed to a prefix that matches the message.

        All Subscriber sockets connecting to the Publisher must also have the option set to true. Failure to do so will have the Subscriber sockets reject everything the Publisher socket sends them.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalnoDrop?: boolean

        ZMQ_XPUB_NODROP

        Sets the socket behaviour to return an error if the high water mark is reached and the message could not be send. The default is to drop the message silently when the peer high water mark is reached.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Publisher

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

conflate: boolean

ZMQ_CONFLATE

If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

invertMatching: boolean

ZMQ_INVERT_MATCHING

Causes messages to be sent to all connected sockets except those subscribed to a prefix that matches the message.

All Subscriber sockets connecting to the Publisher must also have the option set to true. Failure to do so will have the Subscriber sockets reject everything the Publisher socket sends them.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

noDrop: boolean

ZMQ_XPUB_NODROP

Sets the socket behaviour to return an error if the high water mark is reached and the message could not be send. The default is to drop the message silently when the peer high water mark is reached.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

type: SocketType

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disonnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) -

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Parameters

    • option: number
    • value: boolean

    Returns void

  • Parameters

    • option: number
    • value: null | string | Buffer

    Returns void

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file +Publisher | zeromq.js

Class Publisher

A Publisher socket is used to distribute data to Subscribers. Messages sent are distributed in a fan out fashion to all connected peers. This socket cannot receive messages.

When a Publisher enters the mute state due to having reached the high water mark for a connected Subscriber, then any messages that would be sent to the subscriber in question shall instead be dropped until the mute state ends. The Writable.send() method will never block.

import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Publisher()

await sock.bind("tcp://127.0.0.1:3000")
console.log("Publisher bound to port 3000")

// eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition
while (true) {
console.log("sending a multipart message envelope")
await sock.send(["kitty cats", "meow!"])
await new Promise(resolve => {
setTimeout(resolve, 500)
})
}
}

run().catch(console.error)
+

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          conflate?: boolean;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          invertMatching?: boolean;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          noDrop?: boolean;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • Optionalconflate?: boolean

        ZMQ_CONFLATE

        If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • OptionalinvertMatching?: boolean

        ZMQ_INVERT_MATCHING

        Causes messages to be sent to all connected sockets except those subscribed to a prefix that matches the message.

        All Subscriber sockets connecting to the Publisher must also have the option set to true. Failure to do so will have the Subscriber sockets reject everything the Publisher socket sends them.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalnoDrop?: boolean

        ZMQ_XPUB_NODROP

        Sets the socket behaviour to return an error if the high water mark is reached and the message could not be send. The default is to drop the message silently when the peer high water mark is reached.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Publisher

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

conflate: boolean

ZMQ_CONFLATE

If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

invertMatching: boolean

ZMQ_INVERT_MATCHING

Causes messages to be sent to all connected sockets except those subscribed to a prefix that matches the message.

All Subscriber sockets connecting to the Publisher must also have the option set to true. Failure to do so will have the Subscriber sockets reject everything the Publisher socket sends them.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

noDrop: boolean

ZMQ_XPUB_NODROP

Sets the socket behaviour to return an error if the high water mark is reached and the message could not be send. The default is to drop the message silently when the peer high water mark is reached.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disconnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) +

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file diff --git a/classes/Pull.html b/classes/Pull.html index 805d95e1..43ee497c 100644 --- a/classes/Pull.html +++ b/classes/Pull.html @@ -1,8 +1,9 @@ -Pull | zeromq.js

Class Pull

A Pull socket is used by a pipeline node to receive messages from upstream pipeline nodes. Messages are fair-queued from among all connected upstream nodes. This socket cannot send messages.

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          conflate?: boolean;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • Optionalconflate?: boolean

        ZMQ_CONFLATE

        If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Pull

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

conflate: boolean

ZMQ_CONFLATE

If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

type: SocketType

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Asynchronously iterate over messages becoming available on the socket. When the socket is closed with Socket.close(), the iterator will return. Returning early from the iterator will not close the socket unless it also goes out of scope.

    for await (const [msg] of socket) {
    // handle messages
    } -

    Returns AsyncIterator<Buffer[]>

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disonnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() -

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error -

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Parameters

    • option: number
    • value: boolean

    Returns void

  • Parameters

    • option: number
    • value: null | string | Buffer

    Returns void

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file +Pull | zeromq.js

Class Pull

A Pull socket is used by a pipeline node to receive messages from upstream pipeline nodes. Messages are fair-queued from among all connected upstream nodes. This socket cannot send messages.

import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Pull()

sock.connect("tcp://127.0.0.1:3000")
console.log("Worker connected to port 3000")

for await (const [msg] of sock) {
console.log("work: %s", msg.toString())
}
}

run().catch(console.error)
+

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          conflate?: boolean;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • Optionalconflate?: boolean

        ZMQ_CONFLATE

        If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Pull

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

conflate: boolean

ZMQ_CONFLATE

If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disconnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() +

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error +

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file diff --git a/classes/Push.html b/classes/Push.html index e1a3d19e..0c35ff0a 100644 --- a/classes/Push.html +++ b/classes/Push.html @@ -1,6 +1,7 @@ -Push | zeromq.js

Class Push

A Push socket is used by a pipeline node to send messages to downstream pipeline nodes. Messages are round-robined to all connected downstream nodes. This socket cannot receive messages.

When a Push socket enters the mute state due to having reached the high water mark for all downstream nodes, or if there are no downstream nodes at all, then Writable.send() will block until the mute state ends or at least one downstream node becomes available for sending; messages are not discarded.

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          conflate?: boolean;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • Optionalconflate?: boolean

        ZMQ_CONFLATE

        If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Push

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

conflate: boolean

ZMQ_CONFLATE

If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

type: SocketType

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disonnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) -

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Parameters

    • option: number
    • value: boolean

    Returns void

  • Parameters

    • option: number
    • value: null | string | Buffer

    Returns void

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file +Push | zeromq.js

Class Push

A Push socket is used by a pipeline node to send messages to downstream pipeline nodes. Messages are round-robined to all connected downstream nodes. This socket cannot receive messages.

When a Push socket enters the mute state due to having reached the high water mark for all downstream nodes, or if there are no downstream nodes at all, then Writable.send() will block until the mute state ends or at least one downstream node becomes available for sending; messages are not discarded.

import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Push()

await sock.bind("tcp://127.0.0.1:3000")
console.log("Producer bound to port 3000")

// eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition
while (true) {
await sock.send("some work")
await new Promise(resolve => {
setTimeout(resolve, 500)
})
}
}

run().catch(console.error)
+

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          conflate?: boolean;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • Optionalconflate?: boolean

        ZMQ_CONFLATE

        If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Push

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

conflate: boolean

ZMQ_CONFLATE

If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disconnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) +

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file diff --git a/classes/Reply.html b/classes/Reply.html index a1bf4bf7..6c2c7274 100644 --- a/classes/Reply.html +++ b/classes/Reply.html @@ -1,9 +1,10 @@ -Reply | zeromq.js

Class Reply

A Reply socket can act as a server which receives requests from and sends replies to a Request socket. This socket type allows only an alternating sequence of Readable.receive() and subsequent Writable.send() calls. Each request received is fair-queued from among all clients, and each reply sent is routed to the client that issued the last request. If the original requester does not exist any more the reply is silently discarded.

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          routingId?: null | string;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalroutingId?: null | string

        ZMQ_ROUTING_ID

        The identity of the specified socket when connecting to a Router socket.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Reply

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

routingId: null | string

ZMQ_ROUTING_ID

The identity of the specified socket when connecting to a Router socket.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

type: SocketType

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Asynchronously iterate over messages becoming available on the socket. When the socket is closed with Socket.close(), the iterator will return. Returning early from the iterator will not close the socket unless it also goes out of scope.

    for await (const [msg] of socket) {
    // handle messages
    } -

    Returns AsyncIterator<Buffer[]>

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disonnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() -

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error -

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) -

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Parameters

    • option: number
    • value: boolean

    Returns void

  • Parameters

    • option: number
    • value: null | string | Buffer

    Returns void

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file +Reply | zeromq.js

Class Reply

A Reply socket can act as a server which receives requests from and sends replies to a Request socket. This socket type allows only an alternating sequence of Readable.receive() and subsequent Writable.send() calls. Each request received is fair-queued from among all clients, and each reply sent is routed to the client that issued the last request. If the original requester does not exist any more the reply is silently discarded.

import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Reply()

await sock.bind("tcp://127.0.0.1:3000")

for await (const [msg] of sock) {
// parse the message as a number
const value = parseInt(msg.toString(), 10)

// calculate the result and send it back to the client
const result = 2 * value
await sock.send(result)
}
}

run().catch(console.error)
+

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          routingId?: null | string;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalroutingId?: null | string

        ZMQ_ROUTING_ID

        The identity of the specified socket when connecting to a Router socket.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Reply

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

routingId: null | string

ZMQ_ROUTING_ID

The identity of the specified socket when connecting to a Router socket.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disconnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() +

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error +

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) +

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file diff --git a/classes/Request.html b/classes/Request.html index 926c70e8..5212f8d5 100644 --- a/classes/Request.html +++ b/classes/Request.html @@ -1,9 +1,10 @@ -Request | zeromq.js

Class Request

A Request socket acts as a client to send requests to and receive replies from a Reply socket. This socket allows only an alternating sequence of Writable.send() and subsequent Readable.receive() calls. Each request sent is round-robined among all services, and each reply received is matched with the last issued request.

If no services are available, then any send operation on the socket shall block until at least one service becomes available. The REQ socket shall not discard messages.

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          connectTimeout?: number;
          context?: Context;
          correlate?: boolean;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          probeRouter?: boolean;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          relaxed?: boolean;
          routingId?: null | string;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • Optionalcorrelate?: boolean

        ZMQ_REQ_CORRELATE

        The default behaviour of Request sockets is to rely on the ordering of messages to match requests and responses and that is usually sufficient. When this option is set to true the socket will prefix outgoing messages with an extra frame containing a request id. That means the full message is [<request id>,null, user frames…]. The Request socket will discard all incoming messages that don't begin with these two frames.

      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalprobeRouter?: boolean

        ZMQ_PROBE_ROUTER

        When set to true, the socket will automatically send an empty message when a new connection is made or accepted. You may set this on sockets connected to a Router socket. The application must filter such empty messages. This option provides the Router with an event signaling the arrival of a new peer.

        Warning:* Do not set this option on a socket that talks to any other socket type except Router: the results are undefined.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • Optionalrelaxed?: boolean

        ZMQ_REQ_RELAXED

        By default, a Request socket does not allow initiating a new request until the reply to the previous one has been received. When set to true, sending another message is allowed and previous replies will be discarded. The request-reply state machine is reset and a new request is sent to the next available peer.

        Note: If set to true, also enable correlate to ensure correct matching of requests and replies. Otherwise a late reply to an aborted request can be reported as the reply to the superseding request.

      • OptionalroutingId?: null | string

        ZMQ_ROUTING_ID

        The identity of the specified socket when connecting to a Router socket.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Request

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

correlate: boolean

ZMQ_REQ_CORRELATE

The default behaviour of Request sockets is to rely on the ordering of messages to match requests and responses and that is usually sufficient. When this option is set to true the socket will prefix outgoing messages with an extra frame containing a request id. That means the full message is [<request id>,null, user frames…]. The Request socket will discard all incoming messages that don't begin with these two frames.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

probeRouter: boolean

ZMQ_PROBE_ROUTER

When set to true, the socket will automatically send an empty message when a new connection is made or accepted. You may set this on sockets connected to a Router socket. The application must filter such empty messages. This option provides the Router with an event signaling the arrival of a new peer.

Warning:* Do not set this option on a socket that talks to any other socket type except Router: the results are undefined.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

relaxed: boolean

ZMQ_REQ_RELAXED

By default, a Request socket does not allow initiating a new request until the reply to the previous one has been received. When set to true, sending another message is allowed and previous replies will be discarded. The request-reply state machine is reset and a new request is sent to the next available peer.

Note: If set to true, also enable correlate to ensure correct matching of requests and replies. Otherwise a late reply to an aborted request can be reported as the reply to the superseding request.

routingId: null | string

ZMQ_ROUTING_ID

The identity of the specified socket when connecting to a Router socket.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

type: SocketType

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Asynchronously iterate over messages becoming available on the socket. When the socket is closed with Socket.close(), the iterator will return. Returning early from the iterator will not close the socket unless it also goes out of scope.

    for await (const [msg] of socket) {
    // handle messages
    } -

    Returns AsyncIterator<Buffer[]>

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disonnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() -

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error -

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) -

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Parameters

    • option: number
    • value: boolean

    Returns void

  • Parameters

    • option: number
    • value: null | string | Buffer

    Returns void

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file +Request | zeromq.js

Class Request

A Request socket acts as a client to send requests to and receive replies from a Reply socket. This socket allows only an alternating sequence of Writable.send() and subsequent Readable.receive() calls. Each request sent is round-robined among all services, and each reply received is matched with the last issued request.

If no services are available, then any send operation on the socket shall block until at least one service becomes available. The REQ socket shall not discard messages.

import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Request()

sock.connect("tcp://127.0.0.1:3000")
console.log("Producer bound to port 3000")

await sock.send(4)
console.log("Request a calculation for 4")

const [result] = await sock.receive()
console.log(`Received result: ${result}`)
}

run().catch(console.error)
+

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          connectTimeout?: number;
          context?: Context;
          correlate?: boolean;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          probeRouter?: boolean;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          relaxed?: boolean;
          routingId?: null | string;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • Optionalcorrelate?: boolean

        ZMQ_REQ_CORRELATE

        The default behaviour of Request sockets is to rely on the ordering of messages to match requests and responses and that is usually sufficient. When this option is set to true the socket will prefix outgoing messages with an extra frame containing a request id. That means the full message is [<request id>,null, user frames…]. The Request socket will discard all incoming messages that don't begin with these two frames.

      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalprobeRouter?: boolean

        ZMQ_PROBE_ROUTER

        When set to true, the socket will automatically send an empty message when a new connection is made or accepted. You may set this on sockets connected to a Router socket. The application must filter such empty messages. This option provides the Router with an event signaling the arrival of a new peer.

        Warning:* Do not set this option on a socket that talks to any other socket type except Router: the results are undefined.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • Optionalrelaxed?: boolean

        ZMQ_REQ_RELAXED

        By default, a Request socket does not allow initiating a new request until the reply to the previous one has been received. When set to true, sending another message is allowed and previous replies will be discarded. The request-reply state machine is reset and a new request is sent to the next available peer.

        Note: If set to true, also enable correlate to ensure correct matching of requests and replies. Otherwise a late reply to an aborted request can be reported as the reply to the superseding request.

      • OptionalroutingId?: null | string

        ZMQ_ROUTING_ID

        The identity of the specified socket when connecting to a Router socket.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Request

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

correlate: boolean

ZMQ_REQ_CORRELATE

The default behaviour of Request sockets is to rely on the ordering of messages to match requests and responses and that is usually sufficient. When this option is set to true the socket will prefix outgoing messages with an extra frame containing a request id. That means the full message is [<request id>,null, user frames…]. The Request socket will discard all incoming messages that don't begin with these two frames.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

probeRouter: boolean

ZMQ_PROBE_ROUTER

When set to true, the socket will automatically send an empty message when a new connection is made or accepted. You may set this on sockets connected to a Router socket. The application must filter such empty messages. This option provides the Router with an event signaling the arrival of a new peer.

Warning:* Do not set this option on a socket that talks to any other socket type except Router: the results are undefined.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

relaxed: boolean

ZMQ_REQ_RELAXED

By default, a Request socket does not allow initiating a new request until the reply to the previous one has been received. When set to true, sending another message is allowed and previous replies will be discarded. The request-reply state machine is reset and a new request is sent to the next available peer.

Note: If set to true, also enable correlate to ensure correct matching of requests and replies. Otherwise a late reply to an aborted request can be reported as the reply to the superseding request.

routingId: null | string

ZMQ_ROUTING_ID

The identity of the specified socket when connecting to a Router socket.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disconnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() +

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error +

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) +

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file diff --git a/classes/Router.html b/classes/Router.html index 72e1be45..1097daf8 100644 --- a/classes/Router.html +++ b/classes/Router.html @@ -1,8 +1,8 @@ -Router | zeromq.js

Class Router

A Router can be used to extend request/reply sockets. When receiving messages a Router shall prepend a message part containing the routing id of the originating peer to the message. Messages received are fair-queued from among all connected peers. When sending messages, the first part of the message is removed and used to determine the routing id of the peer the message should be routed to.

If the peer does not exist anymore, or has never existed, the message shall be silently discarded. However, if Router.mandatory is set to true, the socket shall fail with a EHOSTUNREACH error in both cases.

When a Router enters the mute state due to having reached the high water mark for all peers, then any messages sent to the socket shall be dropped until the mute state ends. Likewise, any messages routed to a peer for which the individual high water mark has been reached shall also be dropped. If Router.mandatory is set to true the socket shall block or return an EAGAIN error in both cases.

When a Request socket is connected to a Router, in addition to the routing id of the originating peer each message received shall contain an empty delimiter message part. Hence, the entire structure of each received message as seen by the application becomes: one or more routing id parts, delimiter part, one or more body parts. When sending replies to a Request the delimiter part must be included.

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handover?: boolean;
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          mandatory?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          probeRouter?: boolean;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          routingId?: null | string;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • Optionalhandover?: boolean

        ZMQ_ROUTER_HANDOVER

        If two clients use the same identity when connecting to a Router, the results shall depend on the this option. If it set to false (default), the Router socket shall reject clients trying to connect with an already-used identity. If it is set to true, the Router socket shall hand-over the connection to the new client and disconnect the existing one.

      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • Optionalmandatory?: boolean

        ZMQ_ROUTER_MANDATORY

        A value of false is the default and discards the message silently when it cannot be routed or the peer's high water mark is reached. A value of true causes send() to fail if it cannot be routed, or wait asynchronously if the high water mark is reached.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalprobeRouter?: boolean

        ZMQ_PROBE_ROUTER

        When set to true, the socket will automatically send an empty message when a new connection is made or accepted. You may set this on sockets connected to a Router socket. The application must filter such empty messages. This option provides the Router with an event signaling the arrival of a new peer.

        Warning:* Do not set this option on a socket that talks to any other socket type except Router: the results are undefined.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalroutingId?: null | string

        ZMQ_ROUTING_ID

        The identity of the specified socket when connecting to a Router socket.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Router

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handover: boolean

ZMQ_ROUTER_HANDOVER

If two clients use the same identity when connecting to a Router, the results shall depend on the this option. If it set to false (default), the Router socket shall reject clients trying to connect with an already-used identity. If it is set to true, the Router socket shall hand-over the connection to the new client and disconnect the existing one.

handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

mandatory: boolean

ZMQ_ROUTER_MANDATORY

A value of false is the default and discards the message silently when it cannot be routed or the peer's high water mark is reached. A value of true causes send() to fail if it cannot be routed, or wait asynchronously if the high water mark is reached.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

probeRouter: boolean

ZMQ_PROBE_ROUTER

When set to true, the socket will automatically send an empty message when a new connection is made or accepted. You may set this on sockets connected to a Router socket. The application must filter such empty messages. This option provides the Router with an event signaling the arrival of a new peer.

Warning:* Do not set this option on a socket that talks to any other socket type except Router: the results are undefined.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

routingId: null | string

ZMQ_ROUTING_ID

The identity of the specified socket when connecting to a Router socket.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

type: SocketType

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Asynchronously iterate over messages becoming available on the socket. When the socket is closed with Socket.close(), the iterator will return. Returning early from the iterator will not close the socket unless it also goes out of scope.

    for await (const [msg] of socket) {
    // handle messages
    } -

    Returns AsyncIterator<Buffer[]>

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the given remote address. To specificy a specific routing id, provide a routingId option. The identity should be unique, from 1 to 255 bytes long and MAY NOT start with binary zero.

    Parameters

    • address: string

      The tcp:// address to connect to.

    • options: RouterConnectOptions = {}

      Any connection options.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disonnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() -

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error -

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) -

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Parameters

    • option: number
    • value: boolean

    Returns void

  • Parameters

    • option: number
    • value: null | string | Buffer

    Returns void

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file +Router | zeromq.js

Class Router

A Router can be used to extend request/reply sockets. When receiving messages a Router shall prepend a message part containing the routing id of the originating peer to the message. Messages received are fair-queued from among all connected peers. When sending messages, the first part of the message is removed and used to determine the routing id of the peer the message should be routed to.

If the peer does not exist anymore, or has never existed, the message shall be silently discarded. However, if Router.mandatory is set to true, the socket shall fail with a EHOSTUNREACH error in both cases.

When a Router enters the mute state due to having reached the high water mark for all peers, then any messages sent to the socket shall be dropped until the mute state ends. Likewise, any messages routed to a peer for which the individual high water mark has been reached shall also be dropped. If Router.mandatory is set to true the socket shall block or return an EAGAIN error in both cases.

When a Request socket is connected to a Router, in addition to the routing id of the originating peer each message received shall contain an empty delimiter message part. Hence, the entire structure of each received message as seen by the application becomes: one or more routing id parts, delimiter part, one or more body parts. When sending replies to a Request the delimiter part must be included.

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handover?: boolean;
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          mandatory?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          probeRouter?: boolean;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          routingId?: null | string;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • Optionalhandover?: boolean

        ZMQ_ROUTER_HANDOVER

        If two clients use the same identity when connecting to a Router, the results shall depend on the this option. If it set to false (default), the Router socket shall reject clients trying to connect with an already-used identity. If it is set to true, the Router socket shall hand-over the connection to the new client and disconnect the existing one.

      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • Optionalmandatory?: boolean

        ZMQ_ROUTER_MANDATORY

        A value of false is the default and discards the message silently when it cannot be routed or the peer's high water mark is reached. A value of true causes send() to fail if it cannot be routed, or wait asynchronously if the high water mark is reached.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalprobeRouter?: boolean

        ZMQ_PROBE_ROUTER

        When set to true, the socket will automatically send an empty message when a new connection is made or accepted. You may set this on sockets connected to a Router socket. The application must filter such empty messages. This option provides the Router with an event signaling the arrival of a new peer.

        Warning:* Do not set this option on a socket that talks to any other socket type except Router: the results are undefined.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalroutingId?: null | string

        ZMQ_ROUTING_ID

        The identity of the specified socket when connecting to a Router socket.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Router

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handover: boolean

ZMQ_ROUTER_HANDOVER

If two clients use the same identity when connecting to a Router, the results shall depend on the this option. If it set to false (default), the Router socket shall reject clients trying to connect with an already-used identity. If it is set to true, the Router socket shall hand-over the connection to the new client and disconnect the existing one.

handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

mandatory: boolean

ZMQ_ROUTER_MANDATORY

A value of false is the default and discards the message silently when it cannot be routed or the peer's high water mark is reached. A value of true causes send() to fail if it cannot be routed, or wait asynchronously if the high water mark is reached.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

probeRouter: boolean

ZMQ_PROBE_ROUTER

When set to true, the socket will automatically send an empty message when a new connection is made or accepted. You may set this on sockets connected to a Router socket. The application must filter such empty messages. This option provides the Router with an event signaling the arrival of a new peer.

Warning:* Do not set this option on a socket that talks to any other socket type except Router: the results are undefined.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

routingId: null | string

ZMQ_ROUTING_ID

The identity of the specified socket when connecting to a Router socket.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the given remote address. To specificy a specific routing id, provide a routingId option. The identity should be unique, from 1 to 255 bytes long and MAY NOT start with binary zero.

    Parameters

    • address: string

      The tcp:// address to connect to.

    • options: RouterConnectOptions = {}

      Any connection options.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disconnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() +

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error +

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) +

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file diff --git a/classes/Socket.html b/classes/Socket.html index 9bc79054..ec746211 100644 --- a/classes/Socket.html +++ b/classes/Socket.html @@ -1,6 +1,6 @@ -Socket | zeromq.js

Class SocketAbstract

A ØMQ socket. This class should generally not be used directly. Instead, create one of its subclasses that corresponds to the socket type you want to use.

new zmq.Pair(...)
new zmq.Publisher(...)
new zmq.Subscriber(...)
new zmq.Request(...)
new zmq.Reply(...)
new zmq.Dealer(...)
new zmq.Router(...)
new zmq.Pull(...)
new zmq.Push(...)
new zmq.XPublisher(...)
new zmq.XSubscriber(...)
new zmq.Stream(...) -

Socket options can be set during construction or via a property after the socket was created. Most socket options do not take effect until the next bind() or connect() call. Setting such an option after the socket is already connected or bound will display a warning.

Hierarchy (View Summary)

Constructors

  • Creates a new socket of the specified type. Subclasses are expected to provide the correct socket type.

    Parameters

    • type: SocketType

      The socket type.

    • Optionaloptions: {}

      Any options to set during construction.

    Returns Socket

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

type: SocketType

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disonnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Parameters

    • option: number

    Returns boolean

  • Parameters

    • option: number

    Returns number

  • Parameters

    • option: number

    Returns number

  • Parameters

    • option: number

    Returns null | string

  • Parameters

    • option: number

    Returns number

  • Parameters

    • option: number

    Returns number

  • Parameters

    • option: number
    • value: boolean

    Returns void

  • Parameters

    • option: number
    • value: number

    Returns void

  • Parameters

    • option: number
    • value: number

    Returns void

  • Parameters

    • option: number
    • value: null | string | Buffer

    Returns void

  • Parameters

    • option: number
    • value: number

    Returns void

  • Parameters

    • option: number
    • value: number

    Returns void

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file +Socket | zeromq.js

Class SocketAbstract

A ØMQ socket. This class should generally not be used directly. Instead, create one of its subclasses that corresponds to the socket type you want to use.

new zmq.Pair(...)
new zmq.Publisher(...)
new zmq.Subscriber(...)
new zmq.Request(...)
new zmq.Reply(...)
new zmq.Dealer(...)
new zmq.Router(...)
new zmq.Pull(...)
new zmq.Push(...)
new zmq.XPublisher(...)
new zmq.XSubscriber(...)
new zmq.Stream(...) +

Socket options can be set during construction or via a property after the socket was created. Most socket options do not take effect until the next bind() or connect() call. Setting such an option after the socket is already connected or bound will display a warning.

Hierarchy (View Summary)

Constructors

  • Creates a new socket of the specified type. Subclasses are expected to provide the correct socket type.

    Parameters

    • type: SocketType

      The socket type.

    • Optionaloptions: {}

      Any options to set during construction.

    Returns Socket

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disconnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Parameters

    • option: number

    Returns boolean

  • Parameters

    • option: number

    Returns number

  • Parameters

    • option: number

    Returns number

  • Parameters

    • option: number

    Returns null | string

  • Parameters

    • option: number

    Returns number

  • Parameters

    • option: number

    Returns number

  • Parameters

    • option: number
    • value: boolean

    Returns void

  • Parameters

    • option: number
    • value: number

    Returns void

  • Parameters

    • option: number
    • value: number

    Returns void

  • Parameters

    • option: number
    • value: null | string | Buffer

    Returns void

  • Parameters

    • option: number
    • value: number

    Returns void

  • Parameters

    • option: number
    • value: number

    Returns void

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file diff --git a/classes/Stream.html b/classes/Stream.html index a8467330..9e8b602b 100644 --- a/classes/Stream.html +++ b/classes/Stream.html @@ -1,8 +1,8 @@ -Stream | zeromq.js

Class Stream

A Stream is used to send and receive TCP data from a non-ØMQ peer with the tcp:// transport. A Stream can act as client and/or server, sending and/or receiving TCP data asynchronously.

When sending and receiving data with Writable.send() and Readable.receive(), the first message part shall be the routing id of the peer. Unroutable messages will cause an error.

When a connection is made to a Stream, a zero-length message will be received. Similarly, when the peer disconnects (or the connection is lost), a zero-length message will be received.

To close a specific connection, Writable.send() the routing id frame followed by a zero-length message.

To open a connection to a server, use Stream.connect().

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          notify?: boolean;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • Optionalnotify?: boolean

        ZMQ_STREAM_NOTIFY

        Enables connect and disconnect notifications on a Stream when set to true. When notifications are enabled, the socket delivers a zero-length message when a peer connects or disconnects.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Stream

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

notify: boolean

ZMQ_STREAM_NOTIFY

Enables connect and disconnect notifications on a Stream when set to true. When notifications are enabled, the socket delivers a zero-length message when a peer connects or disconnects.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

type: SocketType

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Asynchronously iterate over messages becoming available on the socket. When the socket is closed with Socket.close(), the iterator will return. Returning early from the iterator will not close the socket unless it also goes out of scope.

    for await (const [msg] of socket) {
    // handle messages
    } -

    Returns AsyncIterator<[Buffer, Buffer]>

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the given remote address. To specificy a specific routing id, provide a routingId option. The identity should be unique, from 1 to 255 bytes long and MAY NOT start with binary zero.

    Parameters

    • address: string

      The tcp:// address to connect to.

    • options: StreamConnectOptions = {}

      Any connection options.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disonnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() -

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error -

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<[Buffer, Buffer]>

    Resolved with message parts that were successfully read.

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) -

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: [MessageLike, MessageLike]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Parameters

    • option: number
    • value: boolean

    Returns void

  • Parameters

    • option: number
    • value: null | string | Buffer

    Returns void

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file +Stream | zeromq.js

Class Stream

A Stream is used to send and receive TCP data from a non-ØMQ peer with the tcp:// transport. A Stream can act as client and/or server, sending and/or receiving TCP data asynchronously.

When sending and receiving data with Writable.send() and Readable.receive(), the first message part shall be the routing id of the peer. Unroutable messages will cause an error.

When a connection is made to a Stream, a zero-length message will be received. Similarly, when the peer disconnects (or the connection is lost), a zero-length message will be received.

To close a specific connection, Writable.send() the routing id frame followed by a zero-length message.

To open a connection to a server, use Stream.connect().

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          notify?: boolean;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • Optionalnotify?: boolean

        ZMQ_STREAM_NOTIFY

        Enables connect and disconnect notifications on a Stream when set to true. When notifications are enabled, the socket delivers a zero-length message when a peer connects or disconnects.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Stream

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

notify: boolean

ZMQ_STREAM_NOTIFY

Enables connect and disconnect notifications on a Stream when set to true. When notifications are enabled, the socket delivers a zero-length message when a peer connects or disconnects.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the given remote address. To specificy a specific routing id, provide a routingId option. The identity should be unique, from 1 to 255 bytes long and MAY NOT start with binary zero.

    Parameters

    • address: string

      The tcp:// address to connect to.

    • options: StreamConnectOptions = {}

      Any connection options.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disconnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() +

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error +

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<[Buffer, Buffer]>

    Resolved with message parts that were successfully read.

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) +

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: [MessageLike, MessageLike]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file diff --git a/classes/Subscriber.html b/classes/Subscriber.html index 62479ed9..65f0897e 100644 --- a/classes/Subscriber.html +++ b/classes/Subscriber.html @@ -1,10 +1,11 @@ -Subscriber | zeromq.js

Class Subscriber

A Subscriber socket is used to subscribe to data distributed by a Publisher. Initially a Subscriber is not subscribed to any messages. Use Subscriber.subscribe() to specify which messages to subscribe to. This socket cannot send messages.

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          conflate?: boolean;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          invertMatching?: boolean;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • Optionalconflate?: boolean

        ZMQ_CONFLATE

        If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • OptionalinvertMatching?: boolean

        ZMQ_INVERT_MATCHING

        Causes incoming messages that do not match any of the socket's subscriptions to be received by the user.

        All Subscriber sockets connecting to a Publisher must also have the option set to true. Failure to do so will have the Subscriber sockets reject everything the Publisher socket sends them.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Subscriber

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

conflate: boolean

ZMQ_CONFLATE

If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

invertMatching: boolean

ZMQ_INVERT_MATCHING

Causes incoming messages that do not match any of the socket's subscriptions to be received by the user.

All Subscriber sockets connecting to a Publisher must also have the option set to true. Failure to do so will have the Subscriber sockets reject everything the Publisher socket sends them.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

type: SocketType

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Asynchronously iterate over messages becoming available on the socket. When the socket is closed with Socket.close(), the iterator will return. Returning early from the iterator will not close the socket unless it also goes out of scope.

    for await (const [msg] of socket) {
    // handle messages
    } -

    Returns AsyncIterator<Buffer[]>

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disonnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() -

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error -

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Parameters

    • option: number
    • value: boolean

    Returns void

  • Parameters

    • option: number
    • value: null | string | Buffer

    Returns void

  • Establish a new message filter. Newly created Subsriber sockets will filtered out all incoming messages. Call this method to subscribe to messages beginning with the given prefix.

    Multiple filters may be attached to a single socket, in which case a message shall be accepted if it matches at least one filter. Subscribing without any filters shall subscribe to all incoming messages.

    const sub = new Subscriber()

    // Listen to all messages beginning with 'foo'.
    sub.subscribe("foo")

    // Listen to all incoming messages.
    sub.subscribe() -

    Parameters

    • ...prefixes: (string | Buffer)[]

      The prefixes of messages to subscribe to.

    Returns void

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

  • Remove an existing message filter which was previously established with subscribe(). Stops receiving messages with the given prefix.

    Unsubscribing without any filters shall unsubscribe from the "subscribe all" filter that is added by calling subscribe() without arguments.

    const sub = new Subscriber()

    // Listen to all messages beginning with 'foo'.
    sub.subscribe("foo")
    // ...

    // Stop listening to messages beginning with 'foo'.
    sub.unsubscribe("foo") -

    Parameters

    • ...prefixes: (string | Buffer)[]

      The prefixes of messages to subscribe to.

    Returns void

\ No newline at end of file +Subscriber | zeromq.js

Class Subscriber

A Subscriber socket is used to subscribe to data distributed by a Publisher. Initially a Subscriber is not subscribed to any messages. Use Subscriber.subscribe() to specify which messages to subscribe to. This socket cannot send messages.

import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Subscriber()

sock.connect("tcp://127.0.0.1:3000")
sock.subscribe("kitty cats")
console.log("Subscriber connected to port 3000")

for await (const [topic, msg] of sock) {
console.log(
"received a message related to:",
topic,
"containing message:",
msg,
)
}
}

run().catch(console.error)
+

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          conflate?: boolean;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          invertMatching?: boolean;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • Optionalconflate?: boolean

        ZMQ_CONFLATE

        If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • OptionalinvertMatching?: boolean

        ZMQ_INVERT_MATCHING

        Causes incoming messages that do not match any of the socket's subscriptions to be received by the user.

        All Subscriber sockets connecting to a Publisher must also have the option set to true. Failure to do so will have the Subscriber sockets reject everything the Publisher socket sends them.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns Subscriber

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

conflate: boolean

ZMQ_CONFLATE

If set to true, a socket shall keep only one message in its inbound/outbound queue: the last message to be received/sent. Ignores any high water mark options. Does not support multi-part messages - in particular, only one part of it is kept in the socket internal queue.

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

invertMatching: boolean

ZMQ_INVERT_MATCHING

Causes incoming messages that do not match any of the socket's subscriptions to be received by the user.

All Subscriber sockets connecting to a Publisher must also have the option set to true. Failure to do so will have the Subscriber sockets reject everything the Publisher socket sends them.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disconnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() +

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error +

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Establish a new message filter. Newly created Subscriber sockets will filtered out all incoming messages. Call this method to subscribe to messages beginning with the given prefix.

    Multiple filters may be attached to a single socket, in which case a message shall be accepted if it matches at least one filter. Subscribing without any filters shall subscribe to all incoming messages.

    const sub = new Subscriber()

    // Listen to all messages beginning with 'foo'.
    sub.subscribe("foo")

    // Listen to all incoming messages.
    sub.subscribe() +

    Parameters

    • ...prefixes: (string | Buffer)[]

      The prefixes of messages to subscribe to.

    Returns void

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

  • Remove an existing message filter which was previously established with subscribe(). Stops receiving messages with the given prefix.

    Unsubscribing without any filters shall unsubscribe from the "subscribe all" filter that is added by calling subscribe() without arguments.

    const sub = new Subscriber()

    // Listen to all messages beginning with 'foo'.
    sub.subscribe("foo")
    // ...

    // Stop listening to messages beginning with 'foo'.
    sub.unsubscribe("foo") +

    Parameters

    • ...prefixes: (string | Buffer)[]

      The prefixes of messages to subscribe to.

    Returns void

\ No newline at end of file diff --git a/classes/XPublisher.html b/classes/XPublisher.html index 0bb66917..054f0d82 100644 --- a/classes/XPublisher.html +++ b/classes/XPublisher.html @@ -1,9 +1,9 @@ -XPublisher | zeromq.js

Class XPublisher

Same as Publisher, except that you can receive subscriptions from the peers in form of incoming messages. Subscription message is a byte 1 (for subscriptions) or byte 0 (for unsubscriptions) followed by the subscription body. Messages without a sub/unsub prefix are also received, but have no effect on subscription status.

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          invertMatching?: boolean;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          manual?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          noDrop?: boolean;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          verbosity?: null | "allSubs" | "allSubsUnsubs";
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          welcomeMessage?: null | string;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • OptionalinvertMatching?: boolean

        ZMQ_INVERT_MATCHING

        Causes messages to be sent to all connected sockets except those subscribed to a prefix that matches the message.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • Optionalmanual?: boolean

        ZMQ_XPUB_MANUAL

        Sets the XPublisher socket subscription handling mode to manual/automatic. A value of true will change the subscription requests handling to manual.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalnoDrop?: boolean

        ZMQ_XPUB_NODROP

        Sets the socket behaviour to return an error if the high water mark is reached and the message could not be send. The default is to drop the message silently when the peer high water mark is reached.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • Optionalverbosity?: null | "allSubs" | "allSubsUnsubs"
      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalwelcomeMessage?: null | string

        ZMQ_XPUB_WELCOME_MSG

        Sets a welcome message that will be recieved by subscriber when connecting. Subscriber must subscribe to the welcome message before connecting. For welcome messages to work well, poll on incoming subscription messages on the XPublisher socket and handle them.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns XPublisher

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

invertMatching: boolean

ZMQ_INVERT_MATCHING

Causes messages to be sent to all connected sockets except those subscribed to a prefix that matches the message.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

manual: boolean

ZMQ_XPUB_MANUAL

Sets the XPublisher socket subscription handling mode to manual/automatic. A value of true will change the subscription requests handling to manual.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

noDrop: boolean

ZMQ_XPUB_NODROP

Sets the socket behaviour to return an error if the high water mark is reached and the message could not be send. The default is to drop the message silently when the peer high water mark is reached.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

type: SocketType

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

welcomeMessage: null | string

ZMQ_XPUB_WELCOME_MSG

Sets a welcome message that will be recieved by subscriber when connecting. Subscriber must subscribe to the welcome message before connecting. For welcome messages to work well, poll on incoming subscription messages on the XPublisher socket and handle them.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Accessors

  • set verbosity(value: null | "allSubs" | "allSubsUnsubs"): void
  • ZMQ_XPUB_VERBOSE / ZMQ_XPUB_VERBOSER

    Whether to pass any duplicate subscription/unsuscription messages.

    • null (default) - Only unique subscribe and unsubscribe messages are visible to the caller.
    • "allSubs" - All subscribe messages (including duplicates) are visible to the caller, but only unique unsubscribe messages are visible.
    • "allSubsUnsubs" - All subscribe and unsubscribe messages (including duplicates) are visible to the caller.

    Parameters

    • value: null | "allSubs" | "allSubsUnsubs"

    Returns void

Methods

  • Asynchronously iterate over messages becoming available on the socket. When the socket is closed with Socket.close(), the iterator will return. Returning early from the iterator will not close the socket unless it also goes out of scope.

    for await (const [msg] of socket) {
    // handle messages
    } -

    Returns AsyncIterator<Buffer[]>

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disonnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() -

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error -

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) -

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Parameters

    • option: number
    • value: boolean

    Returns void

  • Parameters

    • option: number
    • value: null | string | Buffer

    Returns void

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file +XPublisher | zeromq.js

Class XPublisher

Same as Publisher, except that you can receive subscriptions from the peers in form of incoming messages. Subscription message is a byte 1 (for subscriptions) or byte 0 (for unsubscriptions) followed by the subscription body. Messages without a sub/unsub prefix are also received, but have no effect on subscription status.

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          invertMatching?: boolean;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          manual?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          noDrop?: boolean;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          verbosity?: null | "allSubs" | "allSubsUnsubs";
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          welcomeMessage?: null | string;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • OptionalinvertMatching?: boolean

        ZMQ_INVERT_MATCHING

        Causes messages to be sent to all connected sockets except those subscribed to a prefix that matches the message.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • Optionalmanual?: boolean

        ZMQ_XPUB_MANUAL

        Sets the XPublisher socket subscription handling mode to manual/automatic. A value of true will change the subscription requests handling to manual.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalnoDrop?: boolean

        ZMQ_XPUB_NODROP

        Sets the socket behaviour to return an error if the high water mark is reached and the message could not be send. The default is to drop the message silently when the peer high water mark is reached.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • Optionalverbosity?: null | "allSubs" | "allSubsUnsubs"
      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalwelcomeMessage?: null | string

        ZMQ_XPUB_WELCOME_MSG

        Sets a welcome message that will be recieved by subscriber when connecting. Subscriber must subscribe to the welcome message before connecting. For welcome messages to work well, poll on incoming subscription messages on the XPublisher socket and handle them.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns XPublisher

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

invertMatching: boolean

ZMQ_INVERT_MATCHING

Causes messages to be sent to all connected sockets except those subscribed to a prefix that matches the message.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

manual: boolean

ZMQ_XPUB_MANUAL

Sets the XPublisher socket subscription handling mode to manual/automatic. A value of true will change the subscription requests handling to manual.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

noDrop: boolean

ZMQ_XPUB_NODROP

Sets the socket behaviour to return an error if the high water mark is reached and the message could not be send. The default is to drop the message silently when the peer high water mark is reached.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

welcomeMessage: null | string

ZMQ_XPUB_WELCOME_MSG

Sets a welcome message that will be recieved by subscriber when connecting. Subscriber must subscribe to the welcome message before connecting. For welcome messages to work well, poll on incoming subscription messages on the XPublisher socket and handle them.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Accessors

  • set verbosity(value: null | "allSubs" | "allSubsUnsubs"): void
  • ZMQ_XPUB_VERBOSE / ZMQ_XPUB_VERBOSER

    Whether to pass any duplicate subscription/unsuscription messages.

    • null (default) - Only unique subscribe and unsubscribe messages are visible to the caller.
    • "allSubs" - All subscribe messages (including duplicates) are visible to the caller, but only unique unsubscribe messages are visible.
    • "allSubsUnsubs" - All subscribe and unsubscribe messages (including duplicates) are visible to the caller.

    Parameters

    • value: null | "allSubs" | "allSubsUnsubs"

    Returns void

Methods

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disconnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() +

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error +

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) +

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file diff --git a/classes/XSubscriber.html b/classes/XSubscriber.html index 32afabd3..e558ca79 100644 --- a/classes/XSubscriber.html +++ b/classes/XSubscriber.html @@ -1,9 +1,9 @@ -XSubscriber | zeromq.js

Class XSubscriber

Same as Subscriber, except that you subscribe by sending subscription messages to the socket. Subscription message is a byte 1 (for subscriptions) or byte 0 (for unsubscriptions) followed by the subscription body. Messages without a sub/unsub prefix may also be sent, but have no effect on subscription status.

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns XSubscriber

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

type: SocketType

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Asynchronously iterate over messages becoming available on the socket. When the socket is closed with Socket.close(), the iterator will return. Returning early from the iterator will not close the socket unless it also goes out of scope.

    for await (const [msg] of socket) {
    // handle messages
    } -

    Returns AsyncIterator<Buffer[]>

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port -

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disonnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    -

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() -

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error -

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) -

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Parameters

    • option: number
    • value: boolean

    Returns void

  • Parameters

    • option: number
    • value: null | string | Buffer

    Returns void

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file +XSubscriber | zeromq.js

Class XSubscriber

Same as Subscriber, except that you subscribe by sending subscription messages to the socket. Subscription message is a byte 1 (for subscriptions) or byte 0 (for unsubscriptions) followed by the subscription body. Messages without a sub/unsub prefix may also be sent, but have no effect on subscription status.

Hierarchy (View Summary)

Constructors

  • Parameters

    • Optionaloptions: {
          affinity?: number;
          backlog?: number;
          connectTimeout?: number;
          context?: Context;
          curvePublicKey?: null | string;
          curveSecretKey?: null | string;
          curveServer?: boolean;
          curveServerKey?: null | string;
          gssapiPlainText?: boolean;
          gssapiPrincipal?: null | string;
          gssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          gssapiServer?: boolean;
          gssapiServicePrincipal?: null | string;
          gssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal";
          handshakeInterval?: number;
          heartbeatInterval?: number;
          heartbeatTimeout?: number;
          heartbeatTimeToLive?: number;
          immediate?: boolean;
          interface?: null | string;
          ipv6?: boolean;
          linger?: number;
          loopbackFastPath?: boolean;
          maxMessageSize?: number;
          multicastHops?: number;
          multicastMaxTransportDataUnit?: number;
          plainPassword?: null | string;
          plainServer?: boolean;
          plainUsername?: null | string;
          rate?: number;
          receiveBufferSize?: number;
          receiveHighWaterMark?: number;
          receiveTimeout?: number;
          reconnectInterval?: number;
          reconnectMaxInterval?: number;
          recoveryInterval?: number;
          sendBufferSize?: number;
          sendHighWaterMark?: number;
          sendTimeout?: number;
          socksProxy?: null | string;
          tcpAcceptFilter?: null | string;
          tcpKeepalive?: number;
          tcpKeepaliveCount?: number;
          tcpKeepaliveIdle?: number;
          tcpKeepaliveInterval?: number;
          tcpMaxRetransmitTimeout?: number;
          typeOfService?: number;
          vmciBufferMaxSize?: number;
          vmciBufferMinSize?: number;
          vmciBufferSize?: number;
          vmciConnectTimeout?: number;
          zapDomain?: null | string;
          zapEnforceDomain?: boolean;
      }
      • Optionalaffinity?: number

        ZMQ_AFFINITY

        I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

        Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

      • Optionalbacklog?: number

        ZMQ_BACKLOG

        Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

      • OptionalconnectTimeout?: number

        ZMQ_CONNECT_TIMEOUT

        Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

      • Optionalcontext?: Context
      • OptionalcurvePublicKey?: null | string

        ZMQ_CURVE_PUBLICKEY

        Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

      • OptionalcurveSecretKey?: null | string

        ZMQ_CURVE_SECRETKEY

        Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

      • OptionalcurveServer?: boolean

        ZMQ_CURVE_SERVER

        Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

      • OptionalcurveServerKey?: null | string

        ZMQ_CURVE_SERVERKEY

        Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

      • OptionalgssapiPlainText?: boolean
      • OptionalgssapiPrincipal?: null | string
      • OptionalgssapiPrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalgssapiServer?: boolean
      • OptionalgssapiServicePrincipal?: null | string
      • OptionalgssapiServicePrincipalNameType?: "hostBased" | "userName" | "krb5Principal"
      • OptionalhandshakeInterval?: number

        ZMQ_HANDSHAKE_IVL

        Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

      • OptionalheartbeatInterval?: number

        ZMQ_HEARTBEAT_IVL

        Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

      • OptionalheartbeatTimeout?: number

        ZMQ_HEARTBEAT_TIMEOUT

        How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

      • OptionalheartbeatTimeToLive?: number

        ZMQ_HEARTBEAT_TTL

        The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

      • Optionalimmediate?: boolean

        ZMQ_IMMEDIATE

        By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

      • Optionalinterface?: null | string

        ZMQ_BINDTODEVICE

        Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

      • Optionalipv6?: boolean

        ZMQ_IPV6

        Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

      • Optionallinger?: number

        ZMQ_LINGER

        Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

      • OptionalloopbackFastPath?: boolean

        ZMQ_LOOPBACK_FASTPATH

        Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

      • OptionalmaxMessageSize?: number

        ZMQ_MAXMSGSIZE

        Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

      • OptionalmulticastHops?: number

        ZMQ_MULTICAST_HOPS

        Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

      • OptionalmulticastMaxTransportDataUnit?: number

        ZMQ_MULTICAST_MAXTPDU

        Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

      • OptionalplainPassword?: null | string

        ZMQ_PLAIN_PASSWORD

        Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • OptionalplainServer?: boolean

        ZMQ_PLAIN_SERVER

        Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

      • OptionalplainUsername?: null | string

        ZMQ_PLAIN_USERNAME

        Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

      • Optionalrate?: number

        ZMQ_RATE

        Maximum send or receive data rate for multicast transports such as pgm.

      • OptionalreceiveBufferSize?: number

        ZMQ_RCVBUF

        Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalreceiveHighWaterMark?: number

        ZMQ_RCVHWM

        The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalreceiveTimeout?: number

        ZMQ_RCVTIMEO

        Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

      • OptionalreconnectInterval?: number

        ZMQ_RECONNECT_IVL

        Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

      • OptionalreconnectMaxInterval?: number

        ZMQ_RECONNECT_IVL_MAX

        Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

      • OptionalrecoveryInterval?: number

        ZMQ_RECOVERY_IVL

        Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

      • OptionalsendBufferSize?: number

        ZMQ_SNDBUF

        Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

      • OptionalsendHighWaterMark?: number

        ZMQ_SNDHWM

        The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

        If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

      • OptionalsendTimeout?: number

        ZMQ_SNDTIMEO

        Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

      • OptionalsocksProxy?: null | string

        ZMQ_SOCKS_PROXY

        The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

      • OptionaltcpAcceptFilter?: null | string

        ZMQ_TCP_ACCEPT_FILTER

        Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

      • OptionaltcpKeepalive?: number

        ZMQ_TCP_KEEPALIVE

        Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveCount?: number

        ZMQ_TCP_KEEPALIVE_CNT

        Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveIdle?: number

        ZMQ_TCP_KEEPALIVE_IDLE

        Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpKeepaliveInterval?: number

        ZMQ_TCP_KEEPALIVE_INTVL

        Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

      • OptionaltcpMaxRetransmitTimeout?: number

        ZMQ_TCP_MAXRT

        Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

      • OptionaltypeOfService?: number

        ZMQ_TOS

        Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

      • OptionalvmciBufferMaxSize?: number

        ZMQ_VMCI_BUFFER_MAX_SIZE

        Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferMinSize?: number

        ZMQ_VMCI_BUFFER_MIN_SIZE

        Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciBufferSize?: number

        ZMQ_VMCI_BUFFER_SIZE

        The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

      • OptionalvmciConnectTimeout?: number

        ZMQ_VMCI_CONNECT_TIMEOUT

        Connection timeout for the socket. For vmci:// transports only.

      • OptionalzapDomain?: null | string

        ZMQ_ZAP_DOMAIN

        Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

      • OptionalzapEnforceDomain?: boolean

        ZMQ_ZAP_ENFORCE_DOMAIN

        The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

    Returns XSubscriber

Properties

affinity: number

ZMQ_AFFINITY

I/O thread affinity, which determines which threads from the ØMQ I/O thread pool associated with the socket's context shall handle newly created connections.

Note: This value is a bit mask, but values higher than Number.MAX_SAFE_INTEGER may not be represented accurately! This currently means that configurations beyond 52 threads are unreliable.

backlog: number

ZMQ_BACKLOG

Maximum length of the queue of outstanding peer connections for the specified socket. This only applies to connection-oriented transports.

closed: boolean

Whether this socket was previously closed with close().

connectTimeout: number

ZMQ_CONNECT_TIMEOUT

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

context: Context

Context that this socket belongs to.

curvePublicKey: null | string

ZMQ_CURVE_PUBLICKEY

Sets the socket's long term public key. You must set this on CURVE client sockets. A server socket does not need to know its own public key. You can create a new keypair with curveKeyPair().

curveSecretKey: null | string

ZMQ_CURVE_SECRETKEY

Sets the socket's long term secret key. You must set this on both CURVE client and server sockets. You can create a new keypair with curveKeyPair().

curveServer: boolean

ZMQ_CURVE_SERVER

Defines whether the socket will act as server for CURVE security. A value of true means the socket will act as CURVE server. A value of false means the socket will not act as CURVE server, and its security role then depends on other option settings.

curveServerKey: null | string

ZMQ_CURVE_SERVERKEY

Sets the socket's long term server key. This is the public key of the CURVE server socket. You must set this on CURVE client sockets. This key must have been generated together with the server's secret key. You can create a new keypair with curveKeyPair().

events: Observer

Event Observer for this socket. This starts up a ØMQ monitoring socket internally that receives all socket events.

gssapiPlainText: boolean
gssapiPrincipal: null | string
gssapiPrincipalNameType: "hostBased" | "userName" | "krb5Principal"
gssapiServer: boolean
gssapiServicePrincipal: null | string
gssapiServicePrincipalNameType: "hostBased" | "userName" | "krb5Principal"
handshakeInterval: number

ZMQ_HANDSHAKE_IVL

Handshaking is the exchange of socket configuration information (socket type, identity, security) that occurs when a connection is first opened (only for connection-oriented transports). If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

heartbeatInterval: number

ZMQ_HEARTBEAT_IVL

Interval in milliseconds between sending ZMTP heartbeats for the specified socket. If this option is greater than 0, then a PING ZMTP command will be sent after every interval.

heartbeatTimeout: number

ZMQ_HEARTBEAT_TIMEOUT

How long (in milliseconds) to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if heartbeatInterval is greater than 0. The connection will time out if there is no traffic received after sending the PING command. The received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

heartbeatTimeToLive: number

ZMQ_HEARTBEAT_TTL

The timeout in milliseconds on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if heartbeatInterval is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

immediate: boolean

ZMQ_IMMEDIATE

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (Request, Push, Dealer). If this option is set to true, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

interface: null | string

ZMQ_BINDTODEVICE

Binds the socket to the given network interface (Linux only). Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt. Requires the program to be ran as root or with CAP_NET_RAW.

ipv6: boolean

ZMQ_IPV6

Enable or disable IPv6. When IPv6 is enabled, the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

lastEndpoint: null | string

ZMQ_LAST_ENDPOINT

The last endpoint bound for TCP and IPC transports.

linger: number

ZMQ_LINGER

Determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with close().

loopbackFastPath: boolean

ZMQ_LOOPBACK_FASTPATH

Enable faster TCP connections on loopback devices. An application can enable this option to reduce the latency and improve the performance of loopback operations on a TCP socket on Windows.

maxMessageSize: number

ZMQ_MAXMSGSIZE

Limits the size of the inbound message. If a peer sends a message larger than the limit it is disconnected. Value of -1 means no limit.

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

multicastMaxTransportDataUnit: number

ZMQ_MULTICAST_MAXTPDU

Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

plainPassword: null | string

ZMQ_PLAIN_PASSWORD

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

plainServer: boolean

ZMQ_PLAIN_SERVER

Defines whether the socket will act as server for PLAIN security. A value of true means the socket will act as PLAIN server. A value of false means the socket will not act as PLAIN server, and its security role then depends on other option settings.

plainUsername: null | string

ZMQ_PLAIN_USERNAME

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN.

rate: number

ZMQ_RATE

Maximum send or receive data rate for multicast transports such as pgm.

readable: boolean

Whether any messages are currently available. If true, the next call to Readable.receive() will immediately read a message from the socket. For sockets that cannot receive messsages this is always false.

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

reconnectInterval: number

ZMQ_RECONNECT_IVL

Period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

reconnectMaxInterval: number

ZMQ_RECONNECT_IVL_MAX

Maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled until reconnectMaxInterval is reached. This allows for exponential backoff strategy. Zero (the default) means no exponential backoff is performed and reconnect interval calculations are only based on reconnectInterval.

recoveryInterval: number

ZMQ_RECOVERY_IVL

Maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

securityMechanism: null | "plain" | "curve" | "gssapi"

ZMQ_MECHANISM

Returns the current security mechanism for the socket, if any. The security mechanism is set implictly by using any of the relevant security options. The returned value is one of:

  • null - No security mechanism is used.
  • "plain" - The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality.
  • "curve" - The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks.
  • "gssapi" - The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks.
sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

socksProxy: null | string

ZMQ_SOCKS_PROXY

The SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

tcpAcceptFilter: null | string

ZMQ_TCP_ACCEPT_FILTER

Assign a filter that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source IP should be matched. To clear all filters set to null. Filter is a string with IPv6 or IPv4 CIDR.

tcpKeepalive: number

ZMQ_TCP_KEEPALIVE

Override SO_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveCount: number

ZMQ_TCP_KEEPALIVE_CNT

Overrides TCP_KEEPCNT socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveIdle: number

ZMQ_TCP_KEEPALIVE_IDLE

Overrides TCP_KEEPIDLE / TCP_KEEPALIVE socket option (if supported by OS). The default value of -1 leaves it to the OS default.

tcpKeepaliveInterval: number

ZMQ_TCP_KEEPALIVE_INTVL

Overrides TCP_KEEPINTVL socket option (if supported by the OS). The default value of -1 leaves it to the OS default.

tcpMaxRetransmitTimeout: number

ZMQ_TCP_MAXRT

Sets how long before an unacknowledged TCP retransmit times out (if supported by the OS). The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

threadSafe: boolean

ZMQ_THREAD_SAFE

Whether or not the socket is threadsafe. Currently only DRAFT sockets is thread-safe.

ZMQ_TYPE

Retrieve the socket type. This is fairly useless because you can test the socket class with e.g. socket instanceof Dealer.

typeOfService: number

ZMQ_TOS

Sets the ToS fields (the Differentiated Services (DS) and Explicit Congestion Notification (ECN) field) of the IP header. The ToS field is typically used to specify a packet's priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

vmciBufferMaxSize: number

ZMQ_VMCI_BUFFER_MAX_SIZE

Maximum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferMinSize: number

ZMQ_VMCI_BUFFER_MIN_SIZE

Minimum size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciBufferSize: number

ZMQ_VMCI_BUFFER_SIZE

The size of the underlying buffer for the socket. Used during negotiation before the connection is established. For vmci:// transports only.

vmciConnectTimeout: number

ZMQ_VMCI_CONNECT_TIMEOUT

Connection timeout for the socket. For vmci:// transports only.

writable: boolean

Whether any messages can be queued for sending. If true, the next call to Writable.send() will immediately queue a message on the socket. For sockets that cannot send messsages this is always false.

zapDomain: null | string

ZMQ_ZAP_DOMAIN

Sets the domain for ZAP (ZMQ RFC 27) authentication. For NULL security (the default on all tcp:// connections), ZAP authentication only happens if you set a non-empty domain. For PLAIN and CURVE security, ZAP requests are always made, if there is a ZAP handler present. See http://rfc.zeromq.org/spec:27 for more details.

zapEnforceDomain: boolean

ZMQ_ZAP_ENFORCE_DOMAIN

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Methods

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    await socket.bind("tcp://127.0.0.1:3456")
    await socket.bind("tcp://*:3456") // binds on all interfaces
    await socket.bind("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns Promise<void>

    Resolved when the socket was successfully bound.

  • Binds the socket to the given address. During bind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    You can use * in place of a hostname to bind on all interfaces/addresses, and you can use * in place of a port to bind to a random port (which can be retrieved with lastEndpoint later).

    socket.bindSync("tcp://127.0.0.1:3456")
    socket.bindSync("tcp://*:3456") // binds on all interfaces
    socket.bindSync("tcp://127.0.0.1:*") // binds on random port +

    Parameters

    • address: string

      Address to bind this socket to.

    Returns void

    Resolved when the socket was successfully bound.

  • Closes the socket and disposes of all resources. Any messages that are queued may be discarded or sent in the background depending on the linger setting.

    After this method is called, it is no longer possible to call any other methods on this socket.

    Sockets that go out of scope and have no Readable.receive() or Writable.send() operations in progress will automatically be closed. Therefore it is not necessary in most applications to call close() manually.

    Calling this method on a socket that is already closed is a no-op.

    Returns void

  • Connects to the socket at the given remote address and returns immediately. The connection will be made asynchronously in the background.

    socket.connect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The address to connect to.

    Returns void

  • Disconnects a previously connected socket from the given address and returns immediately. Disconnection will happen asynchronously in the background.

    socket.disconnect("tcp://127.0.0.1:3456")
    +

    Parameters

    • address: string

      The previously connected address to disconnect from.

    Returns void

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() +

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error +

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<Buffer[]>

    Resolved with message parts that were successfully read.

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) +

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: MessageLike | MessageLike[]

      Single message or multipart message to queue for sending.

    • ...options: []

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns Promise<void>

    Resolved when the socket was successfully unbound.

  • Unbinds the socket to the given address. During unbind() the socket cannot be used. Do not call any other methods until the returned promise resolves. Make sure to use await.

    Parameters

    • address: string

      Address to unbind this socket from.

    Returns void

    Resolved when the socket was successfully unbound.

\ No newline at end of file diff --git a/enums/_internal_.SocketType.html b/enums/_internal_.SocketType.html new file mode 100644 index 00000000..b2a23eb3 --- /dev/null +++ b/enums/_internal_.SocketType.html @@ -0,0 +1 @@ +SocketType | zeromq.js

Enumeration SocketTypeConst

Socket types available for creating sockets.

Enumeration Members

Client: 13
Datagram: 18
Dealer: 5
Dish: 15
Gather: 16
Pair: 0
Publisher: 1
Pull: 7
Push: 8
Radio: 14
Reply: 4
Request: 3
Router: 6
Scatter: 17
Server: 12
Stream: 11
Subscriber: 2
XPublisher: 9
XSubscriber: 10
\ No newline at end of file diff --git a/functions/curveKeyPair.html b/functions/curveKeyPair.html index 9dfc9eed..50cbcd3a 100644 --- a/functions/curveKeyPair.html +++ b/functions/curveKeyPair.html @@ -1 +1 @@ -curveKeyPair | zeromq.js

Function curveKeyPair

  • Returns a new random key pair to be used with the CURVE security mechanism.

    To correctly connect two sockets with this mechanism:

    Returns { publicKey: string; secretKey: string }

    An object with a publicKey and a secretKey property, each being a 40 character Z85-encoded string.

\ No newline at end of file +curveKeyPair | zeromq.js

Function curveKeyPair

  • Returns a new random key pair to be used with the CURVE security mechanism.

    To correctly connect two sockets with this mechanism:

    Returns { publicKey: string; secretKey: string }

    An object with a publicKey and a secretKey property, each being a 40 character Z85-encoded string.

\ No newline at end of file diff --git a/hierarchy.html b/hierarchy.html index e4f81d83..c8b93e64 100644 --- a/hierarchy.html +++ b/hierarchy.html @@ -1 +1 @@ -zeromq.js

zeromq.js

Hierarchy Summary

\ No newline at end of file +zeromq.js

zeromq.js

Hierarchy Summary

\ No newline at end of file diff --git a/index.html b/index.html index ee0a159b..047d559f 100644 --- a/index.html +++ b/index.html @@ -1,22 +1,21 @@ -zeromq.js

zeromq.js

ZeroMQ.js Next Generation

Latest version

ØMQ bindings for Node.js. The goals of this library are:

  • Semantically similar to the native ØMQ library, while sticking to JavaScript idioms.
  • Use modern JavaScript and Node.js features such as async/await and async iterators.
  • High performance.
  • Fully usable with TypeScript (3+).
  • Compatible with Zeromq 4/5 via "zeromq/v5-compat"
  • Secure Curve protocol with Libsodium
  • Zeromq Draft API support

Install ZeroMQ.js with prebuilt binaries:

npm install zeromq
-

Supported versions:

  • Node.js v12 (requires a N-API)

The following platforms have a prebuilt binary available:

  • Windows on x86/x86-64

    Zeromq binaries on Windows 10 or older need Visual C++ Redistributable to be installed.

  • Linux on x86-64 with libstdc++.so.6.0.21+ (glibc++ 3.4.21+), for example:

    • Debian 9+ (Stretch or later)
    • Ubuntu 16.04+ (Xenial or later)
    • CentOS 8+
  • Linux on x86-64 with musl, for example:

    • Alpine 3.3+
  • MacOS 10.9+ on x86-64

If a prebuilt binary is not available for your platform, installing will attempt to start a build from source.

If a prebuilt binary is unavailable, or if you want to pass certain options during build, you can build this package from source.

Make sure you have the following installed before attempting to build from source:

  • Node.js 10+ or Electron
  • C++17 compiler toolchain (e.g. LLVM, GCC, MSVC)
  • Python 3
  • CMake 3.16+
  • vcpkg dependencies (e.g. on Linux it needs curl, unzip, zip, tar, git, pkg-config)

For Curve:

  • automake
  • autoconf
  • libtool

To install from source, specify build_from_source=true in a .npmrc file

build_from_source=true
-

When building from source, you can also specify additional build options in a .npmrc file in your project:

👉🏻 Options

(Enabled by default)

Enables CURVE security for encrypted communications. Zeromq uses libsodium for CURVE security. To enable CURVE support, add the following to your .npmrc:

zmq_curve="true"
-zmq_sodium="true"
-

Building libsodium requires these dependencies on Linux/MacOS: autoconf automake libtool, which can be installed via apt-get or brew, etc.

(Enabled by default)

By default libzmq is built with support for Draft patterns (e.g. server-client, radio-dish, scatter-gather). If you want to build libzmq without support for Draft, you can specify the following in .npmrc:

zmq_draft=false
-

Enables WebSocket transport, allowing ZeroMQ to communicate over WebSockets. To enable WebSocket support, add the following to your .npmrc:

zmq_websockets="true"
-

Enables WebSocket transport with TLS (wss), providing secure WebSocket communications. To enable secure WebSocket support, add the following to your .npmrc:

zmq_websockets_secure="true"
-

Enables immediate send/receive on the socket without synchronous resolution. This option can improve performance in certain scenarios by allowing operations to proceed without waiting for synchronous resolution. To enable this feature, add the following to your .npmrc:

zmq_no_sync_resolve="true"
-

Specifies the minimum macOS version that the binary will be compatible with. This is particularly useful when building for different macOS versions. To set this, add the following to your .npmrc, replacing 10.15 with your desired minimum macOS version:

macosx_deployment_target="10.15"
-

Here some examples of different features are provided. More examples can be found in the examples directory.

You can also browse the API reference documentation to see all socket types, methods & options as well as more detailed information about how to apply them.

Note: If you are new to ZeroMQ, please start with the ZeroMQ documentation.

ES modules:

import {Request} from "zeromq"
// or as namespace
import * as zmq from "zeromq"

const reqSock = new Request()
//...
const repSock = new zmq.Reply() -

Commonjs:

const zmq = require("zeromq")

const reqSock = new zmq.Request()
//...
const repSock = new zmq.Reply() -

This example demonstrates how a producer pushes information onto a socket and how a worker pulls information from the socket.

Creates a producer to push information onto a socket.

import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Push()

await sock.bind("tcp://127.0.0.1:3000")
console.log("Producer bound to port 3000")

while (true) {
await sock.send("some work")
await new Promise(resolve => {
setTimeout(resolve, 500)
})
}
}

run() -

Creates a worker to pull information from the socket.

import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Pull()

sock.connect("tcp://127.0.0.1:3000")
console.log("Worker connected to port 3000")

for await (const [msg] of sock) {
console.log("work: %s", msg.toString())
}
}

run() -

This example demonstrates using zeromq in a classic Pub/Sub, Publisher/Subscriber, application.

Create the publisher which sends messages.

import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Publisher()

await sock.bind("tcp://127.0.0.1:3000")
console.log("Publisher bound to port 3000")

while (true) {
console.log("sending a multipart message envelope")
await sock.send(["kitty cats", "meow!"])
await new Promise(resolve => {
setTimeout(resolve, 500)
})
}
}

run() -

Create a subscriber to connect to a publisher's port to receive messages.

import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Subscriber()

sock.connect("tcp://127.0.0.1:3000")
sock.subscribe("kitty cats")
console.log("Subscriber connected to port 3000")

for await (const [topic, msg] of sock) {
console.log(
"received a message related to:",
topic,
"containing message:",
msg,
)
}
}

run() -

This example illustrates a request from a client and a reply from a server.

import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Request()

sock.connect("tcp://127.0.0.1:3000")
console.log("Producer bound to port 3000")

await sock.send("4")
const [result] = await sock.receive()

console.log(result)
}

run() -
import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Reply()

await sock.bind("tcp://127.0.0.1:3000")

for await (const [msg] of sock) {
await sock.send((2 * parseInt(msg.toString(), 10)).toString())
}
}

run() -

The next generation version of the library features a compatibility layer for ZeroMQ.js versions 4 and 5. This is recommended for users upgrading from previous versions.

Example:

const zmq = require("zeromq/v5-compat")

const pub = zmq.socket("pub")
const sub = zmq.socket("sub")

pub.bind("tcp://*:3456", err => {
if (err) throw err

sub.connect("tcp://127.0.0.1:3456")

pub.send("message")

sub.on("message", msg => {
// Handle received message...
})
}) -

This library provides typings for TypeScript version 3.0.x and later.

Requirements

  • For TypeScript version >= 3:
  • For TypeScript version < 3.6:
    • either set compilerOptions.target to esnext or later (e.g. es2018)
    • or add the following, or similar, libraries to compilerOptions.lib (and include their corresponding polyfills if needed): es2015, ESNext.AsyncIterable

If you are interested in making contributions to this project, please read the following sections.

In order to develop and test the library, you'll need the tools required to build from source (see above).

Additionally, having clang-format is strongly recommended.

Socket and context options can be set at runtime, even if they are not implemented by this library. By design, this requires no recompilation if the built version of ZeroMQ has support for them. This allows library users to test and use options that have been introduced in recent versions of ZeroMQ without having to modify this library. Of course we'd love to include support for new options in an idiomatic way.

Options can be set as follows:

const {Dealer} = require("zeromq")

/* This defines an accessor named 'sendHighWaterMark', which corresponds to
the constant ZMQ_SNDHWM, which is defined as '23' in zmq.h. The option takes
integers. The accessor name has been converted to idiomatic JavaScript.
Of course, this particular option already exists in this library. */
class MyDealer extends Dealer {
get sendHighWaterMark(): number {
return this.getInt32Option(23)
}

set sendHighWaterMark(value: number) {
this.setInt32Option(23, value)
}
}

const sock = new MyDealer({sendHighWaterMark: 456}) +zeromq.js

zeromq.js

ZeroMQ.js Next Generation

Latest version

ØMQ bindings for Node.js. The goals of this library are:

  • Semantically similar to the native ØMQ library, while sticking to JavaScript idioms.
  • Use modern JavaScript and Node.js features such as async/await and async iterators.
  • High performance.
  • Fully usable with TypeScript (3+).
  • Compatible with Zeromq 4/5 via "zeromq/v5-compat"
  • Secure Curve protocol with Libsodium
  • Zeromq Draft API support

Install ZeroMQ.js with prebuilt binaries:

npm install zeromq
+

Supported versions:

  • Node.js v10+ (requires a N-API)

Here some examples of different features are provided. More examples can be found in the examples directory.

You can also browse the API reference documentation to see all socket types, methods & options as well as more detailed information about how to apply them.

Note: If you are new to ZeroMQ, please start with the ZeroMQ documentation.

ES modules:

import {Request} from "zeromq"
// or as namespace
import * as zmq from "zeromq"

const reqSock = new Request()
//...
const repSock = new zmq.Reply() +

Commonjs:

const zmq = require("zeromq")

const reqSock = new zmq.Request()
//...
const repSock = new zmq.Reply() +

This example demonstrates how a producer pushes information onto a socket and how a worker pulls information from the socket.

Creates a producer to push information onto a socket.

import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Push()

await sock.bind("tcp://127.0.0.1:3000")
console.log("Producer bound to port 3000")

while (true) {
await sock.send("some work")
await new Promise(resolve => {
setTimeout(resolve, 500)
})
}
}

run() +

Creates a worker to pull information from the socket.

import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Pull()

sock.connect("tcp://127.0.0.1:3000")
console.log("Worker connected to port 3000")

for await (const [msg] of sock) {
console.log("work: %s", msg.toString())
}
}

run() +

This example demonstrates using zeromq in a classic Pub/Sub, Publisher/Subscriber, application.

Create the publisher which sends messages.

import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Publisher()

await sock.bind("tcp://127.0.0.1:3000")
console.log("Publisher bound to port 3000")

while (true) {
console.log("sending a multipart message envelope")
await sock.send(["kitty cats", "meow!"])
await new Promise(resolve => {
setTimeout(resolve, 500)
})
}
}

run() +

Create a subscriber to connect to a publisher's port to receive messages.

import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Subscriber()

sock.connect("tcp://127.0.0.1:3000")
sock.subscribe("kitty cats")
console.log("Subscriber connected to port 3000")

for await (const [topic, msg] of sock) {
console.log(
"received a message related to:",
topic,
"containing message:",
msg,
)
}
}

run() +

This example illustrates a request from a client and a reply from a server.

import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Request()

sock.connect("tcp://127.0.0.1:3000")
console.log("Producer bound to port 3000")

await sock.send("4")
const [result] = await sock.receive()

console.log(result)
}

run() +
import * as zmq from "zeromq"

async function run() {
const sock = new zmq.Reply()

await sock.bind("tcp://127.0.0.1:3000")

for await (const [msg] of sock) {
await sock.send((2 * parseInt(msg.toString(), 10)).toString())
}
}

run() +

The next generation version of the library features a compatibility layer for ZeroMQ.js versions 4 and 5. This is recommended for users upgrading from previous versions.

Example:

const zmq = require("zeromq/v5-compat")

const pub = zmq.socket("pub")
const sub = zmq.socket("sub")

pub.bind("tcp://*:3456", err => {
if (err) throw err

sub.connect("tcp://127.0.0.1:3456")

pub.send("message")

sub.on("message", msg => {
// Handle received message...
})
}) +

This library provides typings for TypeScript version 3.0.x and later.

Requirements

  • For TypeScript version >= 3:
  • For TypeScript version < 3.6:
    • either set compilerOptions.target to esnext or later (e.g. es2018)
    • or add the following, or similar, libraries to compilerOptions.lib (and include their corresponding polyfills if needed): es2015, ESNext.AsyncIterable

The following platforms have a prebuilt binary available:

  • Windows on x86/x86-64

    Zeromq binaries on Windows 10 or older need Visual C++ Redistributable to be installed.

  • Linux on x86-64 with libstdc++.so.6.0.21+ (glibc++ 3.4.21+), for example:

    • Debian 9+ (Stretch or later)
    • Ubuntu 16.04+ (Xenial or later)
    • CentOS 8+
  • Linux on x86-64 with musl, for example:

    • Alpine 3.3+
  • MacOS 10.9+ on x86-64

If a prebuilt binary is not available for your platform, installing will attempt to start a build from source.

If a prebuilt binary is unavailable, or if you want to pass certain options during build, you can build this package from source.

Make sure you have the following installed before attempting to build from source:

  • Node.js 10+ or Electron
  • C++17 compiler toolchain (e.g. LLVM, GCC, MSVC)
  • Python 3
  • CMake 3.16+
  • vcpkg dependencies (e.g. on Linux it needs curl, unzip, zip, tar, git, pkg-config)

For Curve:

  • automake
  • autoconf
  • libtool

To install from source, specify build_from_source=true in a .npmrc file

build_from_source=true
+

When building from source, you can also specify additional build options in a .npmrc file in your project:

👉🏻 Options

(Enabled by default)

Enables CURVE security for encrypted communications. Zeromq uses libsodium for CURVE security. To enable CURVE support, add the following to your .npmrc:

zmq_curve="true"
zmq_sodium="true" +

Building libsodium requires these dependencies on Linux/MacOS: autoconf automake libtool, which can be installed via apt-get or brew, etc.

(Enabled by default)

By default libzmq is built with support for Draft patterns (e.g. server-client, radio-dish, scatter-gather). If you want to build libzmq without support for Draft, you can specify the following in .npmrc:

zmq_draft=false
+

Enables WebSocket transport, allowing ZeroMQ to communicate over WebSockets. To enable WebSocket support, add the following to your .npmrc:

zmq_websockets="true"
+

Enables WebSocket transport with TLS (wss), providing secure WebSocket communications. To enable secure WebSocket support, add the following to your .npmrc:

zmq_websockets_secure="true"
+

Enables immediate send/receive on the socket without synchronous resolution. This option can improve performance in certain scenarios by allowing operations to proceed without waiting for synchronous resolution. To enable this feature, add the following to your .npmrc:

zmq_no_sync_resolve="true"
+

Specifies the minimum macOS version that the binary will be compatible with. This is particularly useful when building for different macOS versions. To set this, add the following to your .npmrc, replacing 10.15 with your desired minimum macOS version:

macosx_deployment_target="10.15"
+

If you are interested in making contributions to this project, please read the following sections.

In order to develop and test the library, you'll need the tools required to build from source (see above).

Additionally, having clang-format is strongly recommended.

Socket and context options can be set at runtime, even if they are not implemented by this library. By design, this requires no recompilation if the built version of ZeroMQ has support for them. This allows library users to test and use options that have been introduced in recent versions of ZeroMQ without having to modify this library. Of course we'd love to include support for new options in an idiomatic way.

Options can be set as follows:

const {Dealer} = require("zeromq")

/* This defines an accessor named 'sendHighWaterMark', which corresponds to
the constant ZMQ_SNDHWM, which is defined as '23' in zmq.h. The option takes
integers. The accessor name has been converted to idiomatic JavaScript.
Of course, this particular option already exists in this library. */
class MyDealer extends Dealer {
get sendHighWaterMark(): number {
return this.getInt32Option(23)
}

set sendHighWaterMark(value: number) {
this.setInt32Option(23, value)
}
}

const sock = new MyDealer({sendHighWaterMark: 456})

When submitting pull requests for new socket/context options, please consider the following:

  • The option is documented in the TypeScript interface.
  • The option is only added to relevant socket types, and if the ZMQ_ constant has a prefix indicating which type it applies to, it is stripped from the name as it is exposed in JavaScript.
  • The name as exposed in this library is idiomatic for JavaScript, spelling out any abbreviations and using proper camelCase naming conventions.
  • The option is a value that can be set on a socket, and you don't think it should actually be a method.

The test suite can be run with:

npm install
npm run build
npm run test -

The test suite will validate and fix the coding style, run all unit tests and verify the validity of the included TypeScript type definitions.

Some tests are not enabled by default:

  • API Compatibility tests from ZeroMQ 5.x have been disabled by default. You can include the tests with INCLUDE_COMPAT_TESTS=1 npm run test
  • Some transports are not reliable on some older versions of ZeroMQ, the relevant tests will be skipped for those versions automatically.

To publish a new version, run:

npm version <new version>
git push && git push --tags -

Wait for continuous integration to finish. Prebuilds will be generated for all supported platforms and attached to a Github release. Documentation is automatically generated and committed to gh-pages. Finally, a new NPM package version will be automatically released.

Version 6+ is a complete rewrite of previous versions of ZeroMQ.js in order to be more reliable, correct, and usable in modern JavaScript & TypeScript code as first outlined in this issue. Previous versions of ZeroMQ.js were based on zmq and a fork that included prebuilt binaries.

See detailed changes in the CHANGELOG.

\ No newline at end of file +

The test suite will validate and fix the coding style, run all unit tests and verify the validity of the included TypeScript type definitions.

Some tests are not enabled by default:

  • API Compatibility tests from ZeroMQ 5.x have been disabled by default. You can include the tests with INCLUDE_COMPAT_TESTS=1 npm run test
  • Some transports are not reliable on some older versions of ZeroMQ, the relevant tests will be skipped for those versions automatically.

To publish a new version, run:

npm version <new version>
git push && git push --tags +

Wait for continuous integration to finish. Prebuilds will be generated for all supported platforms and attached to a Github release. Documentation is automatically generated and committed to gh-pages. Finally, a new NPM package version will be automatically released.

Version 6+ is a complete rewrite of previous versions of ZeroMQ.js in order to be more reliable, correct, and usable in modern JavaScript & TypeScript code as first outlined in this issue. Previous versions of ZeroMQ.js were based on zmq and a fork that included prebuilt binaries.

See detailed changes in the CHANGELOG.

\ No newline at end of file diff --git a/interfaces/EventSubscriber.html b/interfaces/EventSubscriber.html index 847750cf..ff6d207d 100644 --- a/interfaces/EventSubscriber.html +++ b/interfaces/EventSubscriber.html @@ -1,2 +1,2 @@ -EventSubscriber | zeromq.js

Interface EventSubscriber

interface EventSubscriber {
    off<
        E extends
            | "unknown"
            | "connect"
            | "disconnect"
            | "close"
            | "end"
            | "accept"
            | "accept:error"
            | "bind"
            | "bind:error"
            | "connect:delay"
            | "connect:retry"
            | "close:error"
            | "handshake"
            | "handshake:error:protocol"
            | "handshake:error:auth"
            | "handshake:error:other",
    >(
        type: E,
        listener: (data: EventOfType<E>) => void,
    ): EventSubscriber;
    on<
        E extends
            | "unknown"
            | "connect"
            | "disconnect"
            | "close"
            | "end"
            | "accept"
            | "accept:error"
            | "bind"
            | "bind:error"
            | "connect:delay"
            | "connect:retry"
            | "close:error"
            | "handshake"
            | "handshake:error:protocol"
            | "handshake:error:auth"
            | "handshake:error:other",
    >(
        type: E,
        listener: (data: EventOfType<E>) => void,
    ): EventSubscriber;
}

Hierarchy (View Summary)

Methods

Methods

  • Removes the specified listener function from the list of functions to call when the given event is observed.

    Type Parameters

    • E extends
          | "unknown"
          | "connect"
          | "disconnect"
          | "close"
          | "end"
          | "accept"
          | "accept:error"
          | "bind"
          | "bind:error"
          | "connect:delay"
          | "connect:retry"
          | "close:error"
          | "handshake"
          | "handshake:error:protocol"
          | "handshake:error:auth"
          | "handshake:error:other"

    Parameters

    • type: E

      The type of event that the listener was listening for.

    • listener: (data: EventOfType<E>) => void

      The previously registered listener function.

    Returns EventSubscriber

  • Adds a listener function which will be invoked when the given event type is observed. Calling this method will convert the Observer to event emitter mode, which will make it impossible to call Observer.receive() at the same time.

    socket.events.on("bind", event => {
    console.log(`Socket bound to ${event.address}`)
    // ...
    }) -

    Type Parameters

    • E extends
          | "unknown"
          | "connect"
          | "disconnect"
          | "close"
          | "end"
          | "accept"
          | "accept:error"
          | "bind"
          | "bind:error"
          | "connect:delay"
          | "connect:retry"
          | "close:error"
          | "handshake"
          | "handshake:error:protocol"
          | "handshake:error:auth"
          | "handshake:error:other"

    Parameters

    • type: E

      The type of event to listen for.

    • listener: (data: EventOfType<E>) => void

      The listener function that will be called with all event data when the event is observed.

    Returns EventSubscriber

\ No newline at end of file +EventSubscriber | zeromq.js

Interface EventSubscriber

interface EventSubscriber {
    off<
        E extends
            | "unknown"
            | "connect"
            | "disconnect"
            | "close"
            | "end"
            | "accept"
            | "accept:error"
            | "bind"
            | "bind:error"
            | "connect:delay"
            | "connect:retry"
            | "close:error"
            | "handshake"
            | "handshake:error:protocol"
            | "handshake:error:auth"
            | "handshake:error:other",
    >(
        type: E,
        listener: (data: EventOfType<E>) => void,
    ): EventSubscriber;
    on<
        E extends
            | "unknown"
            | "connect"
            | "disconnect"
            | "close"
            | "end"
            | "accept"
            | "accept:error"
            | "bind"
            | "bind:error"
            | "connect:delay"
            | "connect:retry"
            | "close:error"
            | "handshake"
            | "handshake:error:protocol"
            | "handshake:error:auth"
            | "handshake:error:other",
    >(
        type: E,
        listener: (data: EventOfType<E>) => void,
    ): EventSubscriber;
}

Hierarchy (View Summary)

Methods

Methods

  • Removes the specified listener function from the list of functions to call when the given event is observed.

    Type Parameters

    • E extends
          | "unknown"
          | "connect"
          | "disconnect"
          | "close"
          | "end"
          | "accept"
          | "accept:error"
          | "bind"
          | "bind:error"
          | "connect:delay"
          | "connect:retry"
          | "close:error"
          | "handshake"
          | "handshake:error:protocol"
          | "handshake:error:auth"
          | "handshake:error:other"

    Parameters

    • type: E

      The type of event that the listener was listening for.

    • listener: (data: EventOfType<E>) => void

      The previously registered listener function.

    Returns EventSubscriber

  • Adds a listener function which will be invoked when the given event type is observed. Calling this method will convert the Observer to event emitter mode, which will make it impossible to call Observer.receive() at the same time.

    socket.events.on("bind", event => {
    console.log(`Socket bound to ${event.address}`)
    // ...
    }) +

    Type Parameters

    • E extends
          | "unknown"
          | "connect"
          | "disconnect"
          | "close"
          | "end"
          | "accept"
          | "accept:error"
          | "bind"
          | "bind:error"
          | "connect:delay"
          | "connect:retry"
          | "close:error"
          | "handshake"
          | "handshake:error:protocol"
          | "handshake:error:auth"
          | "handshake:error:other"

    Parameters

    • type: E

      The type of event to listen for.

    • listener: (data: EventOfType<E>) => void

      The listener function that will be called with all event data when the event is observed.

    Returns EventSubscriber

\ No newline at end of file diff --git a/interfaces/Readable.html b/interfaces/Readable.html index 4a13fa3f..0ae3fb9c 100644 --- a/interfaces/Readable.html +++ b/interfaces/Readable.html @@ -1,4 +1,4 @@ -Readable | zeromq.js

Interface Readable<M>

Describes sockets that can receive messages.

M The type of the message or message parts that can be read.

interface Readable<M extends object[] = Message[]> {
    receiveBufferSize: number;
    receiveHighWaterMark: number;
    receiveTimeout: number;
    "[asyncIterator]"(): AsyncIterator<M>;
    receive(): Promise<M>;
}

Type Parameters

Hierarchy (View Summary)

Properties

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

Methods

  • Asynchronously iterate over messages becoming available on the socket. When the socket is closed with Socket.close(), the iterator will return. Returning early from the iterator will not close the socket unless it also goes out of scope.

    for await (const [msg] of socket) {
    // handle messages
    } -

    Returns AsyncIterator<M>

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() -

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error -

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<M>

    Resolved with message parts that were successfully read.

\ No newline at end of file +Readable | zeromq.js

Interface Readable<M>

Describes sockets that can receive messages.

interface Readable<M extends object[] = Message[]> {
    receiveBufferSize: number;
    receiveHighWaterMark: number;
    receiveTimeout: number;
    "[asyncIterator]"(): AsyncIterator<M>;
    receive(): Promise<M>;
}

Type Parameters

  • M extends object[] = Message[]

    The type of the message or message parts that can be read.

Hierarchy (View Summary)

Properties

receiveBufferSize: number

ZMQ_RCVBUF

Underlying kernel receive buffer size in bytes. A value of -1 means leave the OS default unchanged.

receiveHighWaterMark: number

ZMQ_RCVHWM

The high water mark is a hard limit on the maximum number of incoming messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

receiveTimeout: number

ZMQ_RCVTIMEO

Sets the timeout receiving messages on the socket. If the value is 0, receive() will return a rejected promise immediately if there is no message to receive. If the value is -1, it will wait asynchronously until a message is available. For all other values, it will wait for a message for that amount of time before rejecting.

Methods

  • Asynchronously iterate over messages becoming available on the socket. When the socket is closed with Socket.close(), the iterator will return. Returning early from the iterator will not close the socket unless it also goes out of scope.

    for await (const [msg] of socket) {
    // handle messages
    } +

    Returns AsyncIterator<M>

  • Waits for the next single or multipart message to become availeble on the socket. Reads a message immediately if possible. If no messages can be read, it will wait asynchonously. The promise will be resolved with an array containing the parts of the next message when available.

    const [msg] = await socket.receive()
    const [part1, part2] = await socket.receive() +

    Reading may fail (eventually) if the socket has been configured with a receiveTimeout.

    A call to receive() is guaranteed to return with a resolved promise immediately if a message could be read from the socket directly.

    Only one asynchronously blocking call to receive() can be in progress simultaneously. If you call receive() again on the same socket it will return a rejected promise with an EBUSY error. For example, if no messages can be read and no await is used:

    socket.receive() // -> pending promise until read is possible
    socket.receive() // -> promise rejection with `EBUSY` error +

    Note: Due to the nature of Node.js and to avoid blocking the main thread, this method always attempts to read messages with the ZMQ_DONTWAIT flag. It polls asynchronously if reading is not currently possible. This means that all functionality related to timeouts and blocking behaviour is reimplemented in the Node.js bindings. Any differences in behaviour with the native ZMQ library is considered a bug.

    Returns Promise<M>

    Resolved with message parts that were successfully read.

\ No newline at end of file diff --git a/interfaces/RouterConnectOptions.html b/interfaces/RouterConnectOptions.html index 90afe179..072228c8 100644 --- a/interfaces/RouterConnectOptions.html +++ b/interfaces/RouterConnectOptions.html @@ -1 +1 @@ -RouterConnectOptions | zeromq.js

Interface RouterConnectOptions

interface RouterConnectOptions {
    routingId?: string;
}

Properties

Properties

routingId?: string
\ No newline at end of file +RouterConnectOptions | zeromq.js

Interface RouterConnectOptions

interface RouterConnectOptions {
    routingId?: string;
}

Properties

Properties

routingId?: string
\ No newline at end of file diff --git a/interfaces/StreamConnectOptions.html b/interfaces/StreamConnectOptions.html index 63a3e2ee..09d40113 100644 --- a/interfaces/StreamConnectOptions.html +++ b/interfaces/StreamConnectOptions.html @@ -1 +1 @@ -StreamConnectOptions | zeromq.js

Interface StreamConnectOptions

interface StreamConnectOptions {
    routingId?: string;
}

Properties

Properties

routingId?: string
\ No newline at end of file +StreamConnectOptions | zeromq.js

Interface StreamConnectOptions

interface StreamConnectOptions {
    routingId?: string;
}

Properties

Properties

routingId?: string
\ No newline at end of file diff --git a/interfaces/Writable.html b/interfaces/Writable.html index 47f850c5..a776786a 100644 --- a/interfaces/Writable.html +++ b/interfaces/Writable.html @@ -1,2 +1,2 @@ -Writable | zeromq.js

Interface Writable<M, O>

Describes sockets that can send messages.

M The type of the message or message parts that can be sent.

O Rest type for any options, if applicable to the socket type (DRAFT only).

interface Writable<
    M extends MessageLike
    | MessageLike[] = MessageLike | MessageLike[],
    O extends [...object[]] = [],
> {
    multicastHops: number;
    sendBufferSize: number;
    sendHighWaterMark: number;
    sendTimeout: number;
    send(message: M, ...options: O): Promise<void>;
}

Type Parameters

Hierarchy (View Summary)

Properties

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

Methods

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) -

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: M

      Single message or multipart message to queue for sending.

    • ...options: O

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

\ No newline at end of file +Writable | zeromq.js

Interface Writable<M, O>

Describes sockets that can send messages.

interface Writable<
    M extends MessageLike
    | MessageLike[] = MessageLike | MessageLike[],
    O extends [...object[]] = [],
> {
    multicastHops: number;
    sendBufferSize: number;
    sendHighWaterMark: number;
    sendTimeout: number;
    send(message: M, ...options: O): Promise<void>;
}

Type Parameters

  • M extends MessageLike | MessageLike[] = MessageLike | MessageLike[]

    The type of the message or message parts that can be sent.

  • O extends [...object[]] = []

    Rest type for any options, if applicable to the socket type (DRAFT only).

Hierarchy (View Summary)

Properties

multicastHops: number

ZMQ_MULTICAST_HOPS

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network.

sendBufferSize: number

ZMQ_SNDBUF

Underlying kernel transmit buffer size in bytes. A value of -1 means leave the OS default unchanged.

sendHighWaterMark: number

ZMQ_SNDHWM

The high water mark is a hard limit on the maximum number of outgoing messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages.

sendTimeout: number

ZMQ_SNDTIMEO

Sets the timeout for sending messages on the socket. If the value is 0, send() will return a rejected promise immediately if the message cannot be sent. If the value is -1, it will wait asynchronously until the message is sent. For all other values, it will try to send the message for that amount of time before rejecting.

Methods

  • Sends a single message or a multipart message on the socket. Queues the message immediately if possible, and returns a resolved promise. If the message cannot be queued because the high water mark has been reached, it will wait asynchronously. The promise will be resolved when the message was queued successfully.

    await socket.send("hello world")
    await socket.send(["hello", "world"]) +

    Queueing may fail eventually if the socket has been configured with a sendTimeout.

    A call to send() is guaranteed to return with a resolved promise immediately if the message could be queued directly.

    Only one asynchronously blocking call to send() may be executed simultaneously. If you call send() again on a socket that is in the mute state it will return a rejected promise with an EBUSY error.

    The reason for disallowing multiple send() calls simultaneously is that it could create an implicit queue of unsendable outgoing messages. This would circumvent the socket's sendHighWaterMark. Such an implementation could even exhaust all system memory and cause the Node.js process to abort.

    For most application you should not notice this implementation detail. Only in rare occasions will a call to send() that does not resolve immediately be undesired. Here are some common scenarios:

    • If you wish to send a message, use await send(...). ZeroMQ socket types have been carefully designed to give you the correct blocking behaviour on the chosen socket type in almost all cases:

      • If sending is not possible, it is often better to wait than to continue as if nothing happened. For example, on a Request socket, you can only receive a reply once a message has been sent; so waiting until a message could be queued before continuing with the rest of the program (likely to read from the socket) is required.

      • Certain socket types (such as Router) will always allow queueing messages and await send(...) won't delay any code that comes after. This makes sense for routers, since typically you don't want a single send operation to stop the handling of other incoming or outgoing messages.

    • If you wish to send on an occasionally blocking socket (for example on a Router with the Router.mandatory option set, or on a Dealer) and you're 100% certain that dropping a message is better than blocking, then you can set the sendTimeout option to 0 to effectively force send() to always resolve immediately. Be prepared to catch exceptions if sending a message is not immediately possible.

    • If you wish to send on a socket and messages should be queued before they are dropped, you should implement a simple queue in JavaScript. Such a queue is not provided by this library because most real world applications need to deal with undeliverable messages in more complex ways - for example, they might need to reply with a status message; or first retry delivery a certain number of times before giving up.

    Parameters

    • message: M

      Single message or multipart message to queue for sending.

    • ...options: O

      Any options, if applicable to the socket type (DRAFT only).

    Returns Promise<void>

    Resolved when the message was successfully queued.

\ No newline at end of file diff --git a/interfaces/_internal_.ArrayBufferView.html b/interfaces/_internal_.ArrayBufferView.html new file mode 100644 index 00000000..d40cec79 --- /dev/null +++ b/interfaces/_internal_.ArrayBufferView.html @@ -0,0 +1 @@ +ArrayBufferView | zeromq.js

Interface ArrayBufferView

interface ArrayBufferView {
    buffer: ArrayBufferLike;
    byteLength: number;
    byteOffset: number;
}

Properties

The ArrayBuffer instance referenced by the array.

byteLength: number

The length in bytes of the array.

byteOffset: number

The offset in bytes of the array.

\ No newline at end of file diff --git a/interfaces/_internal_.AsyncIterator.html b/interfaces/_internal_.AsyncIterator.html new file mode 100644 index 00000000..5a9864f1 --- /dev/null +++ b/interfaces/_internal_.AsyncIterator.html @@ -0,0 +1 @@ +AsyncIterator | zeromq.js

Interface AsyncIterator<T, TReturn, TNext>

interface AsyncIterator<T, TReturn = any, TNext = undefined> {
    next(...args: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
    return(
        value?: TReturn | PromiseLike<TReturn>,
    ): Promise<IteratorResult<T, TReturn>>;
    throw(e?: any): Promise<IteratorResult<T, TReturn>>;
}

Type Parameters

  • T
  • TReturn = any
  • TNext = undefined

Methods

\ No newline at end of file diff --git a/interfaces/_internal_.AuthError.html b/interfaces/_internal_.AuthError.html new file mode 100644 index 00000000..60f10e08 --- /dev/null +++ b/interfaces/_internal_.AuthError.html @@ -0,0 +1 @@ +AuthError | zeromq.js

Interface AuthError

An event that represents an authorization error.

interface AuthError {
    message: string;
    name: string;
    stack?: string;
    status: 300 | 400 | 500;
}

Hierarchy (View Summary)

Properties

message: string
name: string
stack?: string
status: 300 | 400 | 500
\ No newline at end of file diff --git a/interfaces/_internal_.ErrnoError.html b/interfaces/_internal_.ErrnoError.html new file mode 100644 index 00000000..9f9d858b --- /dev/null +++ b/interfaces/_internal_.ErrnoError.html @@ -0,0 +1 @@ +ErrnoError | zeromq.js

Interface ErrnoError

An error that represents a generic error with an associated error code.

interface ErrnoError {
    code: string;
    errno: number;
    message: string;
    name: string;
    stack?: string;
}

Hierarchy (View Summary)

Properties

code: string
errno: number
message: string
name: string
stack?: string
\ No newline at end of file diff --git a/interfaces/_internal_.Error.html b/interfaces/_internal_.Error.html new file mode 100644 index 00000000..73504a93 --- /dev/null +++ b/interfaces/_internal_.Error.html @@ -0,0 +1 @@ +Error | zeromq.js
interface Error {
    message: string;
    name: string;
    stack?: string;
}

Hierarchy (View Summary)

Properties

Properties

message: string
name: string
stack?: string
\ No newline at end of file diff --git a/interfaces/_internal_.EventAddress.html b/interfaces/_internal_.EventAddress.html new file mode 100644 index 00000000..cebb4deb --- /dev/null +++ b/interfaces/_internal_.EventAddress.html @@ -0,0 +1 @@ +EventAddress | zeromq.js

Interface EventAddress

An object that contains the address of an event.

interface EventAddress {
    address: string;
}

Properties

Properties

address: string
\ No newline at end of file diff --git a/interfaces/_internal_.EventError.html b/interfaces/_internal_.EventError.html new file mode 100644 index 00000000..6f571403 --- /dev/null +++ b/interfaces/_internal_.EventError.html @@ -0,0 +1 @@ +EventError | zeromq.js

Interface EventError<E>

An object that contains an error for an event.

interface EventError<E = ErrnoError> {
    error: E;
}

Type Parameters

Properties

Properties

error: E
\ No newline at end of file diff --git a/interfaces/_internal_.EventInterval.html b/interfaces/_internal_.EventInterval.html new file mode 100644 index 00000000..3c9aeb81 --- /dev/null +++ b/interfaces/_internal_.EventInterval.html @@ -0,0 +1 @@ +EventInterval | zeromq.js

Interface EventInterval

An object that contains the interval for an event.

interface EventInterval {
    interval: number;
}

Properties

Properties

interval: number
\ No newline at end of file diff --git a/interfaces/_internal_.IteratorReturnResult.html b/interfaces/_internal_.IteratorReturnResult.html new file mode 100644 index 00000000..60f81ab1 --- /dev/null +++ b/interfaces/_internal_.IteratorReturnResult.html @@ -0,0 +1 @@ +IteratorReturnResult | zeromq.js

Interface IteratorReturnResult<TReturn>

interface IteratorReturnResult<TReturn> {
    done: true;
    value: TReturn;
}

Type Parameters

  • TReturn

Properties

Properties

done: true
value: TReturn
\ No newline at end of file diff --git a/interfaces/_internal_.IteratorYieldResult.html b/interfaces/_internal_.IteratorYieldResult.html new file mode 100644 index 00000000..99b1373a --- /dev/null +++ b/interfaces/_internal_.IteratorYieldResult.html @@ -0,0 +1 @@ +IteratorYieldResult | zeromq.js

Interface IteratorYieldResult<TYield>

interface IteratorYieldResult<TYield> {
    done?: false;
    value: TYield;
}

Type Parameters

  • TYield

Properties

Properties

done?: false
value: TYield
\ No newline at end of file diff --git a/interfaces/_internal_.PromiseLike.html b/interfaces/_internal_.PromiseLike.html new file mode 100644 index 00000000..49d5237a --- /dev/null +++ b/interfaces/_internal_.PromiseLike.html @@ -0,0 +1 @@ +PromiseLike | zeromq.js

Interface PromiseLike<T>

interface PromiseLike<T> {
    then<TResult1 = T, TResult2 = never>(
        onfulfilled?: null | (value: T) => TResult1 | PromiseLike<TResult1>,
        onrejected?: null | (reason: any) => TResult2 | PromiseLike<TResult2>,
    ): PromiseLike<TResult1 | TResult2>;
}

Type Parameters

  • T

Methods

Methods

\ No newline at end of file diff --git a/interfaces/_internal_.ProtoError.html b/interfaces/_internal_.ProtoError.html new file mode 100644 index 00000000..864122ed --- /dev/null +++ b/interfaces/_internal_.ProtoError.html @@ -0,0 +1 @@ +ProtoError | zeromq.js

Interface ProtoError

An event that represents a protocol error.

interface ProtoError {
    code:
        | "ERR_ZMTP_UNSPECIFIED"
        | "ERR_ZMTP_UNEXPECTED_COMMAND"
        | "ERR_ZMTP_INVALID_SEQUENCE"
        | "ERR_ZMTP_KEY_EXCHANGE"
        | "ERR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED"
        | "ERR_ZMTP_MALFORMED_COMMAND_MESSAGE"
        | "ERR_ZMTP_MALFORMED_COMMAND_HELLO"
        | "ERR_ZMTP_MALFORMED_COMMAND_INITIATE"
        | "ERR_ZMTP_MALFORMED_COMMAND_ERROR"
        | "ERR_ZMTP_MALFORMED_COMMAND_READY"
        | "ERR_ZMTP_MALFORMED_COMMAND_WELCOME"
        | "ERR_ZMTP_INVALID_METADATA"
        | "ERR_ZMTP_CRYPTOGRAPHIC"
        | "ERR_ZMTP_MECHANISM_MISMATCH"
        | "ERR_ZAP_UNSPECIFIED"
        | "ERR_ZAP_MALFORMED_REPLY"
        | "ERR_ZAP_BAD_REQUEST_ID"
        | "ERR_ZAP_BAD_VERSION"
        | "ERR_ZAP_INVALID_STATUS_CODE"
        | "ERR_ZAP_INVALID_METADATA";
    message: string;
    name: string;
    stack?: string;
}

Hierarchy (View Summary)

Properties

code:
    | "ERR_ZMTP_UNSPECIFIED"
    | "ERR_ZMTP_UNEXPECTED_COMMAND"
    | "ERR_ZMTP_INVALID_SEQUENCE"
    | "ERR_ZMTP_KEY_EXCHANGE"
    | "ERR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED"
    | "ERR_ZMTP_MALFORMED_COMMAND_MESSAGE"
    | "ERR_ZMTP_MALFORMED_COMMAND_HELLO"
    | "ERR_ZMTP_MALFORMED_COMMAND_INITIATE"
    | "ERR_ZMTP_MALFORMED_COMMAND_ERROR"
    | "ERR_ZMTP_MALFORMED_COMMAND_READY"
    | "ERR_ZMTP_MALFORMED_COMMAND_WELCOME"
    | "ERR_ZMTP_INVALID_METADATA"
    | "ERR_ZMTP_CRYPTOGRAPHIC"
    | "ERR_ZMTP_MECHANISM_MISMATCH"
    | "ERR_ZAP_UNSPECIFIED"
    | "ERR_ZAP_MALFORMED_REPLY"
    | "ERR_ZAP_BAD_REQUEST_ID"
    | "ERR_ZAP_BAD_VERSION"
    | "ERR_ZAP_INVALID_STATUS_CODE"
    | "ERR_ZAP_INVALID_METADATA"
message: string
name: string
stack?: string
\ No newline at end of file diff --git a/interfaces/_internal_.SharedArrayBuffer.html b/interfaces/_internal_.SharedArrayBuffer.html new file mode 100644 index 00000000..6bfa74de --- /dev/null +++ b/interfaces/_internal_.SharedArrayBuffer.html @@ -0,0 +1 @@ +SharedArrayBuffer | zeromq.js

Interface SharedArrayBuffer

interface SharedArrayBuffer {
    "[species]": SharedArrayBuffer;
    "[toStringTag]": "SharedArrayBuffer";
    byteLength: number;
    slice(begin: number, end?: number): SharedArrayBuffer;
}

Properties

"[species]": SharedArrayBuffer
"[toStringTag]": "SharedArrayBuffer"
byteLength: number

Read-only. The length of the ArrayBuffer (in bytes).

Methods

  • Returns a section of an SharedArrayBuffer.

    Parameters

    • begin: number
    • Optionalend: number

    Returns SharedArrayBuffer

\ No newline at end of file diff --git a/interfaces/_internal_.SharedArrayBufferConstructor.html b/interfaces/_internal_.SharedArrayBufferConstructor.html new file mode 100644 index 00000000..5f7e30a9 --- /dev/null +++ b/interfaces/_internal_.SharedArrayBufferConstructor.html @@ -0,0 +1 @@ +SharedArrayBufferConstructor | zeromq.js

Interface SharedArrayBufferConstructor

interface SharedArrayBufferConstructor {
    new SharedArrayBufferConstructor(byteLength: number): SharedArrayBuffer;
    prototype: SharedArrayBuffer;
}

Constructors

Properties

Constructors

  • Parameters

    • byteLength: number

    Returns SharedArrayBuffer

Properties

\ No newline at end of file diff --git a/media/queue.ts b/media/queue.ts new file mode 100644 index 00000000..109500c0 --- /dev/null +++ b/media/queue.ts @@ -0,0 +1,36 @@ +import {Dealer, type MessageLike} from "zeromq" + +export class Queue { + queue: MessageLike[] = [] + socket: Dealer + max: number + sending = false + + constructor(socket: Dealer, max = 100) { + this.socket = socket + this.max = max + } + + send(msg: MessageLike) { + console.log(`Sending message: ${msg}`) + if (this.queue.length > this.max) { + throw new Error("Queue is full") + } + this.queue.push(msg) + return this.trySend() + } + + async trySend() { + if (this.sending) { + return + } + this.sending = true + + while (this.queue.length > 0) { + const firstMessage = this.queue.shift()! + await this.socket.send(firstMessage) + } + + this.sending = false + } +} diff --git a/modules.html b/modules.html index ac80e9be..ab947d7e 100644 --- a/modules.html +++ b/modules.html @@ -1 +1 @@ -zeromq.js

zeromq.js

Classes

Context
Dealer
Observer
Pair
Proxy
Publisher
Pull
Push
Reply
Request
Router
Socket
Stream
Subscriber
XPublisher
XSubscriber

Interfaces

EventSubscriber
Readable
RouterConnectOptions
StreamConnectOptions
Writable

Type Aliases

Event
EventOfType
EventType
Message
MessageLike
SocketOptions

Variables

capability
context
version

Functions

curveKeyPair
\ No newline at end of file +zeromq.js

zeromq.js

Modules

<internal>

Classes

Context
Dealer
Observer
Pair
Proxy
Publisher
Pull
Push
Reply
Request
Router
Socket
Stream
Subscriber
XPublisher
XSubscriber

Interfaces

EventSubscriber
Readable
RouterConnectOptions
StreamConnectOptions
Writable

Type Aliases

Event
EventOfType
EventType
Message
MessageLike
SocketOptions

Variables

capability
context
version

Functions

curveKeyPair
\ No newline at end of file diff --git a/modules/_internal_.html b/modules/_internal_.html new file mode 100644 index 00000000..519118cf --- /dev/null +++ b/modules/_internal_.html @@ -0,0 +1 @@ +<internal> | zeromq.js

Module <internal>

Enumerations

SocketType

Interfaces

ArrayBufferView
AsyncIterator
AuthError
ErrnoError
Error
EventAddress
EventError
EventInterval
IteratorReturnResult
IteratorYieldResult
PromiseLike
ProtoError
SharedArrayBuffer
SharedArrayBufferConstructor

Type Aliases

ArrayBufferLike
EventFor
Expand
Extract
IfEquals
IteratorResult
Options
Partial
Pick
WritableKeys

Variables

Error
SharedArrayBuffer
\ No newline at end of file diff --git a/types/Event.html b/types/Event.html index 4a75b4cb..2b6b68f1 100644 --- a/types/Event.html +++ b/types/Event.html @@ -1 +1 @@ -Event | zeromq.js

Type Alias Event

Event:
    | EventFor<"accept", EventAddress>
    | EventFor<"accept:error", EventAddress & EventError>
    | EventFor<"bind", EventAddress>
    | EventFor<"bind:error", EventAddress & EventError>
    | EventFor<"connect", EventAddress>
    | EventFor<"connect:delay", EventAddress>
    | EventFor<"connect:retry", EventAddress & EventInterval>
    | EventFor<"close", EventAddress>
    | EventFor<"close:error", EventAddress & EventError>
    | EventFor<"disconnect", EventAddress>
    | EventFor<"end">
    | EventFor<"handshake", EventAddress>
    | EventFor<
        "handshake:error:protocol",
        EventAddress & EventError<ProtoError>,
    >
    | EventFor<"handshake:error:auth", EventAddress & EventError<AuthError>>
    | EventFor<"handshake:error:other", EventAddress & EventError>
    | EventFor<"unknown">

A union type that represents all possible even types and the associated data. Events always have a type property with an EventType value.

The following socket events can be generated. This list may be different depending on the ZeroMQ version that is used.

Note that the error event is avoided by design, since this has a special behaviour in Node.js causing an exception to be thrown if it is unhandled.

Other error names are adjusted to be as close to possible as other networking related event names in Node.js and/or to the corresponding ZeroMQ.js method call. Events (including any errors) that correspond to a specific operation are namespaced with a colon :, e.g. bind:error or connect:retry.

  • accept - ZMQ_EVENT_ACCEPTED The socket has accepted a connection from a remote peer.

  • accept:error - ZMQ_EVENT_ACCEPT_FAILED The socket has rejected a connection from a remote peer.

    The following additional details will be included with this event:

    • error - An error object that describes the specific error that occurred.
  • bind - ZMQ_EVENT_LISTENING The socket was successfully bound to a network interface.

  • bind:error - ZMQ_EVENT_BIND_FAILED The socket could not bind to a given interface.

    The following additional details will be included with this event:

    • error - An error object that describes the specific error that occurred.
  • connect - ZMQ_EVENT_CONNECTED The socket has successfully connected to a remote peer.

  • connect:delay - ZMQ_EVENT_CONNECT_DELAYED A connect request on the socket is pending.

  • connect:retry - ZMQ_EVENT_CONNECT_RETRIED A connection attempt is being handled by reconnect timer. Note that the reconnect interval is recalculated at each retry.

    The following additional details will be included with this event:

    • interval - The current reconnect interval.
  • close - ZMQ_EVENT_CLOSED The socket was closed.

  • close:error - ZMQ_EVENT_CLOSE_FAILED The socket close failed. Note that this event occurs only on IPC transports..

    The following additional details will be included with this event:

    • error - An error object that describes the specific error that occurred.
  • disconnect - ZMQ_EVENT_DISCONNECTED The socket was disconnected unexpectedly.

  • handshake - ZMQ_EVENT_HANDSHAKE_SUCCEEDED The ZMTP security mechanism handshake succeeded. NOTE: This event may still be in DRAFT statea and not yet available in stable releases.

  • handshake:error:protocol - ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL The ZMTP security mechanism handshake failed due to some mechanism protocol error, either between the ZMTP mechanism peers, or between the mechanism server and the ZAP handler. This indicates a configuration or implementation error in either peer resp. the ZAP handler. NOTE: This event may still be in DRAFT state and not yet available in stable releases.

  • handshake:error:auth - ZMQ_EVENT_HANDSHAKE_FAILED_AUTH The ZMTP security mechanism handshake failed due to an authentication failure. NOTE: This event may still be in DRAFT state and not yet available in stable releases.

  • handshake:error:other - ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL Unspecified error during handshake. NOTE: This event may still be in DRAFT state and not yet available in stable releases.

  • end - ZMQ_EVENT_MONITOR_STOPPED Monitoring on this socket ended.

  • unknown An event was generated by ZeroMQ that the Node.js library could not interpret. Please submit a pull request for new event types if they are not yet included.

\ No newline at end of file +Event | zeromq.js

Type Alias Event

Event:
    | EventFor<"accept", EventAddress>
    | EventFor<"accept:error", EventAddress & EventError>
    | EventFor<"bind", EventAddress>
    | EventFor<"bind:error", EventAddress & EventError>
    | EventFor<"connect", EventAddress>
    | EventFor<"connect:delay", EventAddress>
    | EventFor<"connect:retry", EventAddress & EventInterval>
    | EventFor<"close", EventAddress>
    | EventFor<"close:error", EventAddress & EventError>
    | EventFor<"disconnect", EventAddress>
    | EventFor<"end">
    | EventFor<"handshake", EventAddress>
    | EventFor<
        "handshake:error:protocol",
        EventAddress & EventError<ProtoError>,
    >
    | EventFor<"handshake:error:auth", EventAddress & EventError<AuthError>>
    | EventFor<"handshake:error:other", EventAddress & EventError>
    | EventFor<"unknown">

A union type that represents all possible even types and the associated data. Events always have a type property with an EventType value.

The following socket events can be generated. This list may be different depending on the ZeroMQ version that is used.

Note that the error event is avoided by design, since this has a special behaviour in Node.js causing an exception to be thrown if it is unhandled.

Other error names are adjusted to be as close to possible as other networking related event names in Node.js and/or to the corresponding ZeroMQ.js method call. Events (including any errors) that correspond to a specific operation are namespaced with a colon :, e.g. bind:error or connect:retry.

  • accept - ZMQ_EVENT_ACCEPTED The socket has accepted a connection from a remote peer.

  • accept:error - ZMQ_EVENT_ACCEPT_FAILED The socket has rejected a connection from a remote peer.

    The following additional details will be included with this event:

    • error - An error object that describes the specific error that occurred.
  • bind - ZMQ_EVENT_LISTENING The socket was successfully bound to a network interface.

  • bind:error - ZMQ_EVENT_BIND_FAILED The socket could not bind to a given interface.

    The following additional details will be included with this event:

    • error - An error object that describes the specific error that occurred.
  • connect - ZMQ_EVENT_CONNECTED The socket has successfully connected to a remote peer.

  • connect:delay - ZMQ_EVENT_CONNECT_DELAYED A connect request on the socket is pending.

  • connect:retry - ZMQ_EVENT_CONNECT_RETRIED A connection attempt is being handled by reconnect timer. Note that the reconnect interval is recalculated at each retry.

    The following additional details will be included with this event:

    • interval - The current reconnect interval.
  • close - ZMQ_EVENT_CLOSED The socket was closed.

  • close:error - ZMQ_EVENT_CLOSE_FAILED The socket close failed. Note that this event occurs only on IPC transports..

    The following additional details will be included with this event:

    • error - An error object that describes the specific error that occurred.
  • disconnect - ZMQ_EVENT_DISCONNECTED The socket was disconnected unexpectedly.

  • handshake - ZMQ_EVENT_HANDSHAKE_SUCCEEDED The ZMTP security mechanism handshake succeeded. NOTE: This event may still be in DRAFT statea and not yet available in stable releases.

  • handshake:error:protocol - ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL The ZMTP security mechanism handshake failed due to some mechanism protocol error, either between the ZMTP mechanism peers, or between the mechanism server and the ZAP handler. This indicates a configuration or implementation error in either peer resp. the ZAP handler. NOTE: This event may still be in DRAFT state and not yet available in stable releases.

  • handshake:error:auth - ZMQ_EVENT_HANDSHAKE_FAILED_AUTH The ZMTP security mechanism handshake failed due to an authentication failure. NOTE: This event may still be in DRAFT state and not yet available in stable releases.

  • handshake:error:other - ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL Unspecified error during handshake. NOTE: This event may still be in DRAFT state and not yet available in stable releases.

  • end - ZMQ_EVENT_MONITOR_STOPPED Monitoring on this socket ended.

  • unknown An event was generated by ZeroMQ that the Node.js library could not interpret. Please submit a pull request for new event types if they are not yet included.

\ No newline at end of file diff --git a/types/EventOfType.html b/types/EventOfType.html index 6a56303a..aec39f96 100644 --- a/types/EventOfType.html +++ b/types/EventOfType.html @@ -1 +1 @@ -EventOfType | zeromq.js

Type Alias EventOfType<E>

EventOfType: Expand<Extract<Event, Event & EventFor<E>>>

Represents the event data object given one particular event type, for example EventOfType<"accept">.

Type Parameters

E The specific event type.

\ No newline at end of file +EventOfType | zeromq.js

Type Alias EventOfType<E>

EventOfType: Expand<Extract<Event, Event & EventFor<E>>>

Represents the event data object given one particular event type, for example EventOfType<"accept">.

Type Parameters

\ No newline at end of file diff --git a/types/EventType.html b/types/EventType.html index 00b2f94d..62a43c44 100644 --- a/types/EventType.html +++ b/types/EventType.html @@ -1 +1 @@ -EventType | zeromq.js

Type Alias EventType

EventType: Event["type"]

A union type of all available event types. See Event for an overview of the events that can be observed.

\ No newline at end of file +EventType | zeromq.js

Type Alias EventType

EventType: Event["type"]

A union type of all available event types. See Event for an overview of the events that can be observed.

\ No newline at end of file diff --git a/types/Message.html b/types/Message.html index 87800f46..7274cb3f 100644 --- a/types/Message.html +++ b/types/Message.html @@ -1 +1 @@ -Message | zeromq.js

Type Alias Message

Message: Buffer

A type representing the messages that are returned inside promises by Readable.receive().

\ No newline at end of file +Message | zeromq.js

Type Alias Message

Message: Buffer

A type representing the messages that are returned inside promises by Readable.receive().

\ No newline at end of file diff --git a/types/MessageLike.html b/types/MessageLike.html index e7f24f4f..a9f05616 100644 --- a/types/MessageLike.html +++ b/types/MessageLike.html @@ -1 +1 @@ -MessageLike | zeromq.js

Type Alias MessageLike

MessageLike:
    | ArrayBufferView
    | ArrayBuffer
    | SharedArrayBuffer
    | string
    | number
    | null

Union type representing all message types that are accepted by Writable.send().

\ No newline at end of file +MessageLike | zeromq.js

Type Alias MessageLike

MessageLike:
    | ArrayBufferView
    | ArrayBuffer
    | SharedArrayBuffer
    | string
    | number
    | null

Union type representing all message types that are accepted by Writable.send().

\ No newline at end of file diff --git a/types/SocketOptions.html b/types/SocketOptions.html index dc5ddc00..93013e62 100644 --- a/types/SocketOptions.html +++ b/types/SocketOptions.html @@ -1 +1 @@ -SocketOptions | zeromq.js

Type Alias SocketOptions<S>

SocketOptions: Options<S, { context: Context }>

Represents the options that can be assigned in the constructor of a given socket type, for example new Dealer({...}). Readonly options for the particular socket will be omitted.

Type Parameters

S The socket type to which the options should be applied.

\ No newline at end of file +SocketOptions | zeromq.js

Type Alias SocketOptions<S>

SocketOptions: Options<S, { context: Context }>

Represents the options that can be assigned in the constructor of a given socket type, for example new Dealer({...}). Readonly options for the particular socket will be omitted.

Type Parameters

  • S extends Socket

    The socket type to which the options should be applied.

\ No newline at end of file diff --git a/types/_internal_.ArrayBufferLike.html b/types/_internal_.ArrayBufferLike.html new file mode 100644 index 00000000..513be890 --- /dev/null +++ b/types/_internal_.ArrayBufferLike.html @@ -0,0 +1 @@ +ArrayBufferLike | zeromq.js

Type Alias ArrayBufferLike

ArrayBufferLike: ArrayBufferTypes[keyof ArrayBufferTypes]
\ No newline at end of file diff --git a/types/_internal_.EventFor.html b/types/_internal_.EventFor.html new file mode 100644 index 00000000..197d48c8 --- /dev/null +++ b/types/_internal_.EventFor.html @@ -0,0 +1,2 @@ +EventFor | zeromq.js

Type Alias EventFor<T, D>

EventFor: Expand<{ type: T } & D>

Represents a ZeroMQ event type.

Type Parameters

  • T extends string

    The event type (e.g., "bind", "connect", "close", etc.), which is stored in the type property.

  • D = {}

    The base event data type (which is unified by the type).

type AllEvents = EventFor<"bind", { address: string }>
// is equivalent to
type AllEvents = { type: "bind", address: string } +
\ No newline at end of file diff --git a/types/_internal_.Expand.html b/types/_internal_.Expand.html new file mode 100644 index 00000000..407bfc62 --- /dev/null +++ b/types/_internal_.Expand.html @@ -0,0 +1 @@ +Expand | zeromq.js

Type Alias Expand<T>Internal

Expand: T extends infer O ? { [K in keyof O]: O[K] } : never

Utility type that expands a type into its keys and values.

https://stackoverflow.com/questions/57683303

Type Parameters

  • T
\ No newline at end of file diff --git a/types/_internal_.Extract.html b/types/_internal_.Extract.html new file mode 100644 index 00000000..24a44aaf --- /dev/null +++ b/types/_internal_.Extract.html @@ -0,0 +1 @@ +Extract | zeromq.js

Type Alias Extract<T, U>

Extract: T extends U ? T : never

Extract from T those types that are assignable to U

Type Parameters

  • T
  • U
\ No newline at end of file diff --git a/types/_internal_.IfEquals.html b/types/_internal_.IfEquals.html new file mode 100644 index 00000000..1551b897 --- /dev/null +++ b/types/_internal_.IfEquals.html @@ -0,0 +1 @@ +IfEquals | zeromq.js

Type Alias IfEquals<X, Y, A, B>Internal

IfEquals: <T>() => T extends X ? 1 : 2 extends <T>() => T extends Y ? 1 : 2
    ? A
    : B

Type Parameters

  • X
  • Y
  • A
  • B = never
\ No newline at end of file diff --git a/types/_internal_.IteratorResult.html b/types/_internal_.IteratorResult.html new file mode 100644 index 00000000..2b47e66d --- /dev/null +++ b/types/_internal_.IteratorResult.html @@ -0,0 +1 @@ +IteratorResult | zeromq.js

Type Alias IteratorResult<T, TReturn>

Type Parameters

  • T
  • TReturn = any
\ No newline at end of file diff --git a/types/_internal_.Options.html b/types/_internal_.Options.html new file mode 100644 index 00000000..cb1eb4c3 --- /dev/null +++ b/types/_internal_.Options.html @@ -0,0 +1,2 @@ +Options | zeromq.js

Type Alias Options<T, E>Internal

Options: Expand<Partial<E & Pick<T, WritableKeys<T>>>>

Utility type for defining options for a given type. It allows setting the writable properties of a type.

Type Parameters

  • T

    The type to define options for.

  • E = {}

    Additional optional properties. Defaults to an empty object.

interface Server {
port: number
readonly name: string
}
type ServerOptions = Options<Server, { debug?: boolean }>
// is equivalent to:
interface ServerOptions {
port?: number
debug?: boolean
} +
\ No newline at end of file diff --git a/types/_internal_.Partial.html b/types/_internal_.Partial.html new file mode 100644 index 00000000..ada76442 --- /dev/null +++ b/types/_internal_.Partial.html @@ -0,0 +1 @@ +Partial | zeromq.js

Type Alias Partial<T>

Partial: { [P in keyof T]?: T[P] }

Make all properties in T optional

Type Parameters

  • T
\ No newline at end of file diff --git a/types/_internal_.Pick.html b/types/_internal_.Pick.html new file mode 100644 index 00000000..125abdf8 --- /dev/null +++ b/types/_internal_.Pick.html @@ -0,0 +1 @@ +Pick | zeromq.js

Type Alias Pick<T, K>

Pick: { [P in K]: T[P] }

From T, pick a set of properties whose keys are in the union K

Type Parameters

  • T
  • K extends keyof T
\ No newline at end of file diff --git a/types/_internal_.WritableKeys.html b/types/_internal_.WritableKeys.html new file mode 100644 index 00000000..a4b7bf0b --- /dev/null +++ b/types/_internal_.WritableKeys.html @@ -0,0 +1 @@ +WritableKeys | zeromq.js

Type Alias WritableKeys<T>Internal

WritableKeys: {
    [P in keyof T]-?: T[P] extends Function
        ? never
        : IfEquals<{ [Q in P]: T[P] }, { -readonly [Q in P]: T[P] }, P>
}[keyof T]

Get the writable keys of a type.

Type Parameters

  • T
\ No newline at end of file diff --git a/variables/_internal_.Error-1.html b/variables/_internal_.Error-1.html new file mode 100644 index 00000000..00959acd --- /dev/null +++ b/variables/_internal_.Error-1.html @@ -0,0 +1 @@ +Error | zeromq.js
\ No newline at end of file diff --git a/variables/_internal_.SharedArrayBuffer-1.html b/variables/_internal_.SharedArrayBuffer-1.html new file mode 100644 index 00000000..25d7fd79 --- /dev/null +++ b/variables/_internal_.SharedArrayBuffer-1.html @@ -0,0 +1 @@ +SharedArrayBuffer | zeromq.js

Variable SharedArrayBuffer

SharedArrayBuffer: SharedArrayBufferConstructor
\ No newline at end of file diff --git a/variables/capability.html b/variables/capability.html index 629f4746..53738fa3 100644 --- a/variables/capability.html +++ b/variables/capability.html @@ -1 +1 @@ -capability | zeromq.js

Variable capabilityConst

capability: Partial<
    {
        curve: boolean;
        draft: boolean;
        gssapi: boolean;
        ipc: boolean;
        norm: boolean;
        pgm: boolean;
        tipc: boolean;
    },
>

Exposes some of the optionally available ØMQ capabilities, which may depend on the library version and platform.

This is an object with keys corresponding to supported ØMQ features and transport protocols. Available capabilities will be set to true. Unavailable capabilities will be absent or set to false.

Possible keys include:

  • ipc - Support for the ipc:// protocol.
  • pgm - Support for the pgm:// protocol.
  • tipc - Support for the tipc:// protocol.
  • norm - Support for the norm:// protocol.
  • curve - Support for the CURVE security mechanism.
  • gssapi - Support for the GSSAPI security mechanism.
  • draft - Wether the library is built with support for DRAFT sockets.
\ No newline at end of file +capability | zeromq.js

Variable capabilityConst

capability: Partial<
    {
        curve: boolean;
        draft: boolean;
        gssapi: boolean;
        ipc: boolean;
        norm: boolean;
        pgm: boolean;
        tipc: boolean;
    },
>

Exposes some of the optionally available ØMQ capabilities, which may depend on the library version and platform.

This is an object with keys corresponding to supported ØMQ features and transport protocols. Available capabilities will be set to true. Unavailable capabilities will be absent or set to false.

Possible keys include:

  • ipc - Support for the ipc:// protocol.
  • pgm - Support for the pgm:// protocol.
  • tipc - Support for the tipc:// protocol.
  • norm - Support for the norm:// protocol.
  • curve - Support for the CURVE security mechanism.
  • gssapi - Support for the GSSAPI security mechanism.
  • draft - Wether the library is built with support for DRAFT sockets.
\ No newline at end of file diff --git a/variables/context-1.html b/variables/context-1.html index a630ce32..2d2cb8cc 100644 --- a/variables/context-1.html +++ b/variables/context-1.html @@ -1 +1 @@ -context | zeromq.js

Variable contextConst

context: Context

Any socket that has no explicit context passed in during construction will be associated with this context. The default context is exposed in order to be able to change its behaviour with Context options.

\ No newline at end of file +context | zeromq.js

Variable contextConst

context: Context

Any socket that has no explicit context passed in during construction will be associated with this context. The default context is exposed in order to be able to change its behaviour with Context options.

\ No newline at end of file diff --git a/variables/version.html b/variables/version.html index a7e8a8f3..e40dd5ba 100644 --- a/variables/version.html +++ b/variables/version.html @@ -1 +1 @@ -version | zeromq.js

Variable versionConst

version: string

The version of the ØMQ library the bindings were built with. Formatted as (major).(minor).(patch). For example: "4.3.2".

\ No newline at end of file +version | zeromq.js

Variable versionConst

version: string

The version of the ØMQ library the bindings were built with. Formatted as (major).(minor).(patch). For example: "4.3.2".

\ No newline at end of file