File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,11 @@ CZMQ_EXPORT const char *
163163CZMQ_EXPORT int
164164 zsock_send (zsock_t * self , zmsg_t * * msg_p );
165165
166+ // Send data over a socket as a single message frame.
167+ // Returns -1 on error, 0 on success
168+ CZMQ_EXPORT int
169+ zsock_sendmem (zsock_t * self , const void * data , size_t size );
170+
166171// Receive a zmsg message from the socket. Returns NULL if the process was
167172// interrupted before the message could be received, or if a receive timeout
168173// expired.
Original file line number Diff line number Diff line change @@ -468,6 +468,21 @@ zsock_send (zsock_t *self, zmsg_t **msg_p)
468468}
469469
470470
471+ // --------------------------------------------------------------------------
472+ // Send data over a socket as a single message frame.
473+ // Returns -1 on error, 0 on success
474+
475+ int
476+ zsock_sendmem (zsock_t * self , const void * data , size_t size )
477+ {
478+ assert (self );
479+ assert (data );
480+ zmsg_t * msg = zmsg_new ();
481+ zmsg_addmem (msg , data , size );
482+ return zmsg_send (& msg , self );
483+ }
484+
485+
471486// --------------------------------------------------------------------------
472487// Receive a zmsg message from the socket. Returns NULL if the process was
473488// interrupted before the message could be received, or if a receive timeout
You can’t perform that action at this time.
0 commit comments