diff --git a/Example.Frontend/Program.cs b/Example.Frontend/Program.cs index 234cdaa..5f47471 100644 --- a/Example.Frontend/Program.cs +++ b/Example.Frontend/Program.cs @@ -26,7 +26,7 @@ TransmissionConfig.RealContextRepository = builder.GetModule( TransmissionConfig.RemoteEndpointContextRepository = builder.GetModule(); builder.GetModule()!.Connect(); -// _ = builder.GetModule()!.StartExtraction(); +_ = builder.GetModule()!.StartExtraction(); Console.WriteLine(TransmissionConfig.OwnershipRepository!.GetOwnershipId()); var context = builder.GetModule(); diff --git a/mROA/Implementation/NextGenerationInteractionModule.cs b/mROA/Implementation/NextGenerationInteractionModule.cs index 6210c38..d9f1ce2 100644 --- a/mROA/Implementation/NextGenerationInteractionModule.cs +++ b/mROA/Implementation/NextGenerationInteractionModule.cs @@ -37,14 +37,8 @@ public class NextGenerationInteractionModule : INextGenerationInteractionModule _currentReceiving = Task.Run(GetNextMessage); return _currentReceiving; } - lock (_currentReceiving) - { - if (_currentReceiving is { Status: TaskStatus.Running }) - return _currentReceiving; - _currentReceiving = Task.Run(GetNextMessage); - return _currentReceiving; - } + return _currentReceiving; } public async Task PostMessage(NetworkMessage message) @@ -86,6 +80,8 @@ public class NextGenerationInteractionModule : INextGenerationInteractionModule var message = _serialization.Deserialize(_buffer[..len]); _messageBuffer.Add(message!); + _currentReceiving = Task.Run(GetNextMessage); + return message!; } } \ No newline at end of file