Linux c app,由web远程调用。 [英] Linux c app, called remotely by web.

查看:71
本文介绍了Linux c app,由web远程调用。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是英语,所以请原谅我的语法/ sintax错误..


我很想找到那个... ... >
i需要一个示例代码或某些东西,可以帮助我创建一个非常简单的应用程序,必须这样做:


运行像守护进程一样的linux服务器并管理变量打印出来

值...例如......


appz代码:

// $ n1(通过浏览器传递var)

if(!$ sum)$ sum = 0;

$ sum = $ sum + $ n1;

打印$ sum;


####################


所以,如果你在浏览器中写道

http://www.site.com:8000/appz.dll?n1=5

你回来了

5 br $>

比互联网上的某人要好
http://www.site.com:8000/appz.dll?n1=2
他回来了7


如果其他人再输入
http://www.site.com:8000/appz.dll?n1=5

他回来了12


(是的,我知道如果我重新启动计算机,计数会从0开始重新启动..

我将保存每个变量1分钟的文件)


等等....

我很想知道这是否可行...不使用apache

哪个非常慢...

程序应该处理数百万个请求/天......通常我会用bache b来使用apache + php +文件(或)mysql来做这个操作......

并且每次点击都需要很多资源....

i认为这个程序存储在一个ramdisk分区可以做的事情真的更快..

如果有人可以帮助我让你真的很开心..

谢谢,

Francesco

i''m not english so excuse me for the grammatical/sintax errors..

i''m relly going crazy looking for that...
i need an example code or something that could help me to create an
very simpe c application that have to do this:

run on a linux server like a daemon and manage variables printing out
the value.. for example...

the appz code:
// $n1 (passed var by browser)
if(!$sum) $sum =0;
$sum = $sum + $n1;
print $sum;

####################

so if you wrote in the browser

http://www.site.com:8000/appz.dll?n1=5
you get back
5

than someone in internet do
http://www.site.com:8000/appz.dll?n1=2
he get back 7

and again if someone else then type
http://www.site.com:8000/appz.dll?n1=5
he get back 12

(yes i know that if i restart computer the count start again from 0..
i''ll save the variable every 1 minutes on a file)

and more....
i''m very interested to know if this is possible... without using apache
wich is very slow...
the program should handle millions of request/day... and usually i
should use apache+php+file(or)mysql to do this operation...
and requires a lot of resources at every hits....
i think that this program stored on a ramdisk partition could do the
things really faster..
if someone could help me you make me really happy..
Thanks,
Francesco

推荐答案

n1(通过浏览器传递var)

if(!
n1 (passed var by browser)
if(!


sum)


sum = 0;
sum =0;


这篇关于Linux c app,由web远程调用。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆