Add metadata to received messages

This commit is contained in:
Martin Hurton
2014-04-30 14:17:38 +02:00
parent 62bb403eea
commit b9c2748146
12 changed files with 145 additions and 8 deletions

View File

@@ -23,6 +23,7 @@
#include "stdint.hpp"
#include "options.hpp"
#include "blob.hpp"
#include "metadata.hpp"
namespace zmq
{
@@ -64,6 +65,8 @@ namespace zmq
blob_t get_user_id () const;
metadata_t *get_metadata () { return metadata; }
protected:
// Only used to identify the socket for the Socket-Type
@@ -77,7 +80,8 @@ namespace zmq
// Metadata consists of a list of properties consisting of
// name and value as size-specified strings.
// Returns 0 on success and -1 on error, in which case errno is set.
int parse_metadata (const unsigned char *ptr_, size_t length);
int parse_metadata (
const unsigned char *ptr_, size_t length, bool zap_flag = false);
// This is called by parse_property method whenever it
// parses a new property. The function should return 0
@@ -89,6 +93,10 @@ namespace zmq
virtual int property (const std::string& name_,
const void *value_, size_t length_);
// Metadada as returned by ZAP protocol.
// NULL if no metadata received.
metadata_t *metadata;
options_t options;
private: