Useless ping pong in recovery removed

This commit is contained in:
2025-05-24 23:28:32 +03:00
parent 5a4d889e0c
commit 757d50d1dd
3 changed files with 12 additions and 11 deletions
@@ -4,5 +4,10 @@ namespace mROA.Implementation.Attributes
{ {
public class UntrustedAttribute : Attribute public class UntrustedAttribute : Attribute
{ {
public bool UseAwait { get; private set; }
public UntrustedAttribute(bool useAwait = true)
{
UseAwait = useAwait;
}
} }
} }
@@ -28,10 +28,10 @@ namespace mROA.Implementation
SingleWriter = false, SingleWriter = false,
}); });
_receiveReader = ReceiveChanel.Reader; _receiveReader = ReceiveChanel.Reader;
_outputTrustedChannel = Channel.CreateBounded<NetworkMessageHeader>(new BoundedChannelOptions(1) _outputTrustedChannel = Channel.CreateUnbounded<NetworkMessageHeader>(new UnboundedChannelOptions
{ {
SingleReader = true, SingleReader = true,
SingleWriter = true, SingleWriter = true
}); });
_trustedWriter = _outputTrustedChannel.Writer; _trustedWriter = _outputTrustedChannel.Writer;
_outputUntrustedChannel = Channel.CreateUnbounded<NetworkMessageHeader>(new UnboundedChannelOptions _outputUntrustedChannel = Channel.CreateUnbounded<NetworkMessageHeader>(new UnboundedChannelOptions
@@ -121,13 +121,9 @@ namespace mROA.Implementation
{ {
await PostMessageAsync( await PostMessageAsync(
new NetworkMessageHeader(_serialization!, new ClientRecovery(Math.Abs(ConnectionId)), _context)); new NetworkMessageHeader(_serialization!, new ClientRecovery(Math.Abs(ConnectionId)), _context));
await ReceiveChanel.Reader.ReadAsync();
}
else
{
await _trustedWriter.WriteAsync(new NetworkMessageHeader());
} }
_reconnection.TrySetResult(Stream.Null); _reconnection.TrySetResult(Stream.Null);
_isConnected = true; _isConnected = true;
_reconnection = new TaskCompletionSource<Stream>(); _reconnection = new TaskCompletionSource<Stream>();
+3 -3
View File
@@ -4,7 +4,7 @@
<TargetFramework>netstandard2.1</TargetFramework> <TargetFramework>netstandard2.1</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<Title>mROA</Title> <Title>mROA</Title>
<Version>2.0.1</Version> <Version>2.0.2</Version>
<Authors>YaslePoy</Authors> <Authors>YaslePoy</Authors>
<Description>Fast and easy RPC with contex</Description> <Description>Fast and easy RPC with contex</Description>
<RepositoryUrl>https://github.com/YaslePoy/mROA</RepositoryUrl> <RepositoryUrl>https://github.com/YaslePoy/mROA</RepositoryUrl>
@@ -25,8 +25,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="System.Text.Json" Version="9.0.2"/> <PackageReference Include="System.Text.Json" Version="9.0.5" />
<PackageReference Include="System.Threading.Channels" Version="9.0.4" /> <PackageReference Include="System.Threading.Channels" Version="9.0.5" />
</ItemGroup> </ItemGroup>
</Project> </Project>