Skip to content

Commit

Permalink
chore: minor change in MultiServerRpcApp
Browse files Browse the repository at this point in the history
  • Loading branch information
alexyakunin committed Jul 14, 2023
1 parent e046e36 commit 225dce7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions samples/MultiServerRpcApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

const int serverCount = 2;
var serverUrls = Enumerable.Range(0, serverCount).Select(i => $"http://localhost:{22222 + i}/").ToArray();
var clientPeerRefs = Enumerable.Range(0, serverCount).Select(i => new RpcPeerRef(i.ToString())).ToArray();
var clientPeerRefs = Enumerable.Range(0, serverCount).Select(i => new RpcPeerRef(serverUrls[i])).ToArray();

await (args switch {
[ "server" ] => RunServers(),
Expand Down Expand Up @@ -51,7 +51,7 @@ async Task RunClient()
var services = new ServiceCollection()
.AddFusion(fusion => {
fusion.Rpc.AddWebSocketClient(_ => new RpcWebSocketClient.Options() {
HostUrlResolver = (_, peer) => serverUrls[int.Parse(peer.Ref.Id.Value)],
HostUrlResolver = (_, peer) => peer.Ref.Id.Value // peer.Ref.Id is the host URL in this sample
});
fusion.AddClient<IChat>();
})
Expand Down

0 comments on commit 225dce7

Please sign in to comment.