Socket.this

Creates a new $(ZMQ) socket.

If context is not specified, the default _context (as returned by $(FREF defaultContext)) is used.

  1. this(SocketType type)
  2. this(Context context, SocketType type)
    struct Socket

Throws

ZmqException if $(ZMQ) reports an error.

Corresponds to

$(ZMQREF zmq_socket())

Examples

With default context:

auto sck = Socket(SocketType.push);
assert (sck.initialized);

With explicit context:

auto ctx = Context();
auto sck = Socket(ctx, SocketType.push);
assert (sck.initialized);

Meta