Git Product home page Git Product logo

qtkcp's Introduction

QtKcp

QtKcp 是基于 Qt 的 Kcp 包装库,底层使用 UDP 传输。

它简化了 Kcp 的使用。

Kcp 地址:https://github.com/skywind3000/kcp


如何使用

Server 端:

	QKcpServer server;
	server.listen(QHostAddress::Any, 12345);

Client 端:

	QKcpSocket client;
	client->connectToHost(QHostAddress("127.0.0.1"), 12345);

其行为和接口基本与 QTcpServer / QTcpSocket 一致。

当然还远不够完善,将会根据需要添加。


注意

为了完成 UDP -> 类 TCP 的转变,实现会稍微有点奇怪:连接的端口会在连接成功时改变。

这是因为主机 (Server) 只负责监听连接,真正的连接将使用新的端口进行。


许可证

使用 MIT LICENSE


开发环境

Windows 11,Qt 5.15.2

qtkcp's People

Contributors

mengps avatar

Stargazers

 avatar  avatar Maru Wu avatar  avatar

Watchers

 avatar

Forkers

jimsdog asdlei99

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.