"refactor(rpc): 移除端口检查条件,强制注册逻辑服务并添加重连注释"

This commit is contained in:
1
2025-07-31 08:29:37 +00:00
parent 04d4777ec1
commit 4c10dbf211

View File

@@ -92,16 +92,16 @@ func StartClient(id, port uint16, callback any) *struct {
"ws://"+rpcaddr, "", []interface{}{
&RPCClient,
}, nil, jsonrpc.WithClientHandler("", callback),
jsonrpc.WithReconnFun(func() { RPCClient.RegisterLogic(id, port) }),
jsonrpc.WithReconnFun(func() { RPCClient.RegisterLogic(id, port) }),//TODO 这里会出现server0注册
)
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
if port != 0 { //注册logic
//if port != 0 { //注册logic
RPCClient.RegisterLogic(id, port)
}
//}
closer = closer1
return &RPCClient