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 8424225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:55:50+00:00 2026-06-10T03:55:50+00:00

I’m writing a program in C++ that will run all the time in the

  • 0

I’m writing a program in C++ that will run all the time in the background to do different tasks – a deamon.
Apart from it’s usual tasks a web application should communicate with it (AJAX requests in doing a COMET pattern = lots of open but sleeping connections).

So the question is: how should I connect it to the web server (apache and lighttpd are relevant)?

Of what I’ve read FastCGI would be very interesting for that task, but all references I’ve read were talking about the web server starting the FastCGI application when necessary. This wouldn’t work here as the deamon would already be running…

I’ve also read that the web server would talk via socets with the FastCGI application – so that could be an entry point for me, the deamon would “only” need to talk to such a socket.

But are there good libraries available for that?
Looking at the features of http://cppcms.com/wikipp/en/page/main it looks very interesting for me – but could that work in my case? And could it be stripped down – offering even a SQL connection is far too heavy for my case…

So what advice can you give me?

PS: Performance wise I recon a single threaded but asynchronous implementation would work for the deamon <-> web server glue.

  • 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-06-10T03:55:52+00:00Added an answer on June 10, 2026 at 3:55 am

    FastCGI is the standard protocol to communicate with the web server. All mentioned web servers can communicate with the remote deamon application via fastcgi.

    http://cppcms.com/wikipp/en/page/cppcms_1x_tut_web_server_config

    Also if you are looking for Comet support, that what CppCMS provides you natively:

    http://blog.cppcms.com/post/107

    And could it be stripped down – offering even a SQL connection is far too heavy for my case…

    CppCMS library is very small also it allows to reduce its size:

    http://cppcms.com/wikipp/en/page/cppcms_1x_build#Build.Options

    also SQL connectivity CppDB is independent part.

    Performance wise I recon a single threaded but asynchronous implementation would work for the deamon <-> web server glue.

    It is one of the standard CppCMS run mode – running asynchronous web applications.

    Update:

    Of what I’ve read FastCGI would be very interesting for that task, but all references I’ve read were talking about the web server starting the FastCGI application when necessary. This wouldn’t work here as the deamon would already be running..

    Indeed some web servers start the fast cgi applications but:

    • Lighttpd allows both to start FastCGI and SCGI application or connect to independent one
    • Cherokee (AFAIR) allows both to start FastCGI and SCGI application or connect to independent one
    • Apache:

      • mod_fascgi allows both to start FastCGI application or connect to independent one
      • mod_scgi connects to independent application – does not start application.
      • mod_fcgid always starts application – does not suite you

      Also as general note, apache does not suit a pattern of working with many idle connections as it uses thread (or even process depending mpm) per connection.

    • Nginx – does not start applications at all, however for fastcgi currently not the best for comet streaming because of buffering, so SCGI would be better with nginx (assuming you are using latest nginx version)

    Small note: SCGI is a protocol that is very similar to FastCGI but significantly simpler.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a

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.