Socket.type

$(ANCHOR Socket.misc_options) Miscellaneous socket options.

Each of these corresponds to an option passed to $(ZMQREF zmq_getsockopt()) and $(ZMQREF zmq_setsockopt()). For example, identity corresponds to ZMQ_IDENTITY, receiveBufferSize corresponds to ZMQ_RCVBUF, etc.

Notes:

  • sck.identity = "foobar";
    assert (sck.identity.asString() == "foobar");
    For convenience, the setter for the identity property accepts strings. To retrieve a string with the getter, use the $(FREF asString) function.
  • The linger, receiveTimeout, sendTimeout and handshakeInterval properties may have the special _value infiniteDuration. This is translated to an option _value of -1 or 0 (depending on which property is being set) in the C API.
  • Some options have array type, and these allow the user to supply a buffer in which to store the _value, to avoid a GC allocation. The return _value is then a slice of this buffer. These are not marked as @property, but are prefixed with "get" (e.g. getIdentity()). A user-supplied buffer is required for some options, namely getPlainUsername() and getPlainPassword(), and these do not have @property versions. getCurveXxxKey() and getCurveXxxKeyZ85() require buffers which are at least 32 and 41 bytes long, respectively.
  • The ZMQ_SUBSCRIBE and ZMQ_UNSUBSCRIBE options are treated differently from the others; see $(FREF Socket.subscribe) and $(FREF Socket.unsubscribe)

Throws

ZmqException if $(ZMQ) reports an error.
$(STDREF conv,ConvOverflowException) if a given Duration is longer than the number of milliseconds that will fit in an int (only applies to properties of $(COREF time,Duration) type).
$(COREF exception,RangeError) if the dest buffers passed to getCurveXxxKey() or getCurveXxxKeyZ85() are less than 32 or 41 bytes long, respectively.

Corresponds to

$(ZMQREF zmq_getsockopt()) and $(ZMQREF zmq_setsockopt()).

Meta