Test RPC Event

This commit is contained in:
TheJoKlLa
2022-02-22 23:21:28 +01:00
parent 0eb3997d54
commit eaa18af8c2
3 changed files with 11 additions and 3 deletions

View File

@ -8,6 +8,7 @@ using Borepin.Service.Storage;
using Borepin.Model.Storage;
using Borepin.Service.BFFH.Exceptions;
using Borepin.Service.Storage.Exceptions;
using Capnp.Rpc;
namespace Borepin.Service.BFFH
{
@ -60,6 +61,11 @@ namespace Borepin.Service.BFFH
#endregion
#region Methods
private void StateChanged(Object sender, ConnectionStateEventArgs e)
{
}
/// <summary>
/// Get all known Connections from Storage
/// </summary>
@ -297,9 +303,10 @@ namespace Borepin.Service.BFFH
#endregion
#region Private Methods
private static async Task<Capnp.Rpc.TcpRpcClient> _ConnectAsync(string host, int port)
private async Task<TcpRpcClient> _ConnectAsync(string host, int port)
{
Capnp.Rpc.TcpRpcClient rpcClient = new Capnp.Rpc.TcpRpcClient();
TcpRpcClient rpcClient = new TcpRpcClient();
rpcClient.ConnectionStateChanged += StateChanged;
rpcClient.Connect(host, port);
await rpcClient.WhenConnected.ConfigureAwait(false);