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

  • Home
  • SEARCH
  • 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 6154019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:11:25+00:00 2026-05-23T20:11:25+00:00

I wanted to add a ZeroMQ socket to a glib program. The pitty is,

  • 0

I wanted to add a ZeroMQ socket to a glib program.

The pitty is, a zmq socket is not poll()-able, and they give their implementation, which overloads the old poll() func. How could I integrate that into the main loop efficiently? I tried using their poll ( zmq_poll() ) instead of the default one, but there’s no good way of giving it the zmq socket, besides from making it a global.

Defining a new GSource works, but it can get high CPU usage ( by setting timeout = 0 ) or arbitrary poll timeouts ( e.g. setting timeout = 100 to be polled at least every 100 ms ), which is not really efficient, since there is the possibility of polling.

  • 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-23T20:11:26+00:00Added an answer on May 23, 2026 at 8:11 pm

    I found that newer zmq libraries support the ZMQ_FD getsockopt() parameter, which gives you back a unix fd which you can poll(). The only caveat is that you can’t just poll() it to know if you can recv() or send() from / to it, but you need to use the ZMQ_EVENTS getsockopt() parameter to get back the real fd status.

    It seems to be working quite well in glib.

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

Sidebar

Related Questions

I'm working on a program that renders iterated fractal systems. I wanted to add
How it started? I wanted to add two columns, that are not in business
Hi I wanted to add datum from a table. However, it does not show
I am writing a wrapper around Zend's lucene implementation and wanted to add a
I wanted to add a new table in my database, and not change the
I wanted to add a function to my Slim application but I'm not familiar
I have an existing winform app which didn't use Program.cs. I wanted to add
I wanted to add a new property to one of my model (table). Basically
I wanted to add a StackOverflow-style tag input to a blog model of mine.
Yesterday I wanted to add a boolean field to an Oracle table. However, there

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.