TCP and IPC connection initiation allow for multiple properties

So far the only property passed on connection initiation was
identity. The mechanism was now made extensible. Additional
properties are needed to introduce functionality such as
checking the peer's socket type, "subports" etc.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
Martin Sustrik
2011-04-04 17:53:49 +02:00
parent 8203c4dbb2
commit 4b52cf949f
2 changed files with 87 additions and 29 deletions

View File

@@ -21,12 +21,15 @@
#ifndef __ZMQ_ZMQ_INIT_HPP_INCLUDED__
#define __ZMQ_ZMQ_INIT_HPP_INCLUDED__
#include <vector>
#include "../include/zmq.h"
#include "i_inout.hpp"
#include "i_engine.hpp"
#include "own.hpp"
#include "fd.hpp"
#include "stdint.hpp"
#include "stdint.hpp"
#include "blob.hpp"
namespace zmq
@@ -44,6 +47,13 @@ namespace zmq
private:
// Peer property IDs.
enum prop_t
{
prop_type = 1,
prop_identity = 2
};
void finalise_initialisation ();
void dispatch_engine ();
@@ -63,8 +73,10 @@ namespace zmq
// Detached transient engine.
i_engine *ephemeral_engine;
// True if our own identity was already sent to the peer.
bool sent;
// List of messages to send to the peer during the connection
// initiation phase.
typedef std::vector < ::zmq_msg_t> to_send_t;
to_send_t to_send;
// True if peer's identity was already received.
bool received;