Skip to content

Commit 4c27b81

Browse files
committed
Add support for .NET 9
Move to centralized package management Update NuGet packages
1 parent d302cba commit 4c27b81

17 files changed

+135
-99
lines changed

Directory.Build.props

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<TargetFramework>net8.0</TargetFramework>
3+
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
44
<Nullable>enable</Nullable>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<DebugSymbols>true</DebugSymbols>
@@ -9,14 +9,12 @@
99
<ServerGarbageCollection>true</ServerGarbageCollection>
1010
<EmbedAllSources>true</EmbedAllSources>
1111
</PropertyGroup>
12-
1312
<ItemGroup>
14-
<PackageReference Include="DotNet.ReproducibleBuilds.Isolated" Version="1.2.4" PrivateAssets="All" />
13+
<PackageReference Include="DotNet.ReproducibleBuilds.Isolated" PrivateAssets="All" />
1514
</ItemGroup>
16-
1715
<ItemGroup>
1816
<Using Include="MessagePack" />
1917
<Using Include="System.Buffers" />
20-
<Using Include="Microsoft.AspNetCore.SignalR "/>
18+
<Using Include="Microsoft.AspNetCore.SignalR " />
2119
</ItemGroup>
22-
</Project>
20+
</Project>

Directory.Packages.props

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
5+
<NoWarn>$(NoWarn);NU1507</NoWarn>
6+
</PropertyGroup>
7+
<ItemGroup>
8+
<PackageVersion Include="coverlet.collector" Version="6.0.3" />
9+
<PackageVersion Include="DotNet.ReproducibleBuilds.Isolated" Version="1.2.25" />
10+
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.5.1" />
11+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
12+
<PackageVersion Include="NATS.Net" Version="2.5.5" />
13+
<PackageVersion Include="xunit" Version="2.9.3" />
14+
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.0" />
15+
<PackageVersion Include="Yarp.ReverseProxy" Version="2.2.0" />
16+
<PackageVersion Include="MessagePack" Version="3.0.300" />
17+
</ItemGroup>
18+
19+
<ItemGroup Condition="$(TargetFramework) == 'net8.0'">
20+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.11" />
21+
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.11" />
22+
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="8.0.11" />
23+
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Specification.Tests" Version="8.0.11" />
24+
<PackageVersion Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="8.0.11" />
25+
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.11" />
26+
</ItemGroup>
27+
28+
<ItemGroup Condition="$(TargetFramework) == 'net9.0'">
29+
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.0" />
30+
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Client" Version="9.0.0" />
31+
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="9.0.0" />
32+
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Specification.Tests" Version="9.0.0" />
33+
<PackageVersion Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="9.0.0" />
34+
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="9.0.0" />
35+
</ItemGroup>
36+
</Project>

Stebet.SignalR.NATS.sln

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio Version 17
3-
VisualStudioVersion = 17.5.002.0
3+
VisualStudioVersion = 17.5.2.0
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "perf", "perf", "{2BFA9A1E-AADB-4877-A424-CCCADA82994A}"
66
EndProject
@@ -16,9 +16,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stebet.SignalR.NATS.Tests",
1616
EndProject
1717
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "shared", "shared", "{C0569A8B-1F11-4CE5-B581-CA3F61CF0A00}"
1818
ProjectSection(SolutionItems) = preProject
19+
.editorconfig = .editorconfig
1920
Default.runsettings = Default.runsettings
2021
Directory.Build.props = Directory.Build.props
21-
.editorconfig = .editorconfig
22+
Directory.Packages.props = Directory.Packages.props
2223
README.md = README.md
2324
EndProjectSection
2425
EndProject
@@ -32,10 +33,6 @@ Global
3233
Release|Any CPU = Release|Any CPU
3334
EndGlobalSection
3435
GlobalSection(ProjectConfigurationPlatforms) = postSolution
35-
{709E9B6C-D8DF-4E7C-AB41-EA53D174B75C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
36-
{709E9B6C-D8DF-4E7C-AB41-EA53D174B75C}.Debug|Any CPU.Build.0 = Debug|Any CPU
37-
{709E9B6C-D8DF-4E7C-AB41-EA53D174B75C}.Release|Any CPU.ActiveCfg = Release|Any CPU
38-
{709E9B6C-D8DF-4E7C-AB41-EA53D174B75C}.Release|Any CPU.Build.0 = Release|Any CPU
3936
{C1A9A782-DD39-4801-A37A-52F82BA486F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4037
{C1A9A782-DD39-4801-A37A-52F82BA486F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
4138
{C1A9A782-DD39-4801-A37A-52F82BA486F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -48,6 +45,10 @@ Global
4845
{AFC39AD4-8C22-476B-BEFA-DADDA922C40C}.Debug|Any CPU.Build.0 = Debug|Any CPU
4946
{AFC39AD4-8C22-476B-BEFA-DADDA922C40C}.Release|Any CPU.ActiveCfg = Release|Any CPU
5047
{AFC39AD4-8C22-476B-BEFA-DADDA922C40C}.Release|Any CPU.Build.0 = Release|Any CPU
48+
{709E9B6C-D8DF-4E7C-AB41-EA53D174B75C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
49+
{709E9B6C-D8DF-4E7C-AB41-EA53D174B75C}.Debug|Any CPU.Build.0 = Debug|Any CPU
50+
{709E9B6C-D8DF-4E7C-AB41-EA53D174B75C}.Release|Any CPU.ActiveCfg = Release|Any CPU
51+
{709E9B6C-D8DF-4E7C-AB41-EA53D174B75C}.Release|Any CPU.Build.0 = Release|Any CPU
5152
{F66735A7-5D9E-4D52-9A00-2CDF10C9A654}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
5253
{F66735A7-5D9E-4D52-9A00-2CDF10C9A654}.Debug|Any CPU.Build.0 = Debug|Any CPU
5354
{F66735A7-5D9E-4D52-9A00-2CDF10C9A654}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -57,10 +58,10 @@ Global
5758
HideSolutionNode = FALSE
5859
EndGlobalSection
5960
GlobalSection(NestedProjects) = preSolution
60-
{709E9B6C-D8DF-4E7C-AB41-EA53D174B75C} = {2BFA9A1E-AADB-4877-A424-CCCADA82994A}
6161
{C1A9A782-DD39-4801-A37A-52F82BA486F1} = {2BFA9A1E-AADB-4877-A424-CCCADA82994A}
6262
{82C6A4A5-AFCE-48DB-882B-ECA9D8C62106} = {35AFA92E-9EC3-4459-9BF1-4572288435B8}
6363
{AFC39AD4-8C22-476B-BEFA-DADDA922C40C} = {9C5BECE8-B964-4B60-864E-F71CA436005E}
64+
{709E9B6C-D8DF-4E7C-AB41-EA53D174B75C} = {2BFA9A1E-AADB-4877-A424-CCCADA82994A}
6465
{F66735A7-5D9E-4D52-9A00-2CDF10C9A654} = {2BFA9A1E-AADB-4877-A424-CCCADA82994A}
6566
EndGlobalSection
6667
GlobalSection(ExtensibilityGlobals) = postSolution

perf/Stebet.SignalR.NATS.LoadTest/Program.cs

+13-16
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@
33
using Microsoft.AspNetCore.SignalR.Client;
44

55

6-
List<HubConnection> _connections = new();
6+
List<HubConnection> _connections = [];
77
string message = $"Hello World";
88
await InitializeAsync();
99
Console.WriteLine("Sending some messages as a warm-up");
10-
await Parallel.ForAsync(0L, 100000, new ParallelOptions { TaskScheduler = TaskScheduler.Default, MaxDegreeOfParallelism = 1024 }, async (_, _) =>
10+
await Parallel.ForAsync(0L, 100000, new ParallelOptions { TaskScheduler = TaskScheduler.Default, MaxDegreeOfParallelism = 1024 }, async (_, cancellationToken) =>
1111
{
1212
HubConnection conn1 = _connections[Random.Shared.Next(0, _connections.Count)];
1313
HubConnection conn2 = _connections[Random.Shared.Next(0, _connections.Count)];
14-
string response = await conn2.InvokeAsync<string>("SendToClient", message, conn1.ConnectionId);
14+
string response = await conn2.InvokeAsync<string>("SendToClient", message, conn1.ConnectionId, cancellationToken);
1515
});
1616

1717
var timer = Stopwatch.StartNew();
18-
using CancellationTokenSource cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
18+
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
1919
int responsesReceived = 0;
2020
Console.WriteLine("Starting invoke test");
2121
try
2222
{
23-
await Parallel.ForAsync(0L, Int64.MaxValue, new ParallelOptions { TaskScheduler = TaskScheduler.Default, MaxDegreeOfParallelism = 1024, CancellationToken = cts.Token }, async (_, _) =>
23+
await Parallel.ForAsync(0L, long.MaxValue, new ParallelOptions { TaskScheduler = TaskScheduler.Default, MaxDegreeOfParallelism = 1024, CancellationToken = cts.Token }, async (_, cancellationToken) =>
2424
{
2525
HubConnection conn1 = _connections[Random.Shared.Next(0, _connections.Count)];
2626
HubConnection conn2 = _connections[Random.Shared.Next(0, _connections.Count)];
27-
string response = await conn2.InvokeAsync<string>("SendToClient", message, conn1.ConnectionId);
27+
string response = await conn2.InvokeAsync<string>("SendToClient", message, conn1.ConnectionId, cancellationToken);
2828
responsesReceived++;
2929
});
3030
}
@@ -34,15 +34,15 @@
3434
}
3535

3636
timer = Stopwatch.StartNew();
37-
using CancellationTokenSource cts2 = new CancellationTokenSource(TimeSpan.FromSeconds(10));
37+
using var cts2 = new CancellationTokenSource(TimeSpan.FromSeconds(10));
3838
responsesReceived = 0;
3939
Console.WriteLine("Starting send all test");
4040
try
4141
{
42-
await Parallel.ForAsync(0L, Int64.MaxValue, new ParallelOptions { TaskScheduler = TaskScheduler.Default, MaxDegreeOfParallelism = 1024, CancellationToken = cts2.Token }, async (_, _) =>
42+
await Parallel.ForAsync(0L, long.MaxValue, new ParallelOptions { TaskScheduler = TaskScheduler.Default, MaxDegreeOfParallelism = 1024, CancellationToken = cts2.Token }, async (_, cancellationToken) =>
4343
{
4444
HubConnection conn1 = _connections[Random.Shared.Next(0, _connections.Count)];
45-
await conn1.InvokeAsync("SendToAllClients", message);
45+
await conn1.InvokeAsync("SendToAllClients", message, cancellationToken);
4646
responsesReceived++;
4747
});
4848
}
@@ -52,15 +52,15 @@
5252
}
5353

5454
timer = Stopwatch.StartNew();
55-
using CancellationTokenSource cts3 = new CancellationTokenSource(TimeSpan.FromSeconds(10));
55+
using var cts3 = new CancellationTokenSource(TimeSpan.FromSeconds(10));
5656
responsesReceived = 0;
5757
Console.WriteLine("Starting send others test");
5858
try
5959
{
60-
await Parallel.ForAsync(0L, Int64.MaxValue, new ParallelOptions { TaskScheduler = TaskScheduler.Default, MaxDegreeOfParallelism = 1024, CancellationToken = cts3.Token }, async (_, _) =>
60+
await Parallel.ForAsync(0L, long.MaxValue, new ParallelOptions { TaskScheduler = TaskScheduler.Default, MaxDegreeOfParallelism = 1024, CancellationToken = cts3.Token }, async (_, cancellationToken) =>
6161
{
6262
HubConnection conn1 = _connections[Random.Shared.Next(0, _connections.Count)];
63-
await conn1.InvokeAsync("SendToOthers", message);
63+
await conn1.InvokeAsync("SendToOthers", message, cancellationToken);
6464
responsesReceived++;
6565
});
6666
}
@@ -86,10 +86,7 @@ async Task InitializeAsync()
8686
for (int i = 0; i < 100; i++)
8787
{
8888
HubConnection conn = await GetConnection();
89-
conn.On<string, string, string>("Hello", (message, connectionId) =>
90-
{
91-
return $"{conn.ConnectionId} got {message} from {connectionId}";
92-
});
89+
conn.On<string, string, string>("Hello", (message, connectionId) => $"{conn.ConnectionId} got {message} from {connectionId}");
9390

9491
conn.On<string>("Send", (message) =>
9592
{
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
32
<PropertyGroup>
43
<OutputType>Exe</OutputType>
54
<IsPublishable>false</IsPublishable>
65
</PropertyGroup>
7-
86
<ItemGroup>
9-
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.6" />
7+
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" />
108
</ItemGroup>
11-
129
<ItemGroup>
1310
<ProjectReference Include="..\Stebet.SignalR.NATS.TestServer\Stebet.SignalR.NATS.TestServer.csproj" />
1411
</ItemGroup>
15-
1612
</Project>

perf/Stebet.SignalR.NATS.TestServer/EchoHub.cs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
namespace Stebet.SignalR.NATS.Tests
22
{
3-
public class EchoHub : Hub
3+
public class EchoHub() : Hub
44
{
5-
private readonly ILogger<EchoHub> _logger;
6-
7-
public EchoHub(ILogger<EchoHub> logger)
8-
{
9-
_logger = logger;
10-
}
115
public Task<string> Send(string message)
126
{
137
return Task.FromResult(message);

perf/Stebet.SignalR.NATS.TestServer/Stebet.SignalR.NATS.TestServer.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
<InternalsVisibleTo Include="Stebet.SignalR.NATS.Tests" />
99
</ItemGroup>
1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="8.0.6" />
11+
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" />
1212
</ItemGroup>
1313
<ItemGroup>
1414
<ProjectReference Include="..\..\src\Stebet.SignalR.NATS\Stebet.SignalR.NATS.csproj" />
1515
</ItemGroup>
16-
</Project>
16+
</Project>

perf/Stebet.SignalR.NATS.Yarp/Stebet.SignalR.NATS.Yarp.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
<ContainerBaseImage>mcr.microsoft.com/dotnet/aspnet:8.0-jammy-chiseled</ContainerBaseImage>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="Yarp.ReverseProxy" Version="2.1.0" />
8+
<PackageReference Include="Yarp.ReverseProxy" />
99
</ItemGroup>
10-
</Project>
10+
</Project>

src/Stebet.SignalR.NATS/ClientResultsManager.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public ClientResultsManager(IHubProtocolResolver hubProtocolResolver, IOptions<H
2121
var hubProtocols = new List<IHubProtocol>(supportedProtocols.Count);
2222
foreach (string protocolName in supportedProtocols)
2323
{
24-
IHubProtocol? protocol = hubProtocolResolver.GetProtocol(protocolName, (supportedProtocols as IReadOnlyList<string>) ?? supportedProtocols.ToList());
24+
IHubProtocol? protocol = hubProtocolResolver.GetProtocol(protocolName, (supportedProtocols as IReadOnlyList<string>) ?? [.. supportedProtocols]);
2525
if (protocol != null)
2626
{
2727
hubProtocols.Add(protocol);

src/Stebet.SignalR.NATS/IBufferWriterExtensions.cs

+16-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ internal static void WriteMessageWithExcludedConnectionIds(this IBufferWriter<by
1515
writer.Flush();
1616
}
1717

18-
internal static void WriteMessageWithInvocationId(this IBufferWriter<byte> bufferWriter, HubMessage message, IReadOnlyList<IHubProtocol> protocols, string invocationId)
18+
internal static void WriteMessageWithInvocationId(this IBufferWriter<byte> bufferWriter, InvocationMessage message, IReadOnlyList<IHubProtocol> protocols, string invocationId)
1919
{
2020
MessagePackWriter writer = new(bufferWriter);
2121
writer.Write(invocationId);
@@ -24,7 +24,7 @@ internal static void WriteMessageWithInvocationId(this IBufferWriter<byte> buffe
2424
writer.Flush();
2525
}
2626

27-
internal static void WriteMessageWithConnectionId(this IBufferWriter<byte> bufferWriter, HubMessage message, IReadOnlyList<IHubProtocol> protocols, string connectionId)
27+
internal static void WriteCompletionMessageWithConnectionId(this IBufferWriter<byte> bufferWriter, CompletionMessage message, IReadOnlyList<IHubProtocol> protocols, string connectionId)
2828
{
2929
MessagePackWriter writer = new(bufferWriter);
3030
writer.Write(connectionId);
@@ -33,6 +33,19 @@ internal static void WriteMessageWithConnectionId(this IBufferWriter<byte> buffe
3333
writer.Flush();
3434
}
3535

36+
internal static void WriteCompletionMessageWithConnectionId(this IBufferWriter<byte> bufferWriter, CompletionMessage message, IHubProtocol protocol, string connectionId)
37+
{
38+
MessagePackWriter writer = new(bufferWriter);
39+
writer.Write(connectionId);
40+
writer.WriteArrayHeader(1);
41+
using var tempBuffer = new NatsBufferWriter<byte>();
42+
protocol.WriteMessage(message, tempBuffer);
43+
writer.Write(protocol.Name);
44+
writer.WriteBinHeader(tempBuffer.WrittenCount);
45+
writer.WriteRaw(tempBuffer.WrittenMemory.Span);
46+
writer.Flush();
47+
}
48+
3649
internal static void WriteMessageWithExcludedConnectionIdsAndGroupName(this IBufferWriter<byte> bufferWriter, HubMessage message, IReadOnlyList<IHubProtocol> protocols, string groupName, IReadOnlyList<string> excludedConnectionIds)
3750
{
3851
ArgumentException.ThrowIfNullOrEmpty(groupName, nameof(groupName));
@@ -50,7 +63,7 @@ internal static void WriteMessage(this IBufferWriter<byte> bufferWriter, HubMess
5063
writer.WriteArrayHeader(protocols.Count);
5164
foreach (var protocol in protocols)
5265
{
53-
using NatsBufferWriter<byte> tempBuffer = new NatsBufferWriter<byte>();
66+
using var tempBuffer = new NatsBufferWriter<byte>();
5467
protocol.WriteMessage(message, tempBuffer);
5568
writer.Write(protocol.Name);
5669
writer.WriteBinHeader(tempBuffer.WrittenCount);

src/Stebet.SignalR.NATS/ISignalRBuilderExtensions.cs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Diagnostics.CodeAnalysis;
12
using System.Threading.Channels;
23

34
using Microsoft.Extensions.DependencyInjection;
@@ -11,8 +12,10 @@ namespace Microsoft.AspNetCore.SignalR;
1112

1213
public static class ISignalRBuilderExtensions
1314
{
15+
[RequiresUnreferencedCode("MessagePack does not support trimming currently.")]
1416
public static ISignalRServerBuilder AddNats(this ISignalRServerBuilder builder, string natsUrl, string natsSubjectPrefix = "signalr.nats")
1517
{
18+
builder.AddMessagePackProtocol();
1619
NatsSubject.Prefix = natsSubjectPrefix;
1720
builder.Services.AddKeyedSingleton<INatsConnectionPool>("Stebet.SignalR.NATS", (provider, key) =>
1821
{

src/Stebet.SignalR.NATS/NatsHubConnectionHandler.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ namespace Stebet.SignalR.NATS;
1010

1111
internal class NatsHubConnectionHandler<THub>(ILogger logger, HubConnectionContext connection, INatsConnection natsConnection, ClientResultsManager<THub> resultsManager) where THub : Hub
1212
{
13-
private readonly List<Task> _backgroundTasks = new();
14-
private readonly List<INatsSub<NatsMemoryOwner<byte>>> _subs = new();
15-
private readonly Dictionary<string, INatsSub<NatsMemoryOwner<byte>>> _groupSubs = new();
13+
private readonly List<Task> _backgroundTasks = [];
14+
private readonly List<INatsSub<NatsMemoryOwner<byte>>> _subs = [];
15+
private readonly Dictionary<string, INatsSub<NatsMemoryOwner<byte>>> _groupSubs = [];
1616

1717
public async Task StartConnectionHandler()
1818
{
@@ -179,7 +179,7 @@ private async Task SendInvocationMessage(NatsMsg<NatsMemoryOwner<byte>> message)
179179
{
180180
LoggerMessages.SendInvocationResult(logger, message.ReplyTo!);
181181
var buffer = new NatsBufferWriter<byte>();
182-
buffer.WriteMessageWithConnectionId(completionMessage, [connection.Protocol], connection.ConnectionId);
182+
buffer.WriteCompletionMessageWithConnectionId(completionMessage, connection.Protocol, connection.ConnectionId);
183183
await message.ReplyAsync(buffer).ConfigureAwait(false);
184184
}
185185
));

src/Stebet.SignalR.NATS/NatsHubLifetimeManager.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public override async Task SetConnectionResultAsync(string connectionId, Complet
241241
{
242242
LoggerMessages.SetResultForRemoteConnection(logger, connectionId);
243243
var bufferWriter = new NatsBufferWriter<byte>();
244-
bufferWriter.WriteMessageWithConnectionId(result, clientResultsManager.HubProtocols, connectionId);
244+
bufferWriter.WriteCompletionMessageWithConnectionId(result, clientResultsManager.HubProtocols, connectionId);
245245
await _natsConnection.RequestAsync<NatsBufferWriter<byte>, bool>(NatsSubject.InvokeResultSubject, bufferWriter).ConfigureAwait(false);
246246
}
247247
}

src/Stebet.SignalR.NATS/RemoteInvocationBinder.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
{
33
internal struct RemoteInvocationBinder<T> : IInvocationBinder
44
{
5-
public IReadOnlyList<Type> GetParameterTypes(string methodName) => throw new NotImplementedException();
6-
public Type GetReturnType(string invocationId) => typeof(T);
7-
public Type GetStreamItemType(string streamId) => throw new NotImplementedException();
5+
public readonly IReadOnlyList<Type> GetParameterTypes(string methodName) => throw new NotImplementedException();
6+
public readonly Type GetReturnType(string invocationId) => typeof(T);
7+
public readonly Type GetStreamItemType(string streamId) => throw new NotImplementedException();
88
}
99
}

0 commit comments

Comments
 (0)