M src/PacketLogger/PacketLogger.csproj => src/PacketLogger/PacketLogger.csproj +5 -5
@@ 31,16 31,16 @@
<PackageReference Include="DataBox" Version="0.10.13" />
<PackageReference Include="Dock.Avalonia" Version="0.10.18.1" />
<PackageReference Include="Dock.Model.Mvvm" Version="0.10.18.1" />
- <PackageReference Include="NosSmooth.Comms.Local" Version="1.2.3-main4155764956">
+ <PackageReference Include="NosSmooth.Comms.Local" Version="1.3.0">
<IncludeAssets>All</IncludeAssets>
<PrivateAssets>None</PrivateAssets>
</PackageReference>
<PackageReference Include="NosSmooth.Core" Version="4.0.3" />
<PackageReference Include="NosSmooth.Injector" Version="1.1.1" />
- <PackageReference Include="NosSmooth.Cryptography" Version="1.0.0" />
- <PackageReference Include="NosSmooth.LocalBinding" Version="2.0.0" />
- <PackageReference Include="NosSmooth.PacketSerializer.Abstractions" Version="1.3.1" />
- <PackageReference Include="NosSmooth.Pcap" Version="1.0.0" />
+ <PackageReference Include="NosSmooth.Cryptography" Version="1.0.1" />
+ <PackageReference Include="NosSmooth.LocalBinding" Version="2.0.1" />
+ <PackageReference Include="NosSmooth.PacketSerializer.Abstractions" Version="1.3.2" />
+ <PackageReference Include="NosSmooth.Pcap" Version="1.0.1" />
<PackageReference Include="Projektanker.Icons.Avalonia" Version="5.9.0" />
<PackageReference Include="Projektanker.Icons.Avalonia.MaterialDesign" Version="5.9.0" />
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0">
M src/PacketLogger/ViewModels/DocumentViewModel.cs => src/PacketLogger/ViewModels/DocumentViewModel.cs +40 -2
@@ 22,7 22,9 @@ using Dock.Model.Mvvm.Controls;
using DynamicData.Binding;
using Microsoft.Extensions.DependencyInjection;
using NosSmooth.Comms.Data.Messages;
+using NosSmooth.Comms.Inject.Messages;
using NosSmooth.Comms.Local;
+using NosSmooth.Comms.Local.Extensions;
using NosSmooth.Core.Contracts;
using NosSmooth.Core.Extensions;
using NosSmooth.Core.Stateful;
@@ 188,8 190,8 @@ public class DocumentViewModel : Document, INotifyPropertyChanged, IDisposable
return;
}
- var handshakeInitResponse = handshakeResponse.InitializationErrorfulResult ?? Result.FromSuccess();
- if (!handshakeInitResponse.IsSuccess)
+ var handshakeInitResponse = handshakeResponse.InitializationResult;
+ if (handshakeInitResponse is not null && !handshakeInitResponse.Value.IsSuccess)
{
repository.Remove(connection.Client);
Error = "An error has occurred during handshaking: " + handshakeInitResponse.ToFullString();
@@ 197,6 199,42 @@ public class DocumentViewModel : Document, INotifyPropertyChanged, IDisposable
return;
}
+ if (handshakeInitResponse is null)
+ {
+ var runClientContractResult = await connection.Connection.ContractRunClient(new RunClientRequest())
+ .WaitForAsync(DefaultStates.ResponseObtained, ct: ct);
+
+ if (!runClientContractResult.IsDefined(out var runClientResponse))
+ {
+ repository.Remove(connection.Client);
+ Error = "An error has occurred upon sending run client: " + runClientContractResult.ToFullString();
+ Loading = false;
+ return;
+ }
+
+ if (runClientResponse.InitializationResult is null)
+ {
+ repository.Remove(connection.Client);
+ Error = "Unknown error";
+ Loading = false;
+ return;
+ }
+
+ if (runClientResponse.BindingManagerResult is not null && !runClientResponse.BindingManagerResult.Value.IsSuccess)
+ {
+ Console.WriteLine("There was an error in binding initialization.");
+ Console.WriteLine(runClientResponse.BindingManagerResult.Value.ToFullString());
+ }
+
+ if (!runClientResponse.InitializationResult.Value.IsSuccess)
+ {
+ repository.Remove(connection.Client);
+ Error = "An error has occurred during starting client: " + runClientResponse.InitializationResult.ToFullString();
+ Loading = false;
+ return;
+ }
+ }
+
_titleHandle?.Dispose();
_titleHandle = titleGenerator.AddTitle
(