云盘
志元云盘
备份云盘
Home
/
志元云盘
/
webdav
/
sync
/
go
/
peerguard
/
rdt
File
OriginalPic
Thumbnails
CopyAllDownloadUrl
EditTime
Size
config.go
2024-09-26 17:43:36
957 B
rdt.go
2024-09-26 17:43:48
13.53 KB
README.md
2024-09-26 16:51:09
688 B
stats.go
2024-09-26 17:44:08
1.72 KB
# RDT a Reliable Data Transfer protocol. ### Example **Server** ```go packetConn, err := net.ListenPacket("udp", "192.168.3.99:22334") if err != nil { panic(err) } listener, err := rdt.Listen(packetConn) if err != nil { panic(err) } for { conn, err := listener.Accept() if err != nil { panic(err) } handle(conn) } ``` **Client** ```go packetConn, err := net.ListenPacket("udp", "192.168.3.98:22335") if err != nil { panic(err) } listener, err := rdt.Listen(packetConn) if err != nil { panic(err) } conn, err := listener.OpenStream(&net.UDPAddr{ IP: net.ParseIP("192.168.3.99"), Port: 22334, }) if err != nil { panic(err) } ... ```
2025-08-29 16:36:37 Friday 216.73.216.167 Runningtime:0.025s Mem:1.48 MB