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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:01:11+00:00 2026-05-17T22:01:11+00:00

I have a daemon (which must be written in C) which should have a

  • 0

I have a daemon (which must be written in C) which should have a remote like common media players do:

mediaplayer-rc --enqueue /path/to/song.mp3

If mediaplayer-daemon isn’t running, it is started by the remote controller. The remote will pass the message.

I took the approach that seemed the most intuitive to me:

  • The client application tries to connect() and starts the daemon if it can’t
  • The client uses argp to parse the params into a struct
  • The client sends the struct through a socket
  • The server receives the struct and interprets this

I’ve got a simple demo implementation using libev and unix sockets on github.

My reasoning is that it seemed easier to write a client in C that I can call from other languages with their version of system() than to try to get another language to pack the struct correctly or to get the C library to parse some other format.

But I don’t think that this is a particularly elegant solution.

Another possibility, would be to use JSON. The downshot being that using a JSON parser in vanilla C would probably be more complex by far than the args parser. The upshot being that JSON (or YAML) is in the standard libraries of just about every other language.

Any suggestions? Anybody know how songbird, gimp, itunes, and other apps with remotes handle this issue?

  • 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-17T22:01:12+00:00Added an answer on May 17, 2026 at 10:01 pm

    I can’t recommend a ready-to-go library – Instead I suggest you look at Music Player Daemon. It uses a very simple text protocol to control the entire application remotely. There are several clients (with code) you can look at too.

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

Sidebar

Related Questions

I have a daemon script written in ruby which responds to commands like daemon
I have a Solaris daemon written in Java6. Clients can connect to it using
I have a daemon app written in C and is currently running with no
I have a daemon thread which wakes up at a specified interval to do
I have a daemon I have written using Python. When it is running, it
We have a daemon server program which forks one child. When the child exits,
I have created a daemon in Ruby which has a counter incrementing inside of
I'm using a daemon-script which is monitoring a remote server. When the remote server
So I have a daemon running on a Linux system, and I want to
I am going to have a daemon that will run on a FreeBSD server,

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.