42 identity_sent (false),
44 terminate_current_in (false),
79 int rc = probe_msg_.
init ();
82 rc = pipe_->
write (&probe_msg_);
86 rc = probe_msg_.
close ();
100 bool is_int = (optvallen_ ==
sizeof (
int));
102 if (is_int) memcpy(&value, optval_,
sizeof (
int));
106 if (optval_ && optvallen_) {
113 if (is_int && value >= 0) {
124 if (is_int && value >= 0) {
131 if (is_int && value >= 0) {
138 if (is_int && value >= 0) {
183 outpipes_t::iterator it;
185 if (it->second.pipe == pipe_)
190 it->second.active =
true;
211 outpipes_t::iterator it =
outpipes.find (identity);
216 it->second.
active =
false;
233 int rc = msg_->
close ();
255 int rc = msg_->
close ();
266 int rc = msg_->
close ();
277 int rc = msg_->
close ();
282 int rc = msg_->
init ();
351 memcpy (msg_->
data (), identity.data (), identity.size ());
435 outpipes_t::iterator it =
outpipes.find (identity);
441 unsigned char buf [5];
444 identity =
blob_t (buf,
sizeof buf);
450 ok = pipe_->
read (&msg);
454 if (msg.
size () == 0) {
456 unsigned char buf [5];
459 identity =
blob_t (buf,
sizeof buf);
464 outpipes_t::iterator it =
outpipes.find (identity);
475 unsigned char buf [5];
480 it->second.pipe->set_identity (new_identity);
484 ok =
outpipes.insert (outpipes_t::value_type (
485 new_identity, existing_outpipe)).second;
504 ok =
outpipes.insert (outpipes_t::value_type (identity, outpipe)).second;
blob_t get_credential() const
#define ZMQ_ROUTER_HANDOVER
bool terminate_current_in
router_t(zmq::ctx_t *parent_, uint32_t tid_, int sid)
int recvpipe(msg_t *msg_, pipe_t **pipe_)
void pipe_terminated(pipe_t *pipe_)
void xpipe_terminated(zmq::pipe_t *pipe_)
void put_uint32(unsigned char *buffer_, uint32_t value)
int xsend(zmq::msg_t *msg_)
#define ZMQ_ROUTER_MANDATORY
int init_size(size_t size_)
void reset_flags(unsigned char flags_)
#define LIBZMQ_UNUSED(object)
int xrecv(zmq::msg_t *msg_)
uint32_t generate_random()
void attach(pipe_t *pipe_)
void xattach_pipe(zmq::pipe_t *pipe_, bool subscribe_to_all_)
std::basic_string< unsigned char > blob_t
void set_flags(unsigned char flags_)
void terminate(bool delay_)
std::set< pipe_t * > anonymous_pipes
void activated(pipe_t *pipe_)
void xwrite_activated(zmq::pipe_t *pipe_)
unsigned char data[max_vsm_size]
void set_identity(const blob_t &identity_)
zmq::pipe_t * current_out
void xread_activated(zmq::pipe_t *pipe_)
int xsetsockopt(int option_, const void *optval_, size_t optvallen_)
blob_t get_credential() const
bool identify_peer(pipe_t *pipe_)
void set_metadata(metadata_t *metadata_)