Skip to content

Commit d7a9818

Browse files
committed
added SuperSocket.JsonRpc.Server
1 parent e4b01f7 commit d7a9818

File tree

3 files changed

+90
-1
lines changed

3 files changed

+90
-1
lines changed

SuperSocket.JsonRpc.sln

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Microsoft Visual Studio Solution File, Format Version 12.00
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
23
# Visual Studio Version 17
34
VisualStudioVersion = 17.5.2.0
45
MinimumVisualStudioVersion = 10.0.40219.1
@@ -12,24 +13,66 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{3F564080-1
1213
EndProject
1314
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperSocket.JsonRpc.Tests", "test\SuperSocket.JsonRpc.Tests\SuperSocket.JsonRpc.Tests.csproj", "{E7431221-CCC2-4CD1-9944-B75BAF29924C}"
1415
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperSocket.JsonRpc.Server", "src\SuperSocket.JsonRpc.Server\SuperSocket.JsonRpc.Server.csproj", "{35F6BF15-7389-47D8-9107-2FC2C976796D}"
17+
EndProject
1518
Global
1619
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1720
Debug|Any CPU = Debug|Any CPU
21+
Debug|x64 = Debug|x64
22+
Debug|x86 = Debug|x86
1823
Release|Any CPU = Release|Any CPU
24+
Release|x64 = Release|x64
25+
Release|x86 = Release|x86
1926
EndGlobalSection
2027
GlobalSection(ProjectConfigurationPlatforms) = postSolution
2128
{154DEE62-0F45-5FFE-7DA9-966EFE7C0584}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2229
{154DEE62-0F45-5FFE-7DA9-966EFE7C0584}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{154DEE62-0F45-5FFE-7DA9-966EFE7C0584}.Debug|x64.ActiveCfg = Debug|Any CPU
31+
{154DEE62-0F45-5FFE-7DA9-966EFE7C0584}.Debug|x64.Build.0 = Debug|Any CPU
32+
{154DEE62-0F45-5FFE-7DA9-966EFE7C0584}.Debug|x86.ActiveCfg = Debug|Any CPU
33+
{154DEE62-0F45-5FFE-7DA9-966EFE7C0584}.Debug|x86.Build.0 = Debug|Any CPU
2334
{154DEE62-0F45-5FFE-7DA9-966EFE7C0584}.Release|Any CPU.ActiveCfg = Release|Any CPU
2435
{154DEE62-0F45-5FFE-7DA9-966EFE7C0584}.Release|Any CPU.Build.0 = Release|Any CPU
36+
{154DEE62-0F45-5FFE-7DA9-966EFE7C0584}.Release|x64.ActiveCfg = Release|Any CPU
37+
{154DEE62-0F45-5FFE-7DA9-966EFE7C0584}.Release|x64.Build.0 = Release|Any CPU
38+
{154DEE62-0F45-5FFE-7DA9-966EFE7C0584}.Release|x86.ActiveCfg = Release|Any CPU
39+
{154DEE62-0F45-5FFE-7DA9-966EFE7C0584}.Release|x86.Build.0 = Release|Any CPU
2540
{A1B2C3D4-E5F6-7890-1234-567890ABCDEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2641
{A1B2C3D4-E5F6-7890-1234-567890ABCDEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
42+
{A1B2C3D4-E5F6-7890-1234-567890ABCDEF}.Debug|x64.ActiveCfg = Debug|Any CPU
43+
{A1B2C3D4-E5F6-7890-1234-567890ABCDEF}.Debug|x64.Build.0 = Debug|Any CPU
44+
{A1B2C3D4-E5F6-7890-1234-567890ABCDEF}.Debug|x86.ActiveCfg = Debug|Any CPU
45+
{A1B2C3D4-E5F6-7890-1234-567890ABCDEF}.Debug|x86.Build.0 = Debug|Any CPU
2746
{A1B2C3D4-E5F6-7890-1234-567890ABCDEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
2847
{A1B2C3D4-E5F6-7890-1234-567890ABCDEF}.Release|Any CPU.Build.0 = Release|Any CPU
48+
{A1B2C3D4-E5F6-7890-1234-567890ABCDEF}.Release|x64.ActiveCfg = Release|Any CPU
49+
{A1B2C3D4-E5F6-7890-1234-567890ABCDEF}.Release|x64.Build.0 = Release|Any CPU
50+
{A1B2C3D4-E5F6-7890-1234-567890ABCDEF}.Release|x86.ActiveCfg = Release|Any CPU
51+
{A1B2C3D4-E5F6-7890-1234-567890ABCDEF}.Release|x86.Build.0 = Release|Any CPU
2952
{E7431221-CCC2-4CD1-9944-B75BAF29924C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3053
{E7431221-CCC2-4CD1-9944-B75BAF29924C}.Debug|Any CPU.Build.0 = Debug|Any CPU
54+
{E7431221-CCC2-4CD1-9944-B75BAF29924C}.Debug|x64.ActiveCfg = Debug|Any CPU
55+
{E7431221-CCC2-4CD1-9944-B75BAF29924C}.Debug|x64.Build.0 = Debug|Any CPU
56+
{E7431221-CCC2-4CD1-9944-B75BAF29924C}.Debug|x86.ActiveCfg = Debug|Any CPU
57+
{E7431221-CCC2-4CD1-9944-B75BAF29924C}.Debug|x86.Build.0 = Debug|Any CPU
3158
{E7431221-CCC2-4CD1-9944-B75BAF29924C}.Release|Any CPU.ActiveCfg = Release|Any CPU
3259
{E7431221-CCC2-4CD1-9944-B75BAF29924C}.Release|Any CPU.Build.0 = Release|Any CPU
60+
{E7431221-CCC2-4CD1-9944-B75BAF29924C}.Release|x64.ActiveCfg = Release|Any CPU
61+
{E7431221-CCC2-4CD1-9944-B75BAF29924C}.Release|x64.Build.0 = Release|Any CPU
62+
{E7431221-CCC2-4CD1-9944-B75BAF29924C}.Release|x86.ActiveCfg = Release|Any CPU
63+
{E7431221-CCC2-4CD1-9944-B75BAF29924C}.Release|x86.Build.0 = Release|Any CPU
64+
{35F6BF15-7389-47D8-9107-2FC2C976796D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
65+
{35F6BF15-7389-47D8-9107-2FC2C976796D}.Debug|Any CPU.Build.0 = Debug|Any CPU
66+
{35F6BF15-7389-47D8-9107-2FC2C976796D}.Debug|x64.ActiveCfg = Debug|Any CPU
67+
{35F6BF15-7389-47D8-9107-2FC2C976796D}.Debug|x64.Build.0 = Debug|Any CPU
68+
{35F6BF15-7389-47D8-9107-2FC2C976796D}.Debug|x86.ActiveCfg = Debug|Any CPU
69+
{35F6BF15-7389-47D8-9107-2FC2C976796D}.Debug|x86.Build.0 = Debug|Any CPU
70+
{35F6BF15-7389-47D8-9107-2FC2C976796D}.Release|Any CPU.ActiveCfg = Release|Any CPU
71+
{35F6BF15-7389-47D8-9107-2FC2C976796D}.Release|Any CPU.Build.0 = Release|Any CPU
72+
{35F6BF15-7389-47D8-9107-2FC2C976796D}.Release|x64.ActiveCfg = Release|Any CPU
73+
{35F6BF15-7389-47D8-9107-2FC2C976796D}.Release|x64.Build.0 = Release|Any CPU
74+
{35F6BF15-7389-47D8-9107-2FC2C976796D}.Release|x86.ActiveCfg = Release|Any CPU
75+
{35F6BF15-7389-47D8-9107-2FC2C976796D}.Release|x86.Build.0 = Release|Any CPU
3376
EndGlobalSection
3477
GlobalSection(SolutionProperties) = preSolution
3578
HideSolutionNode = FALSE
@@ -38,6 +81,7 @@ Global
3881
{154DEE62-0F45-5FFE-7DA9-966EFE7C0584} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
3982
{A1B2C3D4-E5F6-7890-1234-567890ABCDEF} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
4083
{E7431221-CCC2-4CD1-9944-B75BAF29924C} = {3F564080-14C7-4AB9-AF77-D022045B9D1E}
84+
{35F6BF15-7389-47D8-9107-2FC2C976796D} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
4185
EndGlobalSection
4286
GlobalSection(ExtensibilityGlobals) = postSolution
4387
SolutionGuid = {2B6F5350-8CB6-4C7D-8F24-804C8F05A0A2}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using Microsoft.Extensions.DependencyInjection;
2+
using NRPC.Abstractions;
3+
using NRPC.Abstractions.Metadata;
4+
using NRPC.SuperSocket.Server;
5+
using SuperSocket.ProtoBase;
6+
using SuperSocket.Server.Abstractions.Host;
7+
8+
namespace SuperSocket.JsonRpc.Server;
9+
10+
public static class Extensions
11+
{
12+
public static ISuperSocketHostBuilder<JsonRpcRequest> UseJsonRpcServer<TServiceContract, TService>(this ISuperSocketHostBuilder<JsonRpcRequest> hostBuilder)
13+
where TServiceContract : class
14+
where TService : class, TServiceContract
15+
{
16+
return hostBuilder
17+
.UseNRPCService<JsonRpcRequest, JsonRpcResponse, TServiceContract, TService>()
18+
.UsePipelineFilter<JsonRpcRequestPipelineFilter>()
19+
.UsePackageDecoder<JsonRpcRequestDecoder>()
20+
.ConfigureServices((ctx, services) =>
21+
{
22+
services.AddSingleton<IPackageEncoder<JsonRpcResponse>, JsonRpcResponseEncoder>();
23+
services.AddSingleton<JsonRpcResponseDecoder>();
24+
services.AddSingleton<IExpressionConverter, JsonElementExpressionConverter>();
25+
services.AddSingleton<IRpcCallingAdapter, JsonRpcCallerAdapter>();
26+
});
27+
}
28+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<ImplicitUsings>enable</ImplicitUsings>
5+
<Nullable>enable</Nullable>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="NRPC.SuperSocket.Server" />
10+
<PackageReference Include="SuperSocket.Server.Abstractions" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<ProjectReference Include="../SuperSocket.JsonRpc/SuperSocket.JsonRpc.csproj" />
15+
</ItemGroup>
16+
17+
</Project>

0 commit comments

Comments
 (0)