10行C代码实现高性能HTTP服务

德国强力白蚀消能不能治好白癜风 https://m.39.net/disease/a_9338478.html

实战(干货)

话不多说,我们来一起看看,10行C++代码怎么实现一个高性能的Http服务,轻松QPS几十万。Linus说:talkischeap,showmethecode↓

intmain(){WFHttpServerserver([](WFHttpTask*task){task-gt;get_resp()-gt;append_output_body(HelloWorld!);});if(server.start()==0){getchar();//pressEntertoend.server.stop();}return0;}

这个server使用了workflow,安装编译都非常简单,以Linux为例,把代码拉下来后,一行命令即搞定编译:

gitclone


转载请注明:http://www.aierlanlan.com/grrz/7356.html