云盘
志元云盘
备份云盘
Home
/
志元云盘
/
webdav
/
sync
/
go
/
peerguard
/
connmux
File
OriginalPic
Thumbnails
CopyAllDownloadUrl
EditTime
Size
connmux.go
2024-09-26 17:29:14
7.74 KB
connmux_test.go
2024-09-26 17:29:56
3.06 KB
README.md
2024-09-26 16:51:09
620 B
# connmux A connection multiplexing library ### Example #### client ``` c, err := net.Dial("tcp", "192.168.3.99:7676") if err != nil { panic(err) } session := connmux.Mux(c, connmux.SeqOdd) defer session.Close() for { muxC, err := session.Accept() if err != nil { panic(err) } go handleConn(muxC) } ``` #### server ``` l, err := net.Listen("tcp", ":7676") if err != nil { panic(err) } c, err := l.Accept() if err != nil { panic(err) } session := connmux.Mux(c, connmux.SeqEven) defer session.Close() muxConn, err := session.OpenStream() if err != nil { panic(err) } // ... ```
2025-08-29 16:36:36 Friday 216.73.216.167 Runningtime:0.03s Mem:1.47 MB