REQ sockets drop replies from unasked peers.

* Add lb_t::sendpipe() that returns the pipe that was used for sending,
  similar to fq_t::recvpipe().
* Add forwarder functions to dealer_t to access these two.
* Add logic to req_t to ignore replies on pipes that are not the one
  where the request was sent.
* Enable test in test_spec_req.
This commit is contained in:
Christian Kamm
2013-07-02 20:05:20 +02:00
parent 524bd7ac76
commit c56d797bf9
8 changed files with 78 additions and 9 deletions

View File

@@ -80,12 +80,12 @@ int zmq::dealer_t::xsetsockopt (int option_, const void *optval_,
int zmq::dealer_t::xsend (msg_t *msg_)
{
return lb.send (msg_);
return sendpipe (msg_, NULL);
}
int zmq::dealer_t::xrecv (msg_t *msg_)
{
return fq.recv (msg_);
return recvpipe (msg_, NULL);
}
bool zmq::dealer_t::xhas_in ()
@@ -113,3 +113,13 @@ void zmq::dealer_t::xpipe_terminated (pipe_t *pipe_)
fq.pipe_terminated (pipe_);
lb.pipe_terminated (pipe_);
}
int zmq::dealer_t::sendpipe (msg_t *msg_, pipe_t **pipe_)
{
return lb.sendpipe (msg_, pipe_);
}
int zmq::dealer_t::recvpipe (msg_t *msg_, pipe_t **pipe_)
{
return fq.recvpipe (msg_, pipe_);
}