Skip to content

codexboy/kcp-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kcp-go

GoDoc Build Status Go Report Card Coverage Statusd

A port of KCP in golang

Features

  1. 100% compatible with original skywind3000's C version.
  2. Pure golang implementation of KCP in a single file kcp.go.
  3. Instead of container.List, kcp-go made use of cache friendly slice based internal queue.
  4. Provides a basic session manager, compatible with net.Conn and net.Listener.
  5. Indepedent KCP code and session manager code, you can copy kcp.go to your project without session manager.
  6. Support FEC(Forward Error Correction)
  7. Support packet level encryption with AES

Conventions

  1. UDP for packet delivery.
  2. conv uint32 in session manager is a random number initiated by client.
  3. KCP doesn't define control messages like SYN/ACK/FIN/RST in TCP, a real world example is to use some multiplexing protocol over session, such as yamux

Performance

  型号名称:	MacBook Pro
  型号标识符:	MacBookPro12,1
  处理器名称:	Intel Core i5
  处理器速度:	2.7 GHz
  处理器数目:	1
  核总数:	2
  L2 缓存(每个核):	256 KB
  L3 缓存:	3 MB
  内存:	8 GB
$ go test -run TestSpeed
new client 127.0.0.1:61165
total recv: 16777216
time for 16MB rtt with encryption 815.842872ms
PASS
ok  	github.com/xtaci/kcp-go	0.831s

About

KCP - A Fast and Reliable ARQ Protocol

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%