summaryrefslogtreecommitdiff
path: root/src/zmq_init.hpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-04-04 17:53:49 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-04-04 17:53:49 +0200
commit4b52cf949fa02274ec8817f8e704eaa7cc66adbf (patch)
tree4fcdf26a2dcc0551f458975c453fabfd96416cc1 /src/zmq_init.hpp
parent8203c4dbb2e727ce608590e41c9e0d990c015b3e (diff)
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>
Diffstat (limited to 'src/zmq_init.hpp')
-rw-r--r--src/zmq_init.hpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/zmq_init.hpp b/src/zmq_init.hpp
index d90915a..92ab05b 100644
--- a/src/zmq_init.hpp
+++ b/src/zmq_init.hpp
@@ -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;