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; }