I do not understand: the exchange of data between C programs.

Hello all. I can not understand, I'm sorry.
For example: If the web-server runs my program writed in C language (using CGI).
There written by:

Code:
...
 printf("Content-type: text/html\n\n\n");
 printf("Hello world!");
...

And the word "Hello world!" flies to the client that requested this CGI-script.
But I did draw the conclusion in the "stdin"!

As a web-server run my program, and intercepted a conclusion "stdin"?

I know how to exchange data between applications:
1. sockets. (But I did not create socket).
2. pipe (may, but is it my server runs the application as a way myProgram | webServer) It's hard!.

In a nutshell, you can explain?
I read about the CGI, FastCGI-much has been written, and then confused!

P.S. I want to create a small web-server which will run my program (written in C for example) and give result to the user.

Where dig it?

...
* I do not want to create a second Apache or lighttpd .. I just want to understand - how is it? x(
Forgive me if something is wrong.
 
CGI data coming to script with STDIN + ENV, server waits answer to STDOUT, STDERR will be written in errorlog. Some calls like popen can handle this.
 
Alt said:
CGI data coming to script with STDIN + ENV, server waits answer to STDOUT, STDERR will be written in errorlog. Some calls like popen can handle this.

graudeejs said:
Your server will execute your app and read it's output via pipe

O, thank you. So "pipe" it is correct choose. popen is the thing, thanks.
"Now I know where to dig a tunnel!"
 
Back
Top