Giter VIP home page Giter VIP logo

khala's Introduction

# khala
  Khala(卡拉)是用C++实现的TCP网络框架。底层采用muduo网络库作为网络IO+线程模型,并封装实现了网络实现与业务逻辑分离的多线程网络框架,具有超时退出、多设备多事件注册支持、设备生命周期管理、设备间通信等功能。
  
相关介绍请关注:
http://www.cnblogs.com/moyangvip/p/5049673.html

邮箱:
[email protected]


一、安装:

1、从github库下载源码https://github.com/moyangvip/khala

2、Khala采用CMake为build system,安装方法:
 $sudo apt-get install cmake

3、Khala依赖于Boost,Boost安装方式:
 $ sudo apt-get install libboost-dev libboost-test-dev

4、Khala同时依赖于muduo(https://github.com/chenshuo/muduo)
和json(jsoncpp-src-0.5.0),在khala/Khala/libs/目录中已经包含其静态库。

5、编译安装方法:
在Khala根目录输入:
 $ ./build.sh
  此时将以默认的Debug模式("-O0")编译khala库和它自带的例子,生成的静态库文件(libKhala.a)位于./build/Debug/libs/目录,生成的例子的可执行文件位于./build/Debug/bin/目录。

如果要编译release版,则可以输入:
  $ BUILD_TYPE=release ./build.sh
  此时将以Release模式("-O2 -finline-limit=1000 -DNDEBUG") 编译khala库和它自带的例子,生成的静态库文件(libKhala.a)位于./build/release/libs/目录,生成的例子的可执行文件位于./build/release/bin/目录。

如果只想编译khala库,而不编译例子,则输入:
  $ BUILD_NO_EXAMPLES=1 ./build.sh
  此时将只编译khala库,生成的静态库文件(libKhala.a)位于./build/Debug/lib/目录。


二、目录结构:

1、Khala的目录结构如下:

khala
|-- License
|-- README
|-- build.sh (安装脚本)
|
|-- Khala (khala框架的主体)
| |-- include (编译khala依赖的头文件:khala本身头文件和muduo、json的头文件)
| |-- src (代码实现)
| |-- libs (依赖的静态库muduo和json)
|
|-- examples 
| |-- HelloKhala (khala的示例)
| | |-- src (示例代码)
| |
| |-- testClient (客户端测试示例)


2、通过./build.sh编译安装后,生成的build目录结构如下:

build
|-- {Debug or Release }
| | -- bin (生成的可执行文件)
| | -- libs (生成的Khala静态库,以及muduo和json的静态库)
| | -- include (静态库的头文件)


三、使用
  在新建的项目中如果希望使用khala库,只需要执行build.sh编译安装后,导入相应的头文件路径( ./build/{Debug or Release }/include/ ),和库文件路径( ./build/{Debug or Release }/libs/ ),并且链接相应的静态库文件 ( -lKhala -lmduo_net -lmuduo_base -ljson -lphread )即可。

khala's People

Contributors

moyangvip avatar

Watchers

James Cloos avatar  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.