0

Here is a simplifed example.

I have a c program that runs as a daemon on an embedded linux system. For example we will say the program is a calculator that just does addition.

When someone starts the program, I would like a web server to be launched on the system that allows people to remotely use the calculator. The webserver will just serve a simple html page with 1 button "solve" and two input boxes. When someone clicks solve the numbers in the text box need to be sent to the c program, and then the solution needs to be sent back to the web server and displayed on the website.

I hope this isn't overly broad, but I'm just looking for what technologies would be used to accomplish this and a brief overview of how they interact, and hopefully I can take it from there and start digging in.

Brandon Yates
  • 2,022
  • 3
  • 22
  • 33

2 Answers2

1

You don't need to start an external web server. Since your app is a deamon, you could use some HTTP server library inside your application -i.e. have an embedded HTTP server thru that library, e.g. D.Moreno's libonion, GNU libmicrohttpd, EHS, Mongoose etc..

If you already have an external web server, you could configure it to proxy your internal application web service, or make your application a FastCgi (or maybe SCGI) server.

PS. You need to be familiar with HTML5, HTTP, POST request of HTTP, ...

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
0

As the interaction is taken place between processes, I think you need interprocess communication mechanism here. However, you may not allowed to change the code of webserver. Here's some thing may help you:

  • Use database (mysql) which you can use sql to insert/fetch data both sides.
  • If you use Php or someother script language, try Sockets
Community
  • 1
  • 1
wilsonwen
  • 137
  • 11