[zeromq-dev] Assertion failure in pull.cpp

Pieter Hintjens ph at imatix.com
Sat Aug 21 20:02:12 CEST 2010


Martin,

Please find attached a patch for issue 50.  This does not solve the
issue but at least prints an explanatory message.

-Pieter


diff --git a/src/pull.cpp b/src/pull.cpp
index b2413ee..1d36508 100644
--- a/src/pull.cpp
+++ b/src/pull.cpp
@@ -36,6 +36,8 @@ zmq::pull_t::~pull_t ()
 void zmq::pull_t::xattach_pipes (class reader_t *inpipe_,
     class writer_t *outpipe_, const blob_t &peer_identity_)
 {
+    if (!inpipe_ || outpipe_)
+        printf ("E: you connected PULL to PULL, please fix your code\n");
     zmq_assert (inpipe_ && !outpipe_);
     fq.attach (inpipe_);
 }
diff --git a/src/sub.cpp b/src/sub.cpp
index eeb50cd..5d0625d 100644
--- a/src/sub.cpp
+++ b/src/sub.cpp
@@ -42,6 +42,8 @@ zmq::sub_t::~sub_t ()
 void zmq::sub_t::xattach_pipes (class reader_t *inpipe_,
     class writer_t *outpipe_, const blob_t &peer_identity_)
 {
+     if (!inpipe_ || outpipe_)
+        printf ("E: you connected SUB to SUB, please fix your code\n");
     zmq_assert (inpipe_ && !outpipe_);
     fq.attach (inpipe_);
 }



More information about the zeromq-dev mailing list