Added ZMQ_STREAM socket type

- designed for TCP clients and servers
- added HTTP client / server example in tests/test_stream.cpp
- same as ZMQ_ROUTER + ZMQ_ROUTER_RAW + ZMQ_ROUTER_MANDATORY
- includes b893ce set ZMQ_IDENTITY on outgoing connect
- deprecates ZMQ_ROUTER_RAW
This commit is contained in:
Pieter Hintjens
2013-06-27 20:47:34 +02:00
parent 4a4d222ec4
commit ad77937956
16 changed files with 763 additions and 11 deletions

View File

@@ -33,7 +33,8 @@ zmq::router_t::router_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
more_out (false),
next_peer_id (generate_random ()),
mandatory (false),
raw_sock (false),
// raw_sock functionality in ROUTER is deprecated
raw_sock (false),
probe_router (false)
{
options.type = ZMQ_ROUTER;
@@ -272,7 +273,6 @@ int zmq::router_t::xrecv (msg_t *msg_)
// It's possible that we receive peer's identity. That happens
// after reconnection. The current implementation assumes that
// the peer always uses the same identity.
// TODO: handle the situation when the peer changes its identity.
while (rc == 0 && msg_->is_identity ())
rc = fq.recvpipe (msg_, &pipe);
@@ -372,9 +372,6 @@ bool zmq::router_t::identify_peer (pipe_t *pipe_)
buf [0] = 0;
put_uint32 (buf + 1, next_peer_id++);
identity = blob_t (buf, sizeof buf);
unsigned int i = 0; // Store identity to allow use of raw socket as client
for (blob_t::iterator it = identity.begin(); it != identity.end(); it++) options.identity[i++] = *it;
options.identity_size = i;
}
else {
msg.init ();