Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/NewLifeX/X
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Jul 4, 2022
2 parents 99e28c5 + 0bcc1e8 commit 399a1c2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion NewLife.Core/Remoting/ApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,12 @@ public virtual Int32 InvokeOneWay(String action, Object args = null, Byte flag =

var act = action;

return Invoke(this, act, args, flag);
var rs = Cluster.Invoke(client =>
{
return Invoke(client, act, args, flag);
});
return rs;
//return Invoke(this, act, args, flag);//这里的参数是否是传错了? 本类没有实现 IApiSession 接口 ,修改如上
}

/// <summary>指定客户端的异步调用,等待返回结果</summary>
Expand Down
8 changes: 8 additions & 0 deletions XUnitTest.Core/Remoting/ApiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ public async void BigMessage()

var buf2 = buf.Select(e => (Byte)(e ^ 'x')).ToArray();
Assert.True(rs.ToArray().SequenceEqual(buf2));

var ret = client.InvokeOneWay("big/TestOneWay", buf);

}

class BigController
Expand All @@ -161,6 +164,11 @@ public Packet Test(Packet pk)

return buf;
}

public void TestOneWay(Packet pk)
{
Assert.Equal(5 * 8 * 1024, pk.Total);
}
}

[Fact]
Expand Down

0 comments on commit 399a1c2

Please sign in to comment.