Giter VIP home page Giter VIP logo

kcp-go's Introduction

kcp-go

[![GoDoc][1]][2] [![Build Status][3]][4] [1]: https://godoc.org/github.com/xtaci/kcp-go?status.svg [2]: https://godoc.org/github.com/xtaci/kcp-go [3]: https://travis-ci.org/xtaci/kcp-go.svg?branch=master [4]: https://travis-ci.org/xtaci/kcp-go A port of KCP by skywind3000 in golang

Status -- 版本状态

1.0 Stable

Features -- 特性

  1. 100% compatible with original C version. -- 100%兼容ikcp.c,紧跟上游
  2. Pure golang implementation of KCP in a single file kcp.go. -- 纯golang单文件实现,能与上游保持完全兼容,也易于提出来独立使用
  3. Instead of container.List, kcp-go made use of slice based internal queue. -- slice优化的传输队列
  4. Provides a basic session manager, compatible with net.Conn and net.Listener. -- 接口兼容net.Conn/net.Listener
  5. Seperated KCP code and session manager code, you can use kcp.go only without session manager. -- 独立的会话管理,不影响kcp核心

Conventions -- 实现约定

  1. use UDP for packet delivery. -- 使用UDP传输数据
  2. conv uint32 in session manager is a random number initiated by client. -- conv由客户端产生随机数,用于区分会话
  3. conn.Write never blocks in KCP, so conn.SetWriteDeadline has no use. -- 写无阻塞
  4. KCP doesn't define control messages like SYN/FIN/RST in TCP, a real world example is to use TCP & KCP at the same time, of which TCP does session control(eg. UDP disconnecting.), and UDP does message delivery. -- KCP本身不提供链路控制,需要结合TCP实现链路开合控制

Performance -- 性能

$ go test -run TestSpeed
new client 127.0.0.1:57296
total recv: 1048576
time for 1MB rtt 52.313861ms
PASS
ok  	_/Users/xtaci/kcp-go	0.063s

Related Applications -- 相关应用

  1. kcptun -- TCP流转换为KCP+UDP流

Contribution -- 关于贡献

PR is welcome if the code is short and clean. -- 欢迎简洁的PR

kcp-go's People

Contributors

xtaci avatar gyf19 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.