1、 http client
libcurl (C语言写的)、
QT 的QNetworkAccessManager、
QNetworkAccessManager* m_pManager;
QNetworkRequest m_request;
QNetworkReply* m_pReply;
CPP REST SDK是微软开源的基于PPL的异步http Client/Server https://github.com/Microsoft/cpprestsdk
网友总结的demo
http://www.cnblogs.com/qicosmos/p/4098094.html
2、流媒体服务器
SRS(simple rtmp server) 地址 https://github.com/ossrs/srs
EasyDarwin、Live555
3、RPC框架
阿里的Dubbo 地址 https://github.com/alibaba/dubbo
百度的sofa-pbrpc 地址:https://github.com/baidu/sofa-pbrpc
4、sqlite 客户端
smartdb 地址 https://github.com/chxuan/smartdb
easysqlite
5、http server
https://github.com/Corvusoft/restbed
Restbed 框架为 C++11 构建的程序带来了 restful 功能,它基于 boost.asio 创建。
Restbed 可用于需要通过 HTTP 无缝和安全通信构建应用程序的全面和一致的编程模型,能够对一系列业务流程进行建模,旨在针对移动,平板电脑,桌面和嵌入式生产环境。
它类似于将 NGINX 嵌入到您公司自己的产品线中。
linux编译:
git clone --recursive https://github.com/corvusoft/restbed.git
mkdir restbed/build
cd restbed/build
cmake -DBUILD_TESTS=YES -DBUILD_EXAMPLES=YES -DBUILD_SSL=NO -DBUILD_SHARED=YES -DCMAKE_INSTALL_PREFIX=/output-directory ..
make -j 2 install //CPU_CORES+1 cpu核数加一
编译完后 会在/output-directory 生成 所有文件
vs2015 编译
cd restbed
mkdir build
cd build
cmake -G "Visual Studio 14 2015 Win64" -DBUILD_EXAMPLES=YES -DBUILD_SSL=NO -DBUILD_TESTS=YES ..
cmake --build . --target ALL_BUILD --config Release
ctest
这样编译默认是静态库 restbed.lib,编译时间有点长,出去溜会弯吧。
编译他给的例子
Example demo.cpp
#include
#include
#include
using namespace std;
using namespace restbed;
void post_method_handler( const shared_ptr< Session > session )
{
const auto request = session->get_request( );
int content_length = request->get_header( "Content-Length", 0 );
session->fetch( content_length, [ ]( const shared_ptr< Session > session, const Bytes & body )
{
fprintf( stdout, "%.*s\n", ( int ) body.size( ), body.data( ) );
session->close( OK, "Hello, World!", { { "Content-Length", "13" } } );
} );
}
int main( const int, const char** )
{
auto resource = make_shared< Resource >( );
resource->set_path( "/resource" );
resource->set_method_handler( "POST", post_method_handler );
auto settings = make_shared< Settings >( );
settings->set_port( 1984 );
settings->set_default_header( "Connection", "close" );
Service service;
service.publish( resource );
service.start( settings );
return EXIT_SUCCESS;
}
g++ -std=c++11 demo.cpp -o demo -lrestbed -I/output-directory/include -L/output-directory/library
测试
curl -d "param1=value1¶m2=value2" "http://192.168.6.185:1984/resource"
curl -d 表示 post 请求
6、http server windows端 https://github.com/ellzey/libevhtp/
7、 http server ehttp
https://github.com/hongliuliao/ehttp
安卓直播客户端 ,来疯
https://github.com/LaiFeng-Android/SopCastComponent
介绍:http://www.jianshu.com/p/7ebbcc0c5df7
c++ 线程池
https://github.com/search?utf8=%E2%9C%93&q=c%2B%2B+threadpool
https://github.com/lizhenghn123/zl_threadpool
游戏服务器开源程序 ,官网地址
http://kbengine.org/
github地址
https://github.com/kbengine/kbengine