Giter Club home page Giter Club logo

librtcbase's Introduction

librtcbase

一个c/c++基础类库,主要从Google开源的WebRTC(音视频实时通信解决方案)项目移植过来, 做了一定的精简、修改,并扩充了一些实用功能,使其更符合Linux下服务端开发的需要。该库比较小巧,特别适合服务端网络服务开发。

要求

  • 目前仅适用于Linux平台
  • gcc版本建议使用gcc-4.8.4及其更高版本, 该库使用了大量的c++11语法,gcc版本过低将无法编译通过
  • 依赖libev-4.22或者以上版本
  • openssl版本不低于1.0.0

主要功能

  • 常用的字符串处理, 比如字符串分割、字符串和数字类型之间的转换等等
  • 常用的一些算法实现,比如crc32, md5, sha1, base64等等
  • sigslot机制的实现,支持多线程并且是线程安全的
  • 实用的锁功能实现
  • 丰富的时间处理函数
  • 实用的随机数、随机字符串生成功能
  • openssl功能封装,如证书、摘要、指纹生成,dtls处理过程
  • 实用网络函数封装,如获取本地网络接口、字节序处理、ip地址处理等等
  • 异步网络通信、线程函数封装
  • log库的实现
  • 引用计数的实现
  • 缓冲队列实现
  • 原子操作实现
  • ... ...

编译和安装方法

编译工具

本库的编译采用了buildmake工具,可以帮助你生成Makefile文件,buildmake是一个使用非常简单的编译环境构建工具,推荐使用。 buildmake使用教程:https://github.com/str2num/buildmake

编译libev-4.22及其以上版本

如果你的系统是Ubuntu 16.04.4 LTS或者类似版本,你可以跳过该步骤,该项目已经提供Ubuntu 16.04.4 LTS平台下编译好的libev库,位于项目的deps目录下。 如果你不是以上系统,你可能需要下载安装libev-4.22, github地址:https://github.com/enki/libev libev库安装成功之后,请按照要求将libev库的include和lib目录放置到项目的deps目录下。

编译选项

你可以根据自己的实际需要修改编译选项以及依赖的库文件,比如-g, -O2等等,BUILDMAKE文件的修改方法,请参考buildmake工具使用教程。

编译

# 项目根目录执行
buildmake

# 上述命令执行完毕之后,会生成Makefile文件,然后执行make命令
make

# make完毕之后,会在项目根目录生成一个output目录,里面包含了librtcbase的库文件

说明

  • 该库在Ubuntu 16.04.4 LTS、Ubuntu 14.04、CentOS release 6.5等平台编译通过,并正常使用。
  • gcc-4.8.4, gcc-5.4.0已验证编译通过。
  • 该库移植于Google的WebRtc项目,功能已经过了严格的单元测试, 所以该项目没有提供单元测试用例。
  • 后续会持续跟进WebRtc项目的最新进展,同时该库也会相应的持续维护和更新。

API文档

该库的API文档,正在积极建设当中,敬请期待, 谢谢!

librtcbase's People

Contributors

str2num avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.