From 368b6e58f59e6cd3aa31af39485a32bfc1ce15d4 Mon Sep 17 00:00:00 2001 From: Mitrofanov Mikhail Date: Sat, 12 Jul 2025 14:15:09 +0300 Subject: [PATCH] New channel interaction module ctor --- mROA/Implementation/ChannelInteractionModule.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mROA/Implementation/ChannelInteractionModule.cs b/mROA/Implementation/ChannelInteractionModule.cs index 8a6b144..300f2c9 100644 --- a/mROA/Implementation/ChannelInteractionModule.cs +++ b/mROA/Implementation/ChannelInteractionModule.cs @@ -15,17 +15,20 @@ namespace mROA.Implementation private readonly ChannelWriter _untrustedWriter; private readonly Channel _outputTrustedChannel; private readonly Channel _outputUntrustedChannel; - private IContextualSerializationToolKit _serialization; + private readonly IContextualSerializationToolKit _serialization; private bool _isConnected = true; private bool _isActive = true; private TaskCompletionSource _reconnection; public ChannelInteractionModule(IContextualSerializationToolKit serialization, - IIdentityGenerator identityGenerator) + IIdentityGenerator identityGenerator) : this(serialization) + { + ConnectionId = identityGenerator.GetNextIdentity(); + } + + public ChannelInteractionModule(IContextualSerializationToolKit serialization) { _serialization = serialization; - ConnectionId = identityGenerator.GetNextIdentity(); - ReceiveChanel = Channel.CreateUnbounded(new UnboundedChannelOptions { SingleReader = false, @@ -46,7 +49,7 @@ namespace mROA.Implementation _untrustedWriter = _outputUntrustedChannel.Writer; _reconnection = new TaskCompletionSource(); } - + public int ConnectionId { get; set; } public IEndPointContext Context { get; set; }