Socket.sendConst

Sends a constant-memory message frame.

_sendConst blocks until the frame has been queued on the socket. trySendConst performs the operation in non-blocking mode, and returns a bool value that signifies whether the frame was queued on the socket.

The more parameter specifies whether this is a multipart message and there are _more frames to follow.

  1. void sendConst(ubyte[] data, bool more)
    struct Socket
    @safe
    void
    sendConst
    (
    immutable ubyte[] data
    ,
    bool more = false
    )
  2. void sendConst(string data, bool more)
  3. this(SocketType type)
  4. this(Context context, SocketType type)

Throws

ZmqException if $(ZMQ) reports an error.

Corresponds to

$(ZMQREF zmq_send_const()) (with the ZMQ_DONTWAIT flag, in the case of trySend, and with the ZMQ_SNDMORE flag if more == true).

Examples

static immutable arr = cast(ubyte[]) [11, 226, 92];
auto sck = Socket(SocketType.pub);
sck.sendConst(arr);
sck.sendConst("Hello World!");

Meta