san*_*a85 5 azure-service-fabric service-fabric-actor
我有一个使用WCF的Actor服务:
[assembly: WcfActorRemotingProvider(RemotingListener = RemotingListener.V2Listener, RemotingClient = RemotingClient.V2Client)]
namespace Player.Interfaces
{
/// <summary>
/// This interface defines the methods exposed by an actor.
/// Clients use this interface to interact with the actor that implements it.
/// </summary>
public interface IPlayer : IActor
{
Task<bool> JoinGameAsync(ActorId gameId, string playerName);
Task<bool> MakeMoveAsync(ActorId gameId, int x, int y);
}
}
Run Code Online (Sandbox Code Playgroud)
使用Service Remoting V2,我可以编写客户端代码并访问方法:
var player1 = ActorProxy.Create<IPlayer>(new ActorId("Player 1"), "fabric:/ActorWCFApplication");
Run Code Online (Sandbox Code Playgroud)
如何实现相同的使用WcfActorRemotingClientFactory或WCF?
var wcfRemotingClient = new WcfActorRemotingClientFactory(WcfUtility.CreateTcpClientBinding(), null,
servicePartitionResolver: partitionResolver);
Run Code Online (Sandbox Code Playgroud)
用于Actor的WCF客户端代码的任何代码片段?
| 归档时间: |
|
| 查看次数: |
73 次 |
| 最近记录: |