pub: Don't delay pipe termination

This commit is contained in:
Martin Hurton 2015-04-28 07:44:22 +02:00 committed by Pieter Hintjens
parent 812c2016b1
commit a1d1222dcc
2 changed files with 14 additions and 0 deletions

View File

@ -18,6 +18,8 @@
*/
#include "pub.hpp"
#include "pipe.hpp"
#include "err.hpp"
#include "msg.hpp"
zmq::pub_t::pub_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
@ -30,6 +32,17 @@ zmq::pub_t::~pub_t ()
{
}
void zmq::pub_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
{
zmq_assert (pipe_);
// Don't delay pipe termination as there is no one
// to receive the delimiter.
pipe_->set_nodelay ();
xpub_t::xattach_pipe (pipe_, subscribe_to_all_);
}
int zmq::pub_t::xrecv (class msg_t *)
{
// Messages cannot be received from PUB socket.

View File

@ -38,6 +38,7 @@ namespace zmq
~pub_t ();
// Implementations of virtual functions from socket_base_t.
void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_ = false);
int xrecv (zmq::msg_t *msg_);
bool xhas_in ();