Fix infinitive reconnection
This commit is contained in:
@@ -13,7 +13,7 @@ namespace mROA.Test
|
|||||||
private TcpListener _listener;
|
private TcpListener _listener;
|
||||||
private NextGenerationInteractionModule _interactionModuleA;
|
private NextGenerationInteractionModule _interactionModuleA;
|
||||||
private NextGenerationInteractionModule _interactionModuleB;
|
private NextGenerationInteractionModule _interactionModuleB;
|
||||||
private Guid[] guids = new[] { Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid() };
|
private Guid[] guids = [Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid()];
|
||||||
|
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void Setup()
|
public void Setup()
|
||||||
@@ -72,6 +72,8 @@ namespace mROA.Test
|
|||||||
{
|
{
|
||||||
_listener.Stop();
|
_listener.Stop();
|
||||||
_listener.Dispose();
|
_listener.Dispose();
|
||||||
|
_interactionModuleA.Dispose();
|
||||||
|
_interactionModuleB.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -87,6 +87,8 @@ namespace mROA.Implementation.Backend
|
|||||||
break;
|
break;
|
||||||
case EMessageType.ClientRecovery:
|
case EMessageType.ClientRecovery:
|
||||||
{
|
{
|
||||||
|
|
||||||
|
interaction.BaseStream = null;
|
||||||
var recoveryRequest = _serialization!.Deserialize<ClientRecovery>(connectionRequest.Data)!;
|
var recoveryRequest = _serialization!.Deserialize<ClientRecovery>(connectionRequest.Data)!;
|
||||||
var recoveryInteraction = _hub.GetInteraction(recoveryRequest.Id);
|
var recoveryInteraction = _hub.GetInteraction(recoveryRequest.Id);
|
||||||
recoveryInteraction.BaseStream = client.GetStream();
|
recoveryInteraction.BaseStream = client.GetStream();
|
||||||
|
|||||||
@@ -257,8 +257,12 @@ namespace mROA.Implementation
|
|||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("Interaction module disposed");
|
||||||
_isActive = false;
|
_isActive = false;
|
||||||
|
if (_currentReceiving is { IsCompleted: true })
|
||||||
|
{
|
||||||
_currentReceiving?.Dispose();
|
_currentReceiving?.Dispose();
|
||||||
|
}
|
||||||
_baseStream?.Dispose();
|
_baseStream?.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<DefineConstants>TRACE;</DefineConstants>
|
<DefineConstants></DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user