C++ http 流媒体等 开源项目记录

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 <cstdlib>
#include <restbed>
 #include <memory>
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&param2=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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

致一

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值