nps-mux
nps-mux copied to clipboard
A net connection multiplexing implementation based on golang
nps[19933]: panic: runtime error: slice bounds out of range [90:72] nps[19933]: goroutine 1050459 [running]: nps[19933]: ehang.io/nps-mux.(*sendWindow).WriteTo(0xc000818480, 0xc000341e20, 0x14, 0x1, 0xc000521548, 0x4042d0, 0xc000521728) nps[19933]: /home/runner/go/pkg/mod/ehang.io/[email protected]/conn.go:554 +0x2f2 nps[19933]: ehang.io/nps-mux.(*sendWindow).WriteFull(0xc000818480, 0xc000735100, 0x48, 0x688,...
没有详细的文档很难理解,能否给你个example帮助用户理解使用mux?
1. fix fatal error: concurrent map iteration and map write; 2. panic: send on closed channel;
GC will check all the pointers in map We use it in [map.go](https://github.com/ehang-io/nps-mux/blob/master/map.go#L8) Maybe we should use uintptr instead of pointer sync map instead of map and RWmutex, atomic value...
Cost of calls via interfaces, in [mux.go](https://github.com/ehang-io/nps-mux/blob/master/mux.go#L33) Maybe we should call tcp or kcp connection directly