网络层
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
"fmt"
|
||||
"gateway/config"
|
||||
"gateway/grpc_server"
|
||||
"gateway/handler/ws_handler"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/judwhite/go-svc"
|
||||
"runtime/debug"
|
||||
@@ -52,10 +51,16 @@ func (p *Program) Start() error {
|
||||
}()
|
||||
|
||||
discover.Listen()
|
||||
p.server = grpc_server.NewServer(config.Get().Grpc.Registry.TTL)
|
||||
p.server.Init(config.Get().Grpc.Registry.Address, config.Get().Grpc.Registry.Port)
|
||||
|
||||
ws_handler.NewClient(123, nil)
|
||||
p.server = grpc_server.NewServer(config.Get().Serve.Grpc.TTL)
|
||||
p.server.Init(config.Get().Serve.Grpc.Address, config.Get().Serve.Grpc.Port)
|
||||
go func() {
|
||||
cfg := config.Get()
|
||||
_ = p.wsServer.Run(
|
||||
log.GetLogger().Named("gnet"),
|
||||
fmt.Sprintf("tcp4://0.0.0.0:%v", cfg.Serve.Socket.Web.Port),
|
||||
true, true, false, false, true, 8,
|
||||
)
|
||||
}()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ func (p *Program) initWsServer(cfg *config.Config) error {
|
||||
//)
|
||||
p.wsServer = websocket.NewWSServer(
|
||||
&ws_gateway.GatewayWsServer{},
|
||||
log.GetLogger(),
|
||||
log.GetLogger().Named("ws_server"),
|
||||
5*time.Second,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user