"refactor(rpc): 移除端口检查条件,强制注册逻辑服务并添加重连注释"
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user