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

@ -31,6 +31,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig .editorconfig = .editorconfig
.gitlab-ci.yml = .gitlab-ci.yml .gitlab-ci.yml = .gitlab-ci.yml
.gitmodules = .gitmodules
EndProjectSection EndProjectSection
EndProject EndProject
Global Global

View File

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

@ -1 +1 @@
Subproject commit 1ba1b6fbe0d9a278445ef7fde7624f218171156b Subproject commit 086bbc2497785d2cc63e9252df6f6d3ee7599579