ZMQ::Constants(3)

πŸ“¦
version 1.04 Β· 2 versions
, in fedora 43

πŸ’– ZMQ::Constants β€” constants for libzmq, bestie πŸ’–

okay so real quick, this is a page from the User Contributed Perl Documentation section, and it's all about ZMQ::Constants, which is, exactly like it sounds, the home of the constants for libzmq. pull up a chair, we're doing this together 🫢


✨ NAME ✨

ZMQ::Constants β€” constants for libzmq, no cap πŸ’…


🌸 SYNOPSIS 🌸

use ZMQ::Constants ':all'; # pulls in all constants for all versions
use ZMQ::Constants ':v3.1.1', ':all'; # pulls in constants for 3.1.1
use ZMQ::Constants ':v3.1.2', ':all'; # pulls in constants for 3.1.2

# If you know what you're doing, this is the best way:
# (i.e., explicitly import the symbols)
use ZMQ::Constants qw(ZMQ_REQ);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: libzmq is a fast-changing beast. constants get renamed, new ones get removed, the whole thing is chaos 😭 and back in the day we used to auto-generate these constants straight out of the libzmq source code β€” but then adapting the binding code to every single change got so tedious, and controlling which version contains which constants got genuinely impossible to manage. it's giving nightmare fuel ngl.

so now: this module is separate from the main ZMQ code, and it lists the constants statically. and you can also tell it which set of constants to pull in, depending on the zmq version πŸ‘‘

if you don't care about being strict about which constants land in your code, then don't even bother with the ':vX.X.X' notation β€” just use it like a normal module:

use ZMQ::Constants qw(:all);     # pulls all known constants...
                                 # note: may contain extra constants
                                 # if we have clashes in the future

use ZMQ::Constants qw(ZMQ_PUSH); # import just ZMQ_PUSH

⭐ SUPPORTED VERSIONS ⭐

i have checked that the constants for the following versions are available βœ…

note that for regular usage, you should just explicitly import what you need. the following exists basically to let me create a sane catalog of what's available in what version. and i will reiterate: IN MOST CASES YOU SHOULD JUST IMPORT WHAT YOU NEED:
use ZMQ::Constants qw(ZMQ_REP ZMQ_REQ); # etc

please send pullreqs if there are new constants that are not defined πŸ™

  • libzmq 2.1.11
  • libzmq 3.1.1
    • no ZMQ device related stuff
  • libzmq 3.1.2
    • NOTE: this is the libzmq/master branch as of this writing. new constants may have been added.
    • reintroduces ZMQ device related constants, and adds ZMQ_FAIL_UNROUTABLE

πŸ’œ FUNCTIONS πŸ’œ

these functions are usually for internal use only. if you're just a ZMQ.pm user, you should not need to use them, bestie 🫢

🌈 register_set

creates a new "set" of constants for a particular version.

🌈 get_sockopt_type

gets the type for the given libzmq socket option. this is used when ZMQ::getsockopt is called, to determine the underlying socket option type.

🌈 set_sockopt_type

sets the type for the given libzmq socket option.


πŸŽ€ SEE ALSO πŸŽ€

  • ZMQ::LibZMQ2
  • ZMQ::LibZMQ3
  • ZMQ::CZMQ
  • ZMQ

and also, from the internet:


πŸ‘‘ AUTHOR πŸ‘‘

Daisuke Maki <daisuke@endeworks.jp> ✨


The ZeroMQ module is

Copyright (C) 2010 by Daisuke Maki

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.


and that's the whole page, bestie πŸ’– this one was rendered by perl v5.42.0 on 2025-07-25, so if you're reading this and the date is giving ancient, that's why πŸ•°οΈ slay, go import exactly the constants you need and nothing more, periodt πŸ’…

πŸ“¦ where this page comes from