mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-30 13:47:13 +01:00
Support application metadata through ZMQ_METADATA
Lets the application set per-connection metadata. Metadata is specified as "X-key:value" and set using zmq_setsockopt, eg: zmq_setsockopt (s, ZMQ_METADATA, "X-key:value", 11); The peer can then obtain the metadata from a received message: char *data = zmq_msg_gets(msg, "X-key");
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <map>
|
||||
|
||||
#include "atomic_ptr.hpp"
|
||||
#include "stddef.h"
|
||||
@@ -258,6 +259,9 @@ struct options_t
|
||||
|
||||
// Use zero copy strategy for storing message content when decoding.
|
||||
bool zero_copy;
|
||||
|
||||
// Application metadata
|
||||
std::map<std::string, std::string> app_metadata;
|
||||
};
|
||||
|
||||
int do_getsockopt (void *const optval_,
|
||||
|
||||
Reference in New Issue
Block a user