Added Microsoft.AspNetCore.SignalR.Protocols.Json (#1861)
- Fixed package descriptions - Call AddJsonProtocol from both the SignalR.Core (client and server)
This commit is contained in:
parent
e9db9e64c7
commit
61c3d0c403
|
|
@ -1,4 +1,4 @@
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 15
|
# Visual Studio 15
|
||||||
VisualStudioVersion = 15.0.27110.0
|
VisualStudioVersion = 15.0.27110.0
|
||||||
MinimumVisualStudioVersion = 15.0.26730.03
|
MinimumVisualStudioVersion = 15.0.26730.03
|
||||||
|
|
@ -85,6 +85,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionalTests", "clients\
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkServer", "benchmarks\BenchmarkServer\BenchmarkServer.csproj", "{B5286020-C218-443C-91A9-B65751FB9B29}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchmarkServer", "benchmarks\BenchmarkServer\BenchmarkServer.csproj", "{B5286020-C218-443C-91A9-B65751FB9B29}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.SignalR.Protocols.Json", "src\Microsoft.AspNetCore.SignalR.Protocols.Json\Microsoft.AspNetCore.SignalR.Protocols.Json.csproj", "{896FA5EE-63A5-4EAC-9F09-346584BB4830}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
|
@ -199,6 +201,10 @@ Global
|
||||||
{B5286020-C218-443C-91A9-B65751FB9B29}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{B5286020-C218-443C-91A9-B65751FB9B29}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{B5286020-C218-443C-91A9-B65751FB9B29}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{B5286020-C218-443C-91A9-B65751FB9B29}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{B5286020-C218-443C-91A9-B65751FB9B29}.Release|Any CPU.Build.0 = Release|Any CPU
|
{B5286020-C218-443C-91A9-B65751FB9B29}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{896FA5EE-63A5-4EAC-9F09-346584BB4830}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{896FA5EE-63A5-4EAC-9F09-346584BB4830}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{896FA5EE-63A5-4EAC-9F09-346584BB4830}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{896FA5EE-63A5-4EAC-9F09-346584BB4830}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
@ -231,6 +237,7 @@ Global
|
||||||
{55DB4B6F-12E5-4A27-97F4-E97E135470FF} = {DA69F624-5398-4884-87E4-B816698CDE65}
|
{55DB4B6F-12E5-4A27-97F4-E97E135470FF} = {DA69F624-5398-4884-87E4-B816698CDE65}
|
||||||
{D0C7B22E-B0B6-4D62-BF7D-79EE4AAF1981} = {3A76C5A2-79ED-49BC-8BDC-6A3A766FFA1B}
|
{D0C7B22E-B0B6-4D62-BF7D-79EE4AAF1981} = {3A76C5A2-79ED-49BC-8BDC-6A3A766FFA1B}
|
||||||
{B5286020-C218-443C-91A9-B65751FB9B29} = {8A4582C8-DC59-4B61-BCE7-119FBAA99EFB}
|
{B5286020-C218-443C-91A9-B65751FB9B29} = {8A4582C8-DC59-4B61-BCE7-119FBAA99EFB}
|
||||||
|
{896FA5EE-63A5-4EAC-9F09-346584BB4830} = {DA69F624-5398-4884-87E4-B816698CDE65}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {7945A4E4-ACDB-4F6E-95CA-6AC6E7C2CD59}
|
SolutionGuid = {7945A4E4-ACDB-4F6E-95CA-6AC6E7C2CD59}
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ namespace Microsoft.AspNetCore.SignalR.Client
|
||||||
{
|
{
|
||||||
Services = new ServiceCollection();
|
Services = new ServiceCollection();
|
||||||
Services.AddSingleton<ILoggerFactory>(NullLoggerFactory.Instance);
|
Services.AddSingleton<ILoggerFactory>(NullLoggerFactory.Instance);
|
||||||
Services.AddSingleton<IHubProtocol, JsonHubProtocol>();
|
|
||||||
Services.AddSingleton<HubConnection>();
|
Services.AddSingleton<HubConnection>();
|
||||||
|
this.AddJsonProtocol();
|
||||||
}
|
}
|
||||||
|
|
||||||
public HubConnection Build()
|
public HubConnection Build()
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Microsoft.AspNetCore.SignalR.Common\Microsoft.AspNetCore.SignalR.Common.csproj" />
|
<ProjectReference Include="..\Microsoft.AspNetCore.SignalR.Common\Microsoft.AspNetCore.SignalR.Common.csproj" />
|
||||||
|
<ProjectReference Include="..\Microsoft.AspNetCore.SignalR.Protocols.Json\Microsoft.AspNetCore.SignalR.Protocols.Json.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@ using System.IO;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.SignalR.Internal.Protocol
|
namespace Microsoft.AspNetCore.SignalR.Internal
|
||||||
{
|
{
|
||||||
internal class Utf8BufferTextReader : TextReader
|
public class Utf8BufferTextReader : TextReader
|
||||||
{
|
{
|
||||||
private readonly Decoder _decoder;
|
private readonly Decoder _decoder;
|
||||||
private ReadOnlySequence<byte> _utf8Buffer;
|
private ReadOnlySequence<byte> _utf8Buffer;
|
||||||
|
|
@ -9,9 +9,9 @@ using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.SignalR.Internal.Protocol
|
namespace Microsoft.AspNetCore.SignalR.Internal
|
||||||
{
|
{
|
||||||
internal sealed class Utf8BufferTextWriter : TextWriter
|
public sealed class Utf8BufferTextWriter : TextWriter
|
||||||
{
|
{
|
||||||
private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
|
private static readonly UTF8Encoding _utf8NoBom = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);
|
||||||
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Microsoft.AspNetCore.SignalR.Common\Microsoft.AspNetCore.SignalR.Common.csproj" />
|
<ProjectReference Include="..\Microsoft.AspNetCore.SignalR.Common\Microsoft.AspNetCore.SignalR.Common.csproj" />
|
||||||
|
<ProjectReference Include="..\Microsoft.AspNetCore.SignalR.Protocols.Json\Microsoft.AspNetCore.SignalR.Protocols.Json.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
@ -17,7 +18,6 @@
|
||||||
<PackageReference Include="Microsoft.Extensions.ClosedGenericMatcher.Sources" PrivateAssets="All" Version="$(MicrosoftExtensionsClosedGenericMatcherSourcesPackageVersion)" />
|
<PackageReference Include="Microsoft.Extensions.ClosedGenericMatcher.Sources" PrivateAssets="All" Version="$(MicrosoftExtensionsClosedGenericMatcherSourcesPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.Extensions.ObjectMethodExecutor.Sources" PrivateAssets="All" Version="$(MicrosoftExtensionsObjectMethodExecutorSourcesPackageVersion)" />
|
<PackageReference Include="Microsoft.Extensions.ObjectMethodExecutor.Sources" PrivateAssets="All" Version="$(MicrosoftExtensionsObjectMethodExecutorSourcesPackageVersion)" />
|
||||||
<PackageReference Include="System.Reflection.Emit" Version="$(SystemReflectionEmitPackageVersion)" />
|
<PackageReference Include="System.Reflection.Emit" Version="$(SystemReflectionEmitPackageVersion)" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
|
|
||||||
<PackageReference Include="System.Threading.Channels" Version="$(SystemThreadingChannelsPackageVersion)" />
|
<PackageReference Include="System.Threading.Channels" Version="$(SystemThreadingChannelsPackageVersion)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,11 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
services.AddSingleton(typeof(IUserIdProvider), typeof(DefaultUserIdProvider));
|
services.AddSingleton(typeof(IUserIdProvider), typeof(DefaultUserIdProvider));
|
||||||
services.AddSingleton(typeof(HubDispatcher<>), typeof(DefaultHubDispatcher<>));
|
services.AddSingleton(typeof(HubDispatcher<>), typeof(DefaultHubDispatcher<>));
|
||||||
services.AddScoped(typeof(IHubActivator<>), typeof(DefaultHubActivator<>));
|
services.AddScoped(typeof(IHubActivator<>), typeof(DefaultHubActivator<>));
|
||||||
|
|
||||||
services.AddAuthorization();
|
services.AddAuthorization();
|
||||||
|
|
||||||
return new SignalRServerBuilder(services);
|
var builder = new SignalRServerBuilder(services);
|
||||||
|
builder.AddJsonProtocol();
|
||||||
|
return builder;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<Description>Implements the SignalR Hub Protocol over JSON.</Description>
|
||||||
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
|
<RootNamespace>Microsoft.AspNetCore.SignalR</RootNamespace>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="..\Common\JsonUtils.cs" Link="Internal\JsonUtils.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Microsoft.AspNetCore.SignalR.Common\Microsoft.AspNetCore.SignalR.Common.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
@ -1,11 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Description>
|
<Description>Implements the SignalR Hub Protocol over MsgPack.</Description>
|
||||||
Implements the SignalR Hub Protocol over MsgPack. This package provides internal infrastructure.
|
|
||||||
To use MsgPack, use the Microsoft.AspNetCore.SignalR.Client.MsgPack (for the Client) or
|
|
||||||
Microsoft.AspNetCore.SignalR.MsgPack (for the Server) packages.
|
|
||||||
</Description>
|
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<RootNamespace>Microsoft.AspNetCore.SignalR</RootNamespace>
|
<RootNamespace>Microsoft.AspNetCore.SignalR</RootNamespace>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
services.AddConnections();
|
services.AddConnections();
|
||||||
services.AddSingleton<SignalRMarkerService>();
|
services.AddSingleton<SignalRMarkerService>();
|
||||||
services.AddSingleton<IConfigureOptions<HubOptions>, HubOptionsSetup>();
|
services.AddSingleton<IConfigureOptions<HubOptions>, HubOptionsSetup>();
|
||||||
return services.AddSignalRCore()
|
return services.AddSignalRCore();
|
||||||
.AddJsonProtocol();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ISignalRServerBuilder AddSignalR(this IServiceCollection services, Action<HubOptions> options)
|
public static ISignalRServerBuilder AddSignalR(this IServiceCollection services, Action<HubOptions> options)
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ using System;
|
||||||
using System.Buffers;
|
using System.Buffers;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Microsoft.AspNetCore.SignalR.Internal.Protocol;
|
using Microsoft.AspNetCore.SignalR.Internal;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.SignalR.Common.Tests.Internal.Protocol
|
namespace Microsoft.AspNetCore.SignalR.Common.Tests.Internal.Protocol
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ using System;
|
||||||
using System.Buffers;
|
using System.Buffers;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Microsoft.AspNetCore.SignalR.Internal.Protocol;
|
using Microsoft.AspNetCore.SignalR.Internal;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.SignalR.Common.Tests.Internal.Protocol
|
namespace Microsoft.AspNetCore.SignalR.Common.Tests.Internal.Protocol
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue