feat 优化网络库

This commit is contained in:
2026-01-03 13:19:43 +08:00
parent a565692217
commit 470f642515
19 changed files with 180 additions and 126 deletions

View File

@@ -6,6 +6,7 @@ import (
"fmt"
"gateway/config"
"gateway/internal/net/ws_gateway"
"github.com/panjf2000/gnet/v2"
"sync"
"time"
)
@@ -31,14 +32,16 @@ func (m *ModuleWebsocketServer) start() error {
go func() {
defer m.wg.Done()
_ = m.server.Run(
log.GetLogger().Named("GNET"),
fmt.Sprintf("tcp4://0.0.0.0:%v", config.Get().Serve.Socket.Web.Port),
true,
0,
gnet.TCPNoDelay,
64*1024,
64*1024,
true,
false,
false,
true,
8,
log.GetLogger().Named("GNET"),
)
}()
return nil