Socket.unsubscribe

Removes a message filter.

  1. void unsubscribe(ubyte[] filterPrefix)
    struct Socket
    @safe
    void
    unsubscribe
    (
    const ubyte[] filterPrefix
    )
  2. void unsubscribe(char[] filterPrefix)
  3. this(SocketType type)
  4. this(Context context, SocketType type)

Throws

ZmqException if $(ZMQ) reports an error.

Corresponds to

$(ZMQREF zmq_msg_setsockopt()) with ZMQ_SUBSCRIBE.

Examples

// Subscribe to messages that start with "foo" or "bar".
auto sck = Socket(SocketType.sub);
sck.subscribe("foo");
sck.subscribe("bar");
// ...
// From now on, only accept messages that start with "bar"
sck.unsubscribe("foo");

Meta