From 5ece345a3ff1794a1bb2bf17680d960c1918a032 Mon Sep 17 00:00:00 2001 From: Mikhail Mitrofanow Date: Wed, 6 Aug 2025 14:50:10 +0300 Subject: [PATCH] Add logging --- mROA/Implementation/ChannelInteractionModule.cs | 7 +++++++ mROA/mROA.csproj | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mROA/Implementation/ChannelInteractionModule.cs b/mROA/Implementation/ChannelInteractionModule.cs index 6b41ec0..7393597 100644 --- a/mROA/Implementation/ChannelInteractionModule.cs +++ b/mROA/Implementation/ChannelInteractionModule.cs @@ -170,6 +170,9 @@ namespace mROA.Implementation } var message = meta.ToMessage(_buffer.Span); +#if TRACE + Console.WriteLine("RECV " + message); +#endif MessageReceived(message); } @@ -183,11 +186,15 @@ namespace mROA.Implementation private async Task Send(NetworkMessage message, CancellationToken token = default) { + Thread.SpinWait(10000); var meta = message.ToMeta(); MemoryMarshal.Write(_buffer.Span, ref meta); message.Data.CopyTo(_buffer.Span[19..]); var sendingSpan = _buffer[..(19 + meta.BodyLength)]; await _ioStream.WriteAsync(sendingSpan, token); + #if TRACE + Console.WriteLine("SEND " + message); + #endif // _logger.LogTrace("SEND {0}", message.ToString()); } diff --git a/mROA/mROA.csproj b/mROA/mROA.csproj index 6e47d56..fb21e70 100644 --- a/mROA/mROA.csproj +++ b/mROA/mROA.csproj @@ -22,7 +22,7 @@ - + TRACE;