Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6899709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:27:22+00:00 2026-05-27T07:27:22+00:00

I have a simple pub-sub setup on a mid-sized network, using ZMQ 2.1. Although

  • 0

I have a simple pub-sub setup on a mid-sized network, using ZMQ 2.1. Although some subscribers are using C# bindings, others are using Python bindings, and the issue I’m having is the same for either.

If I pull the network cable from a machine running a subscriber, I get an un-catchable error that immediately terminates that subscriber.

Here’s a very simple example of a subscriber in Python (not actual production code, but enough to reproduce the problem):

import zmq

def main(server_address, port):

    context = zmq.Context()
    sub_socket = context.socket(zmq.SUB)
    sub_socket.connect("tcp://" + server_address + ":" + str(port))
    sub_socket.setsockopt(zmq.SUBSCRIBE, "KITH1S2")

    while True:

        msg = sub_socket.recv()      
        print msg  

if __name__ == "__main__": main("company-intranet", 4000)

In C# the program simply terminates silently. In Python I at least get this:

Assertion failed: rc == 0 (….\src\zmq_connector.cpp:48)

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application’s support team for more information.

I’ve tried non-blocking versions, and poller versions, but in either case this instant termination problem persists. Is there something obvious I should be doing but I’m not? (That is, obvious to someone else 🙂 ).

EDIT:

Found the following: https://zeromq.jira.com/browse/LIBZMQ-207

Seems as though it is/was a known issue.

That link further links to Github, where a change log for 2.1.10 has this note:

  • Fixed issue 207, assertion failure in zmq_connecter.cpp:48, when an
    invalid zmq_connect() string was used, or the hostname could not be
    resolved. The zmq_connect() call now returns -1 in both those cases.

Although connect() does indeed throw an Invalid Argument exception in Python (not C# apparently?), recv() still fails. If the subscriber machine suddenly loses the network, that subscriber will simply stop functioning.

So – I’m going to try using IP addresses instead of named addresses to see if this will bypass the issue. Not ideal, but better than insta-crash.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:27:22+00:00Added an answer on May 27, 2026 at 7:27 am

    Original question: Is there something obvious I should be doing but I’m not?

    No.

    The workaround for now is to use IP addressing. This does not cause program failure upon network disconnect for ZMQ 2.1.x.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to set up pub-sub between 1 publisher and multiple subscribers using
I have simple HTML code with some JavaScript. It looks like: <html> <head> <script
I built a simple chat server with Node.js & Redis Pub/Sub, acani-node on GitHub
I'm using NServiceBus in a pub/sub application for event notifications on a web application.
Using the pub/sub sample i managed to get multiple instances of the same console
I have simple regex \.*\ for me its says select everything between and ,
I have simple win service, that executes few tasks periodically. How should I pass
i have simple regular expression: ^123$ Matches are for example 123 1234 etc. How
I have simple issue setting a two-way databinding of a checkbox in Silverlight 3.0.
I have simple form. <form target=_blank action=somescript.php method=Post id=simpleForm> <input type=hidden name=url value=http://...> <input

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.