lxzan / gws

simple, fast, reliable websocket server & client, supports running over tcp/kcp/unix domain socket. keywords: ws, proxy, chat, go, golang...
https://pkg.go.dev/github.com/lxzan/gws
Apache License 2.0
1.4k stars 90 forks source link

v1.6.2 #32

Closed lxzan closed 1 year ago

lxzan commented 1 year ago

@lesismal 卷不动性能, 只能加feature了

你看看我这个Broadcaster还需要改吗

lesismal commented 1 year ago

如果是我,就把Broadcast删掉。。:joy: protocol框架跟应用框架不同,应用功能交给melody那种框架去做就可以了,或者用户自己根据需要定制

lxzan commented 1 year ago

交给外部做,至少得把genFrame方法导出

lesismal commented 1 year ago

交给外部做,至少得把genFrame方法导出

那就是设计的问题了,应该是只需要WriteMessage/WriteAsync这种,或者像我那种用户可配置是否异步,然后统一使用WriteMessage

lxzan commented 1 year ago

想节省点CPU,压缩开销太大了,Broadcaster里面只会被压缩一次

lesismal commented 1 year ago

想节省点CPU,压缩开销太大了,Broadcaster里面只会被压缩一次

那提供frame和sendframe相关的也行,总比自己做broadcast要好些,broadcast的需求面对性能场景更需要被定制,frame毕竟还是protocol这一层