0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-15 02:07:59 +08:00

Merge pull request #24 from hintjens/master

Fix for #1384
This commit is contained in:
Pieter Hintjens 2015-05-01 08:45:46 +02:00
commit 752338ec87
4 changed files with 19 additions and 0 deletions

2
NEWS
View File

@ -15,6 +15,8 @@
* Fixed #1377, #1144 - failed with WSANOTINITIALISED in some cases.
* Fixed #1389 - PUB, PUSH sockets had slow memory leak.
0MQ version 4.1.0 rc1, released on 2014/10/14
=============================================

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 ();

View File

@ -36,6 +36,9 @@ void zmq::push_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
{
// subscribe_to_all_ is unused
(void)subscribe_to_all_;
// Don't delay pipe termination as there is no one
// to receive the delimiter.
pipe_->set_nodelay ();
zmq_assert (pipe_);
lb.attach (pipe_);