ZmqException if $(ZMQ) reports an error.
$(ZMQREF zmq_msg_close()) followed by $(ZMQREF zmq_msg_init_data()).
// Garbage-collected memory auto msg = Frame(256); assert (msg.size == 256); auto buf = new ubyte[123]; msg.rebuild(buf); assert(msg.size == buf.length); assert(msg.data.ptr == buf.ptr);
// Manually managed memory import core.stdc.stdlib: malloc, free; static extern(C) void myFree(void* data, void* hint) nothrow { free(data); } auto msg = Frame(256); assert (msg.size == 256); auto buf = (cast(ubyte*) malloc(10))[0 .. 10]; msg.rebuild(buf, &myFree); assert(msg.size == buf.length); assert(msg.data.ptr == buf.ptr);
Reinitializes the Frame object from a supplied buffer.
This function will first call $(FREF Frame.close) to release the resources associated with the message frame, and then it will initialize it anew, exactly as if it were constructed with Frame(data) or Frame(data, free, hint).
Some care must be taken when using these functions. Please read the $(LINK2 #Frame.opCall_data,Frame(ubyte[])) documentation.