File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,14 @@ namespace zmq
227
227
}
228
228
}
229
229
230
+ inline message_t (const void *data_, size_t size_)
231
+ {
232
+ int rc = zmq_msg_init_size (&msg, size_);
233
+ if (rc != 0 )
234
+ throw error_t ();
235
+ memcpy (data (), data_, size_);
236
+ }
237
+
230
238
inline message_t (void *data_, size_t size_, free_fn *ffn_,
231
239
void *hint_ = NULL )
232
240
{
@@ -276,6 +284,17 @@ namespace zmq
276
284
throw error_t ();
277
285
}
278
286
287
+ inline void rebuild (const void *data_, size_t size_)
288
+ {
289
+ int rc = zmq_msg_close (&msg);
290
+ if (rc != 0 )
291
+ throw error_t ();
292
+ rc = zmq_msg_init_size (&msg, size_);
293
+ if (rc != 0 )
294
+ throw error_t ();
295
+ memcpy (data (), data_, size_);
296
+ }
297
+
279
298
inline void rebuild (void *data_, size_t size_, free_fn *ffn_,
280
299
void *hint_ = NULL )
281
300
{
You can’t perform that action at this time.
0 commit comments