GithubHelp home page GithubHelp logo

tempbottle / qasiosocket Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dushibaiyu/qasiosocket

0.0 1.0 0.0 1004 KB

把asio的socket操作封装成类似Qt Network类似的简单的api。

License: Apache License 2.0

QMake 0.19% C++ 98.19% Makefile 1.61%

qasiosocket's Introduction

QAsioTcpSocket

把asio的socket操作封装成类似Qt Network类似的简单的api。


###优点,目的: API 使用简单优雅。封装完全隐藏asio实现的细节。 不依赖Boost。可以直接包含代码使用,也可以编译成动态库。

###比较Qt的socket : 效率高:充分利用平台特性,win(iocp),linux(epoll)。而Qt的socekt都是select。 并发高:个人不准确测试,当QTcpServer接受900+连接后就不能在接受新的连接了。而QAsioTcpServer几千个很轻松。


###使用方法: 1.Build: 直接用Qt-Creator 打开项目(QAsioSocket.pro),然后打开src.pro文件. 然后编译,生成的动态库在lib文件夹下,头文件就是include文件夹下的。 2.直接使用源码: 把代码复制到您的项目目录下去。 在pro文件中包含include(QAsioSocket/QAsioSocket.pri), 添加宏定义 DEFINES += QASIOSOCKET_NOLIB 到您的pro文件。


###环境依赖 依赖库:Qt 5.x(Just Use Core Module), asio(Non Boost.已经在源码里包含了) windows: vs2013 + , mingw 4.9 + linux : gcc 4.8 +


###启用SSL: SSL连接只实现了服务端,可以做ssl socket的服务器,但是没有客户端接口去连接远程SSL 服务器。 启用SSL 的库编译: 在src.pro工程文件里添加:DEFINES += QASIO_SSL (取消哪行注视也行) 添加openssl的库引用。 直接使用源码的话,请在您的工程文件(pro)文件里加上宏QASIO_SSL。并添加openssl的库引用。

qasiosocket's People

Contributors

dushibaiyu avatar

Watchers

 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.