1 Star 0 Fork 2

結城明日奈/brynet

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Brynet

Cross platform high performance TCP network library using C++ 11.

Windows : Build status Linux : Build Status

Features

  • Cross platform (Linux | Windows)
  • High performance and safety use.
  • None depend
  • Multi-threaded
  • SSL support
  • Support HTTP、HTTPS、WebSocket
  • IPv6 support

Documentation

Compatibility

  • Visual C++ 2013+ on Windows (32/64-bit)
  • GCC 4.8+ on Linux (32/64-bit)
  • Not Support Mac OS X

Build

  1. cmake .
  2. If you use Windows, please open brynet.sln then build. If on Linux, only enter make.

Usages

Benchamrk

Under localhost, use CentOS 6.5 virtual mahcine(host machine is Win10 i5)

  • PingPong

    Benchamrk's server and client both only use one thread, and packet size is 4k

    PingPong

  • Broadcast

    Server use two network threads and one logic thread, client use one network(also process logic) thread. every packet size is 46 bytes. every packet contain client's id. server broadcast packet to all client when recv one packet from any client. client send one packet when recv packet from server and packet's id equal self.

    Broadcast

  • Ab HTTP(1 network thread) Document Path: / Document Length: 18 bytes

      Concurrency Level:      100
      Time taken for tests:   5.871 seconds
      Complete requests:      100000
      Failed requests:        0
      Write errors:           0
      Non-2xx responses:      100000
      Total transferred:      5200000 bytes
      HTML transferred:       1800000 bytes
      Requests per second:    17031.62 [#/sec] (mean)
      Time per request:       5.871 [ms] (mean)
      Time per request:       0.059 [ms] (mean, across all concurrent requests)
      Transfer rate:          864.89 [Kbytes/sec] received
    
      Connection Times (ms)
                  min  mean[+/-sd] median   max
      Connect:        0    2   0.7      2       8
      Processing:     1    3   0.7      3       9
      Waiting:        0    3   0.8      3       8
      Total:          2    6   0.8      6      11
    
      Percentage of the requests served within a certain time (ms)
      50%      6
      66%      6
      75%      6
      80%      6
      90%      7
      95%      7
      98%      7
      99%      8
      100%     11 (longest request)

About session safety

This library use three layer ident one session(also is three way to use this library).

I suggest you use the second or thrid way above, because don't worry memory manager

Examples

Users

MIT License Copyright (c) 2017 IronsDu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

C++跨平台socket框架,支持ipv6 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gesneriana/brynet.git
git@gitee.com:gesneriana/brynet.git
gesneriana
brynet
brynet
master

搜索帮助

Cb406eda 1850385 E526c682 1850385