diff --git a/mROA.Test/CborTest.cs b/mROA.Test/CborTest.cs deleted file mode 100644 index cfa7d20..0000000 --- a/mROA.Test/CborTest.cs +++ /dev/null @@ -1,125 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using mROA.Cbor; - -namespace mROA.Test; - -public class CborTest -{ - private ComplexTestObject _complexTestObject; - private IContextualSerializationToolKit _serializationToolKit; - private BasicCollectionElement _basicCollectionElement; - - [SetUp] - public void Setup() - { - _basicCollectionElement = new() { A = 567565, B = "test text", C = 2.781f }; - - _complexTestObject = new ComplexTestObject - { - IntValue = 123, - DoubleValue = 3.14159, - StringValue = "abc", - EnumValue = TestEnum.X, - CollectionElements = - [ - _basicCollectionElement, - new BasicCollectionElement { A = 8_000_000, B = "Fi number", C = 1.618f } - ], - IntArray = [1, 4, 8, 16, 87] - }; - _serializationToolKit = new CborSerializationToolkit(); - } - - [Test] - public void BasicOnly() - { - var value = 123; - var data = _serializationToolKit.Serialize(value, null); - - var deserialize = _serializationToolKit.Deserialize(data, null); - Assert.That(value, Is.EqualTo(deserialize)); - } - - [Test] - public void ComplexFlat() - { - var value = _basicCollectionElement; - var data = _serializationToolKit.Serialize(value, null); - var deserialize = _serializationToolKit.Deserialize(data, null); - Assert.That(value, Is.EqualTo(deserialize)); - } - - [Test] - public void ComplexFull() - { - var value = _complexTestObject; - var data = _serializationToolKit.Serialize(value, null); - var deserialize = _serializationToolKit.Deserialize(data, null); - Assert.That(value, Is.EqualTo(deserialize)); - } - - public void SharedObject() - { - } - - - private class ComplexTestObject - { - public int IntValue { get; set; } - public double DoubleValue { get; set; } - public string StringValue { get; set; } - public TestEnum EnumValue { get; set; } - public int[] IntArray { get; set; } - public List CollectionElements { get; set; } - - protected bool Equals(ComplexTestObject other) - { - return IntValue == other.IntValue && DoubleValue.Equals(other.DoubleValue) && StringValue == other.StringValue && IntArray.SequenceEqual(other.IntArray) && CollectionElements.SequenceEqual(other.CollectionElements); - } - - public override bool Equals(object? obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != GetType()) return false; - return Equals((ComplexTestObject)obj); - } - - public override int GetHashCode() - { - return HashCode.Combine(IntValue, DoubleValue, StringValue, IntArray, CollectionElements); - } - } - - private class BasicCollectionElement - { - public int A { get; set; } - public string B { get; set; } - public float C { get; set; } - - protected bool Equals(BasicCollectionElement other) - { - return A == other.A && B == other.B && C.Equals(other.C); - } - - public override bool Equals(object? obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != GetType()) return false; - return Equals((BasicCollectionElement)obj); - } - - public override int GetHashCode() - { - return HashCode.Combine(A, B, C); - } - } - - public enum TestEnum - { - X = -5, Y, Z - } -} \ No newline at end of file diff --git a/mROA.Test/FrontendFinalTest.cs b/mROA.Test/FrontendFinalTest.cs deleted file mode 100644 index a765343..0000000 --- a/mROA.Test/FrontendFinalTest.cs +++ /dev/null @@ -1,92 +0,0 @@ -// using System.Net; -// using System.Net.Sockets; -// using System.Reflection; -// using mROA.Abstract; -// using mROA.Codegen; -// using Example.Shared; -// using mROA.Implementation; -// -// namespace mROA.Test; -// -// public class FrontendFinalTest -// { -// private StreamBasedInteractionModule _interactionModule; -// private StreamBasedFrontendInteractionModule _frontendInteractionModule; -// private JsonFrontendSerialisationModule _frontendSerialisationModule; -// private ISerialisationModule _serialisationModule; -// private IExecuteModule _executeModule; -// private IMethodRepository _methodRepository; -// private IContextRepository _contextRepository; -// bool isTestNotFinished = true; -// private IContextRepository _frontendContextRepository; -// -// [SetUp] -// public void Setup() -// { -// _methodRepository = new CoCodegenMethodRepository(); -// var repo2 = new ContextRepository(); -// repo2.FillSingletons(typeof(ITestController).Assembly); -// _contextRepository = repo2; -// -// _interactionModule = new StreamBasedInteractionModule(); -// -// _serialisationModule = new JsonSerialisationModule(); -// -// _executeModule = new BasicExecutionModule(); -// -// IInjectableModule[] backendModules = -// [_methodRepository, _contextRepository, _interactionModule, _serialisationModule, _executeModule]; -// -// foreach (var backendModule in backendModules) -// foreach (var injection in backendModules) -// backendModule.Inject(injection); -// -// _frontendInteractionModule = new StreamBasedFrontendInteractionModule(); -// _frontendSerialisationModule = new JsonFrontendSerialisationModule(); -// _frontendContextRepository = new FrontendContextRepository(); -// -// IInjectableModule[] frontendModules = -// [_frontendInteractionModule, _frontendSerialisationModule, _frontendContextRepository]; -// -// foreach (var backendModule in frontendModules) -// foreach (var injection in frontendModules) -// backendModule.Inject(injection); -// -// Task.Run(() => -// { -// TcpListener listener = new TcpListener(IPAddress.Loopback, 4567); -// listener.Start(); -// -// var stream = listener.AcceptTcpClient().GetStream(); -// -// Console.WriteLine("Client connected"); -// -// _interactionModule.RegisterSourse(stream); -// -// while (isTestNotFinished) ; -// }); -// -// var tcpClient = new TcpClient(); -// tcpClient.Connect(IPAddress.Loopback, 4567); -// _frontendInteractionModule.ServerStream = tcpClient.GetStream(); -// } -// -// [Test] -// public void CallTest() -// { -// var singleton = _frontendContextRepository.GetSingleObject(typeof(ITestController)) as ITestController; -// -// var x = singleton.B(); -// Console.WriteLine(x); -// } -// -// [Test] -// public void TransmittionTest() -// { -// var singleton = _frontendContextRepository.GetSingleObject(typeof(ITestController)) as ITestController; -// -// var next = singleton.SharedObjectTransmitionTest().Value; -// var parameter = singleton.GetTestParameter().Value; -// var x = next.Parametrized(new TestParameter { A = 100, LinkedObject = new(parameter!) }); -// } -// } \ No newline at end of file diff --git a/mROA.Test/NextGenTest.cs b/mROA.Test/NextGenTest.cs deleted file mode 100644 index 6a36ef5..0000000 --- a/mROA.Test/NextGenTest.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Linq; -using System.Net; -using System.Net.Sockets; -using System.Text; -using System.Threading.Tasks; -using mROA.Implementation; - -namespace mROA.Test -{ - public class NextGenTest - { - private TcpListener _listener; - private ChannelInteractionModule _interactionModuleA; - private ChannelInteractionModule _interactionModuleB; - private Guid[] guids = [Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid()]; - - [SetUp] - public void Setup() - { - _listener = new TcpListener(IPAddress.Loopback, 4567); - _interactionModuleA = new ChannelInteractionModule(); - _interactionModuleA.Inject(new JsonSerializationToolkit()); - _interactionModuleB = new ChannelInteractionModule(); - _interactionModuleB.Inject(new JsonSerializationToolkit()); - - } - - [Test] - public void MultithreadedTest() - { - - Task.Run(() => - { - _listener.Start(); - // _interactionModuleB.BaseStream = _listener.AcceptTcpClient().GetStream(); - - foreach (var guid in guids) - { - _interactionModuleB.PostMessageAsync(new NetworkMessageHeader { Id = guid, Data = "Hello user"u8.ToArray() }); - } - }); - - var client = new TcpClient(); - client.Connect(IPAddress.Loopback, 4567); - // _interactionModuleA.BaseStream = client.GetStream(); - - var tasks = guids.Select(ReadStream); - - Task.WaitAll(tasks.ToArray()); - Assert.Pass(); - - } - - private async Task ReadStream(Guid current) - { - var msg = await _interactionModuleA.GetNextMessageReceiving(); - Console.WriteLine( - $"{Environment.CurrentManagedThreadId} Received message: {Encoding.Default.GetString(new JsonSerializationToolkit().Serialize(msg))}"); - while (msg.Id != current) - { - msg = await _interactionModuleA.GetNextMessageReceiving(); - Console.WriteLine( - $"{Environment.CurrentManagedThreadId} Received message: {Encoding.Default.GetString(new JsonSerializationToolkit().Serialize(msg))}"); - } - - Console.WriteLine($"{Environment.CurrentManagedThreadId} Good message received"); - } - - [TearDown] - public void TearDown() - { - _listener.Stop(); - _listener.Dispose(); - _interactionModuleA.Dispose(); - _interactionModuleB.Dispose(); - } - } -} \ No newline at end of file diff --git a/mROA.Test/StreamTest.cs b/mROA.Test/StreamTest.cs deleted file mode 100644 index 6a10e72..0000000 --- a/mROA.Test/StreamTest.cs +++ /dev/null @@ -1,65 +0,0 @@ -// using System.Net; -// using System.Net.Sockets; -// using System.Text.Json; -// using mROA.Implementation; -// -// namespace mROA.Test; -// -// public class StreamTest -// { -// private StreamBasedInteractionModule _interactionModule; -// private StreamBasedFrontendInteractionModule _frontendInteractionModule; -// private JsonFrontendSerialisationModule _frontendSerialisationModule; -// private ISerialisationModule _serialisationModule; -// private IExecuteModule _executeModule; -// bool isTestNotFinished = true; -// -// [SetUp] -// public void Setup() -// { -// _interactionModule = new StreamBasedInteractionModule(); -// -// _serialisationModule = new JsonSerialisationModule(_interactionModule, new MockMethodRepository()); -// -// _executeModule = new MockExecModule(); -// _serialisationModule.SetExecuteModule(_executeModule); -// -// _frontendInteractionModule = new StreamBasedFrontendInteractionModule(); -// _frontendSerialisationModule = new JsonFrontendSerialisationModule(_frontendInteractionModule); -// -// Task.Run(() => -// { -// TcpListener listener = new TcpListener(IPAddress.Loopback, 4567); -// listener.Start(); -// -// var stream = listener.AcceptTcpClient().GetStream(); -// -// Console.WriteLine("Client connected"); -// -// _interactionModule.RegisterSourse(stream); -// -// while (isTestNotFinished) ; -// }); -// } -// -// [Test] -// public void StreamingTest() -// { -// var tcpClient = new TcpClient(); -// tcpClient.Connect(IPAddress.Loopback, 4567); -// _frontendInteractionModule.ServerStream = tcpClient.GetStream(); -// -// var req = new DefaultCallRequest { CommandId = 1, ObjectId = -1 }; -// _frontendSerialisationModule.PostCallRequest(req); -// var res = ((JsonElement)_frontendSerialisationModule -// .GetNextCommandExecution(req.CallRequestId).GetAwaiter().GetResult().Result!) -// .Deserialize(); -// isTestNotFinished = false; -// Assert.That(res.A == "wqer" && res.B == 5); -// } -// -// [Test] -// public void RemoteObjectTest() -// { -// } -// } \ No newline at end of file diff --git a/mROA.Test/UnSOization.cs b/mROA.Test/UnSOization.cs deleted file mode 100644 index d30c025..0000000 --- a/mROA.Test/UnSOization.cs +++ /dev/null @@ -1,26 +0,0 @@ -using mROA.Implementation; - -namespace mROA.Test; - -public class UnSOization -{ - private ComplexObjectIdentifier _uoi; - - [SetUp] - public void Setup() - { - _uoi = new ComplexObjectIdentifier - { - ContextId = -123, OwnerId = 123 - }; - } - - [Test] - public void FlatTest() - { - var flat = _uoi.Flat; - var next = new ComplexObjectIdentifier { Flat = flat }; - - Assert.That(_uoi, Is.EqualTo(next)); - } -} \ No newline at end of file diff --git a/mROA.Test/UnitTest1.cs b/mROA.Test/UnitTest1.cs deleted file mode 100644 index 78a3e38..0000000 --- a/mROA.Test/UnitTest1.cs +++ /dev/null @@ -1,154 +0,0 @@ -// using System.Diagnostics; -// using System.Reflection; -// using System.Text; -// using System.Text.Json; -// using Example.Shared; -// using mROA.Implementation; -// using Newtonsoft.Json; -// using JsonSerializer = System.Text.Json.JsonSerializer; -// -// namespace mROA.Test; -// -// public class Tests -// { -// private ProgramlyInteractionChanel _interactionModule; -// private ISerialisationModule _serialisationModule; -// private IExecuteModule _executeModule; -// private IMethodRepository _methodRepository; -// private IContextRepository _contextRepository; -// -// private ITestController _testController; -// -// [SetUp] -// public void Setup() -// { -// _interactionModule = new ProgramlyInteractionChanel(); -// var repo = new MethodRepository(); -// repo.CollectForAssembly(Assembly.GetExecutingAssembly()); -// _methodRepository = repo; -// var repo2 = new ContextRepository(); -// repo2.FillSingletons(Assembly.GetExecutingAssembly()); -// _contextRepository = repo2; -// _serialisationModule = new JsonSerialisationModule(_interactionModule, _methodRepository); -// -// _executeModule = new LaunchReadyExecutionModule(_methodRepository, _serialisationModule, _contextRepository); -// TransmissionConfig.DefaultContextRepository = _contextRepository; -// } -// -// [Test] -// public void CommandPipelineTest() -// { -// var sw = Stopwatch.StartNew(); -// -// _interactionModule.PassCommand(132, """ -// { -// "RequestTypeId": 0, -// "CommandId": 2 -// } -// """u8.ToArray()); -// Assert.Pass(_interactionModule.OutputBuffer.Last()); -// } -// -// [Test] -// public void CommandPipelineTestAsync() -// { -// var sw = Stopwatch.StartNew(); -// _interactionModule.PassCommand(132, """ -// { -// "RequestTypeId": 0, -// "CommandId": 3 -// } -// """u8.ToArray()); -// while (_interactionModule.OutputBuffer.Count != 2) ; -// -// Assert.Pass(_interactionModule.OutputBuffer.Last()); -// } -// -// [Test] -// public void MethodRegistrationTest() -// { -// var repo = new MethodRepository(); -// repo.CollectForAssembly(Assembly.GetExecutingAssembly()); -// Assert.That(repo.GetMethods().ToList().Count == 8); -// } -// -// [Test] -// public void ContextSupplyTest() -// { -// var repo = new ContextRepository(); -// repo.FillSingletons(Assembly.GetExecutingAssembly()); -// var singleObject = repo.GetSingleObject(typeof(ITestController)) as ITestController; -// singleObject.B(); -// Assert.That(singleObject.B() == 6); -// } -// -// [Test] -// public void TransmissionTest() -// { -// _interactionModule.PassCommand(132, """ -// { -// "CommandId": 4 -// } -// """u8.ToArray()); -// var response = -// JsonSerializer.Deserialize>( -// JsonSerializer.Deserialize(_interactionModule.OutputBuffer.Last()) -// ?.Result.ToString() -// ); -// -// _interactionModule.PassCommand(132, Encoding.UTF8.GetBytes( -// JsonSerializer.Serialize(new DefaultCallRequest { CommandId = 2, ObjectId = response.ContextId }))); -// -// var firstFull = JsonDocument.Parse(_interactionModule.OutputBuffer.Last()).RootElement.GetProperty("Result") -// .GetInt32(); -// -// _interactionModule.PassCommand(132, Encoding.UTF8.GetBytes( -// JsonSerializer.Serialize(new DefaultCallRequest { CommandId = 4, ObjectId = response.ContextId }))); -// -// response = -// JsonSerializer.Deserialize>( -// JsonSerializer.Deserialize(_interactionModule.OutputBuffer.Last()) -// ?.Result.ToString() -// ); -// -// _interactionModule.PassCommand(132, Encoding.UTF8.GetBytes( -// JsonSerializer.Serialize(new DefaultCallRequest { CommandId = 2, ObjectId = response.ContextId }))); -// _interactionModule.PassCommand(132, Encoding.UTF8.GetBytes( -// JsonSerializer.Serialize(new DefaultCallRequest { CommandId = 2, ObjectId = response.ContextId }))); -// -// var secondFull = JsonDocument.Parse(_interactionModule.OutputBuffer.Last()).RootElement.GetProperty("Result") -// .GetInt32(); -// -// Assert.That(firstFull == 456789 && secondFull == 6); -// } -// -// [Test] -// public void LinkedObjectsAndParametersTest() -// { -// _interactionModule.PassCommand(132, """ -// { -// "CommandId": 6 -// } -// """u8.ToArray()); -// var response = -// JsonSerializer.Deserialize>( -// JsonSerializer.Deserialize(_interactionModule.OutputBuffer.Last()) -// ?.Result.ToString() -// ); -// var x = response.ContextId; -// _interactionModule.PassCommand(132,Encoding.UTF8.GetBytes( -// JsonSerializer.Serialize(new DefaultCallRequest -// { -// CommandId = 5, -// Parameter = new TestParameter -// { -// A = 10, -// LinkedObject = new TransmittedSharedObject { ContextId = x } -// } -// }))); -// -// var finalResponse = JsonDocument.Parse(_interactionModule.OutputBuffer.Last()).RootElement.GetProperty("Result").GetInt32(); -// -// Assert.That(finalResponse, Is.EqualTo(20)); -// } -// } \ No newline at end of file diff --git a/mROA/Abstract/IExecuteModule.cs b/mROA/Abstract/IExecuteModule.cs index 3ae2d13..abf76d6 100644 --- a/mROA/Abstract/IExecuteModule.cs +++ b/mROA/Abstract/IExecuteModule.cs @@ -5,6 +5,6 @@ namespace mROA.Abstract public interface IExecuteModule : IInjectableModule { ICommandExecution Execute(ICallRequest command, IContextRepository contextRepository, - IRepresentationModule representationModule); + IRepresentationModule representationModule, IEndPointContext context); } } \ No newline at end of file diff --git a/mROA/Implementation/Backend/BasicExecutionModule.cs b/mROA/Implementation/Backend/BasicExecutionModule.cs index 3264b52..1360230 100644 --- a/mROA/Implementation/Backend/BasicExecutionModule.cs +++ b/mROA/Implementation/Backend/BasicExecutionModule.cs @@ -28,7 +28,7 @@ namespace mROA.Implementation.Backend } public ICommandExecution Execute(ICallRequest command, IContextRepository contextRepository, - IRepresentationModule representationModule) + IRepresentationModule representationModule, IEndPointContext endPointContext) { #if TRACE Console.WriteLine(command.GetType().Name); @@ -58,7 +58,7 @@ namespace mROA.Implementation.Backend object?[]? castedParams = null; if (invoker.ParameterTypes.Length != 0) - castedParams = CastedParams(command, invoker); + castedParams = CastedParams(command, invoker, endPointContext); var execContext = new RequestContext(command.Id, representationModule.Id); @@ -68,10 +68,10 @@ namespace mROA.Implementation.Backend case AsyncMethodInvoker { IsVoid: false } asyncNonVoidMethodInvoker: return TypedExecuteAsync(asyncNonVoidMethodInvoker, context, castedParams, command, _cancellationRepo!, - representationModule, execContext); + representationModule, execContext, endPointContext); case AsyncMethodInvoker asyncMethodInvoker: return ExecuteAsync(asyncMethodInvoker, context, castedParams, command, _cancellationRepo!, - representationModule, execContext); + representationModule, execContext, endPointContext); default: var result = Execute((invoker as MethodInvoker)!, context, castedParams!, command, execContext); if (command.CommandId == -1) @@ -104,12 +104,12 @@ namespace mROA.Implementation.Backend return context; } - private object?[] CastedParams(ICallRequest command, IMethodInvoker invoker) + private object?[] CastedParams(ICallRequest command, IMethodInvoker invoker, IEndPointContext context) { object?[] castedParams = new object[invoker.ParameterTypes.Length]; for (var i = 0; i < castedParams.Length; i++) { - castedParams[i] = _serialization!.Cast(command.Parameters![i], invoker.ParameterTypes[i]); + castedParams[i] = _serialization!.Cast(command.Parameters![i], invoker.ParameterTypes[i], context); } return castedParams; @@ -184,7 +184,7 @@ namespace mROA.Implementation.Backend private ICommandExecution ExecuteAsync(AsyncMethodInvoker invoker, object instance, object?[]? parameters, ICallRequest command, ICancellationRepository cancellationRepository, - IRepresentationModule representationModule, RequestContext executionContext) + IRepresentationModule representationModule, RequestContext executionContext, IEndPointContext context) { var tokenSource = new CancellationTokenSource(); cancellationRepository.RegisterCancellation(command.Id, tokenSource); @@ -211,7 +211,7 @@ namespace mROA.Implementation.Backend multiClientOwnershipRepository?.RegisterOwnership(representationModule.Id); if (invoker.IsTrusted) representationModule.PostCallMessage(command.Id, EMessageType.FinishedCommandExecution, - payload); + payload, context); multiClientOwnershipRepository?.FreeOwnership(); }); @@ -237,7 +237,7 @@ namespace mROA.Implementation.Backend private ICommandExecution TypedExecuteAsync(AsyncMethodInvoker invoker, object instance, object?[]? parameters, ICallRequest command, ICancellationRepository cancellationRepository, - IRepresentationModule representationModule, RequestContext executionContext) + IRepresentationModule representationModule, RequestContext executionContext, IEndPointContext context) { var tokenSource = new CancellationTokenSource(); cancellationRepository.RegisterCancellation(command.Id, tokenSource); @@ -259,7 +259,7 @@ namespace mROA.Implementation.Backend TransmissionConfig.OwnershipRepository as MultiClientOwnershipRepository; multiClientOwnershipRepository?.RegisterOwnership(representationModule.Id); representationModule.PostCallMessage(command.Id, EMessageType.FinishedCommandExecution, - payload); + payload, context); multiClientOwnershipRepository?.FreeOwnership(); }); diff --git a/mROA/Implementation/Backend/UdpGateway.cs b/mROA/Implementation/Backend/UdpGateway.cs index 0bbcf5d..d2642bb 100644 --- a/mROA/Implementation/Backend/UdpGateway.cs +++ b/mROA/Implementation/Backend/UdpGateway.cs @@ -17,7 +17,7 @@ namespace mROA.Implementation.Backend private Dictionary _reservedPorts = new(); private CancellationTokenSource _tokenSource = new(); private IContextualSerializationToolKit _serializationToolkit; - + private IEndPointContext _context; public UdpGateway(IPEndPoint listeningEndpoint) { _client = new UdpClient(listeningEndpoint); @@ -34,6 +34,9 @@ namespace mROA.Implementation.Backend case IContextualSerializationToolKit serializationToolkit: _serializationToolkit = serializationToolkit; break; + case IEndPointContext context: + _context = context; + break; } } @@ -51,7 +54,7 @@ namespace mROA.Implementation.Backend while (token.IsCancellationRequested == false) { var incoming = await _client.ReceiveAsync(); - var parsed = _serializationToolkit.Deserialize(incoming.Buffer); + var parsed = _serializationToolkit.Deserialize(incoming.Buffer, _context); try { int channelId; @@ -87,7 +90,7 @@ namespace mROA.Implementation.Backend or EventRequest)) continue; - var parsed = _serializationToolkit.Serialize(post); + var parsed = _serializationToolkit.Serialize(post, _context); await _client.SendAsync(parsed, parsed.Length, endpoint); } } diff --git a/mROA/Implementation/Frontend/RequestExtractor.cs b/mROA/Implementation/Frontend/RequestExtractor.cs index 8822cb4..ef88ddc 100644 --- a/mROA/Implementation/Frontend/RequestExtractor.cs +++ b/mROA/Implementation/Frontend/RequestExtractor.cs @@ -1,5 +1,7 @@ using System; +#if TRACE using System.Diagnostics; +#endif using System.Threading; using System.Threading.Tasks; using mROA.Abstract; @@ -18,6 +20,7 @@ namespace mROA.Implementation.Frontend private IRepresentationModule? _representationModule; private IContextualSerializationToolKit? _serializationToolkit; private IEndPointContext _context; + public void Inject(T dependency) { switch (dependency) @@ -70,7 +73,8 @@ namespace mROA.Implementation.Frontend var query = _representationModule!.GetStream(m => m.MessageType is EMessageType.CallRequest or EMessageType.CancelRequest - or EMessageType.EventRequest or EMessageType.ClientDisconnect, _context, streamTokenSource.Token, + or EMessageType.EventRequest or EMessageType.ClientDisconnect, _context, + streamTokenSource.Token, m => m.MessageType == EMessageType.CallRequest ? typeof(DefaultCallRequest) : null, m => m.MessageType == EMessageType.CancelRequest ? typeof(CancelRequest) : null, m => m.MessageType == EMessageType.EventRequest ? typeof(DefaultCallRequest) : null, diff --git a/mROA/Implementation/Frontend/UdpUntrustedInteraction.cs b/mROA/Implementation/Frontend/UdpUntrustedInteraction.cs index 4ee2f00..07896f3 100644 --- a/mROA/Implementation/Frontend/UdpUntrustedInteraction.cs +++ b/mROA/Implementation/Frontend/UdpUntrustedInteraction.cs @@ -11,7 +11,7 @@ namespace mROA.Implementation.Frontend { private IContextualSerializationToolKit _serializationToolkit; private IChannelInteractionModule _channelInteractionModule; - private CancellationTokenSource _tokenSource = new CancellationTokenSource(); + private CancellationTokenSource _tokenSource = new(); public void Dispose() {