Chisle
The coding-agent plugin that bills 52% of a bare model across 20 live tasks. Terse persona + tool-output compressor + context diet.
翻訳待ち
A crypto-secure Reliable-UDP library for Golang with FEC support.
翻訳待ち
開発ツールGitHub @xtaci自分でインストール所有者未確認
Paste into Claude or ChatGPT for installation instructions suited to your environment.
Have you tried it? One tap is enough. No sign-in needed.
リポジトリ情報はまだ収集していません。
No updates detected yet. GitHub releases will appear here.
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full README ↗kcp-go is a Reliable-UDP library for golang.
This library provides a reliable, ordered byte-stream transport over UDP. Optional FEC and packet encryption are available. Encryption can hide packet contents, but random per-packet nonces do not make network traffic anonymous: endpoints, packet sizes, timing, and traffic volume may still be observable. It has been deployed across a range of devices and applications, including online games, live broadcasting, file synchronization, and network acceleration.
kcp-go implements net.Conn and net.Listener, so applications can use familiar stream I/O. These standalone examples show a basic echo server and client; they use no packet encryption or FEC.
Echo server:
package main
import (
"io"
"log"
"net"
"github.com/xtaci/kcp-go/v5"
)
func main() {
ln, err := kcp.Listen("127.0.0.1:12345")
if err != nil {
log.Fatal(err)
}
defer ln.Close()
for {
conn, err := ln.Accept()
if err != nil {
log.Fatal(err)
}
go func(conn net.Conn) {
defer conn.Close()
if _, err := io.Copy(conn, conn); err != nil {
log.Println(err)
}
}(conn)
}
}
Echo client:
package main
import (
"fmt"
"io"
"log"
"github.com/xtaci/kcp-go/v5"
)
func main() {
conn, err := kcp.Dial("127.0.0.1:12345")
if err != nil {
log.Fatal(err)
}
defer conn.Close()
payload := []byte("hello over KCP")
if _, err := conn.Write(payload); err != nil {
log.Fatal(err)
}
reply := make([]byte, len(payload))
if _, err := io.ReadFull(conn, reply); err != nil {
log.Fatal(err)
}
fmt.Println(string(reply))
}
For optional packet encryption or FEC, use ListenWithOptions and DialWithOptions; both peers must use matching encryption keys and FEC shard settings. See Godoc for configuration details.
net.Conn and net.Listener APIs; the familiar interface does not make the transport TCP.go build -tags kcp_no_snmp ./...; in this build, Snmp is an empty placeholder and its statistics fields and reporting methods are unavailable.For complete documentation, see the associated Godoc.
The KCP flush path scans the in-flight send buffer to find segments that need transmission or retransmission. The ring-buffer representation supports sequential traversal with good locality; the scan cost depends on the number of in-flight segments and how often the session is updated.
I wrote a benchmark comparing sequential loops through a slice and a container/list here:
BenchmarkLoopSlice-4 2000000000 0.39 ns/op
BenchmarkLoopList-4 100000000 54.6 ns/op
The list structure introduces heavy cache misses compared to the slice, which offers better locality. In the linked benchmark, for 5,000 connections with a 32-window size and a 20 ms update interval, using a slice costs 6 μs (0.03% CPU) per kcp.flush(), whereas using a list costs 8.7 ms (43.5% CPU). These figures are benchmark-specific; actual cost depends on workload and hardware.
Timing is critical for the RTT estimator. Inaccurate timing can cause premature or delayed retransmissions. KCP uses currentMs(), which derives elapsed monotonic time from a package reference point. The time.Now() numbers below are measurements from a historical benchmark on the listed hardware, not portable performance guarantees.
The benchmark for time.Now() is here:
This is the beginning of the README. Read the rest at the original. Read the full README ↗