Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8d589ee
Update Actions to use dotnet build (#1663)
vicancy Sep 6, 2022
e1d3c6c
Add configurable options (#1654)
vicancy Sep 6, 2022
cc356c1
Update CI to enable net7.0 preview builds (#1677)
JialinXin Sep 7, 2022
1bfba7d
Fix build warnings and add net6 samples (#1676)
vicancy Sep 7, 2022
743ad57
Fix vlunerability issue (#1678)
vicancy Sep 7, 2022
02d169f
Update use-signalr-service.md (#1683)
kevinguo-ed Sep 20, 2022
8882dfc
Change emulator to net6.0 (#1682)
vicancy Sep 20, 2022
eb8575f
Add filter property...... (#1686)
vicancy Sep 23, 2022
84f2d69
Update management-sdk-guide.md (#1689)
Y-Sindo Sep 27, 2022
e99d04c
Expose InstanceId in ClientConnectionContext (#1692)
xingsy97 Sep 28, 2022
19bfa54
Fix `HubConnectionContext.UserIdentifier` is null when negotiation wi…
Y-Sindo Sep 29, 2022
724624c
Add ClientInvocationManager (#1684)
xingsy97 Oct 14, 2022
6e8b50b
update CallerClientResultsManager (#1697)
xingsy97 Oct 14, 2022
60c3266
Implement close on client authentication expiration (#1699)
Y-Sindo Oct 20, 2022
6671bef
Add spec for client-invocation. (#1701)
JialinXin Oct 24, 2022
c959735
Add client Invocation implementation and UTs (#1687)
xingsy97 Oct 24, 2022
34314d1
[ClientInvocation] Fix cleanup in caller case. (#1702)
JialinXin Oct 26, 2022
5826b42
Add ClientResultSample (#1703)
JialinXin Oct 26, 2022
b2670fe
Fix proxy not applied to serverless transient mode (#1708)
Y-Sindo Nov 7, 2022
1c4a20b
silent IDE0090 check (#1709)
terencefan Nov 7, 2022
8dc02bb
reduce retry interval when auth failed (#1451)
terencefan Nov 8, 2022
d97fea3
Clean up dependencies. (#1711)
JialinXin Nov 8, 2022
5eee228
Merge remote-tracking branch 'origin/dev' into v1.19.0
JialinXin Nov 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,6 @@ dotnet_diagnostic.IDE0058.severity = none

# IDE0022: Use block body for methods
dotnet_diagnostic.IDE0022.severity = none

# IDE0090: Use 'new(...)'
dotnet_diagnostic.IDE0090.severity = silent
30 changes: 24 additions & 6 deletions .github/workflows/osx.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: Gated-OSX
on:
on:
push:
branches:
- disable
- master
- dev
pull_request:
branches:
- master
- dev
jobs:
build_osx:
runs-on: macOS-latest
Expand All @@ -15,17 +20,30 @@ jobs:
src:
- 'src/**'
- 'test/**'
- 'build/**'
- 'samples/**'
- '*.cmd'
- '*.ps1'
- '*.props'
- '*.targets'
- '**.props'
- '**.csproj'
- '**.targets'
- '*.sh'
- '*.sln'

- name: Update SubModules
if: steps.filter.outputs.src == 'true'
run: git submodule update --init --recursive

- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
7.0.x
6.0.x
5.0.x
include-prerelease: true
- name: Build with dotnet
run: "dotnet build AzureSignalR.sln /p:DisableNet461Tests=true"
if: steps.filter.outputs.src == 'true'
- name: Test
run: "dotnet test --no-build"
if: steps.filter.outputs.src == 'true'
run: "./build.sh --ci /p:DisableNet461Tests=true"
20 changes: 17 additions & 3 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,29 @@ jobs:
src:
- 'src/**'
- 'test/**'
- 'build/**'
- 'samples/**'
- '*.cmd'
- '*.ps1'
- '*.props'
- '*.targets'
- '**.props'
- '**.csproj'
- '**.targets'
- '*.sh'
- '*.sln'
- name: Update SubModules
run: git submodule update --init --recursive
if: steps.filter.outputs.src == 'true'
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
7.0.x
6.0.x
5.0.x
include-prerelease: true
- name: Build with dotnet
run: "./build.sh --ci /p:DisableNet461Tests=true"
run: "dotnet build AzureSignalR.sln /p:DisableNet461Tests=true"
if: steps.filter.outputs.src == 'true'
- name: Test
run: "dotnet test --no-build"
if: steps.filter.outputs.src == 'true'
21 changes: 16 additions & 5 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,28 @@ jobs:
src:
- 'src/**'
- 'test/**'
- 'build/**'
- 'samples/**'
- '*.cmd'
- '*.ps1'
- '*.props'
- '*.targets'
- '**.props'
- '**.csproj'
- '**.targets'
- '*.sh'
- '*.sln'
- name: Update SubModules
run: git submodule update --init --recursive
if: steps.filter.outputs.src == 'true'

- name: Build with dotnet
shell: powershell
run: .\run.ps1 default-build
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
7.0.x
6.0.x
5.0.x
include-prerelease: true

- name: Test
run: dotnet test
if: steps.filter.outputs.src == 'true'
14 changes: 14 additions & 0 deletions AzureSignalR.sln
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.SignalR.Ser
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.SignalR.Serverless.Protocols.Tests", "test\Microsoft.Azure.SignalR.Serverless.Protocols.Tests\Microsoft.Azure.SignalR.Serverless.Protocols.Tests.csproj", "{82C1FF3D-EC6C-4B21-B6A4-E69E8D75D0D0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChatSample.Net60", "samples\ChatSample\ChatSample.Net60\ChatSample.Net60.csproj", "{594EC59A-7305-4A36-8BE6-4A928FBFD71B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChatSample.Net70", "samples\ChatSample\ChatSample.Net70\ChatSample.Net70.csproj", "{49634EE4-A0F4-4672-A8B3-B994CF81C9AB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -184,6 +188,14 @@ Global
{82C1FF3D-EC6C-4B21-B6A4-E69E8D75D0D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{82C1FF3D-EC6C-4B21-B6A4-E69E8D75D0D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{82C1FF3D-EC6C-4B21-B6A4-E69E8D75D0D0}.Release|Any CPU.Build.0 = Release|Any CPU
{594EC59A-7305-4A36-8BE6-4A928FBFD71B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{594EC59A-7305-4A36-8BE6-4A928FBFD71B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{594EC59A-7305-4A36-8BE6-4A928FBFD71B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{594EC59A-7305-4A36-8BE6-4A928FBFD71B}.Release|Any CPU.Build.0 = Release|Any CPU
{49634EE4-A0F4-4672-A8B3-B994CF81C9AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{49634EE4-A0F4-4672-A8B3-B994CF81C9AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{49634EE4-A0F4-4672-A8B3-B994CF81C9AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{49634EE4-A0F4-4672-A8B3-B994CF81C9AB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -216,6 +228,8 @@ Global
{870A10E3-D17A-4239-9715-5610FFE1FC76} = {2429FBD8-1FCE-4C42-AA28-DF32F7249E77}
{52944A80-44A9-48D4-919D-11AAAD55193E} = {DA69F624-5398-4884-87E4-B816698CDE65}
{82C1FF3D-EC6C-4B21-B6A4-E69E8D75D0D0} = {2429FBD8-1FCE-4C42-AA28-DF32F7249E77}
{594EC59A-7305-4A36-8BE6-4A928FBFD71B} = {C965ED06-6A17-4329-B3C6-811830F4F4ED}
{49634EE4-A0F4-4672-A8B3-B994CF81C9AB} = {C965ED06-6A17-4329-B3C6-811830F4F4ED}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7945A4E4-ACDB-4F6E-95CA-6AC6E7C2CD59}
Expand Down
2 changes: 0 additions & 2 deletions build.cmd

This file was deleted.

8 changes: 0 additions & 8 deletions build.sh

This file was deleted.

9 changes: 3 additions & 6 deletions build/dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
</PropertyGroup>
<PropertyGroup Label="Package Versions">
<!-- Azure ASP.NET Core SignalR -->
<MicrosoftAspNetCoreHttpConnectionsClientPackageVersion>1.0.0</MicrosoftAspNetCoreHttpConnectionsClientPackageVersion>
<MicrosoftAspNetCoreHttpConnectionsClientPackage3_0Version>3.0.0</MicrosoftAspNetCoreHttpConnectionsClientPackage3_0Version>
<MicrosoftAspNetCoreHttpConnectionsClientPackage3_1Version>3.1.9</MicrosoftAspNetCoreHttpConnectionsClientPackage3_1Version>
<MicrosoftAspNetCoreHttpConnectionsClientPackage5_0Version>5.0.1</MicrosoftAspNetCoreHttpConnectionsClientPackage5_0Version>
<MicrosoftAspNetCoreHttpConnectionsCommonPackageVersion>1.0.4</MicrosoftAspNetCoreHttpConnectionsCommonPackageVersion>
<MicrosoftAspNetCoreHttpConnectionsCommonPackage3_0Version>3.0.0</MicrosoftAspNetCoreHttpConnectionsCommonPackage3_0Version>
<MicrosoftAspNetCoreHttpConnectionsCommonPackage3_1Version>3.1.9</MicrosoftAspNetCoreHttpConnectionsCommonPackage3_1Version>
Expand Down Expand Up @@ -61,7 +57,7 @@
<MicrosoftExtensionsHostingVersion>2.1.0</MicrosoftExtensionsHostingVersion>

<!-- SignalR Serverless Protocols-->
<NewtonsoftJsonPackageVersion>12.0.2</NewtonsoftJsonPackageVersion>
<NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>

<!-- Signing -->
<MicrosoftVisualStudioEngMicroBuildCoreVersion>1.0.0</MicrosoftVisualStudioEngMicroBuildCoreVersion>
Expand All @@ -77,9 +73,10 @@
<!--Emulator -->
<MicrosoftExtensionsCommandLineUtilsPackageVersion>1.1.1</MicrosoftExtensionsCommandLineUtilsPackageVersion>
<SystemIOPipelinesPackageForEmulatorVersion>4.7.5</SystemIOPipelinesPackageForEmulatorVersion>
<EmulatorMicrosoftPackageVersion>3.1.24</EmulatorMicrosoftPackageVersion>
<EmulatorMicrosoftPackageVersion>6.0.9</EmulatorMicrosoftPackageVersion>

<!--Testing -->
<MicrosoftAspNetCoreHttpConnectionsClientPackageVersion>1.0.0</MicrosoftAspNetCoreHttpConnectionsClientPackageVersion>
<MessagePackPackage3_1Version>1.9.11</MessagePackPackage3_1Version>
<MicrosoftAspNetCoreSignalRProtocolsMessagePackPackageVersion>3.1.24</MicrosoftAspNetCoreSignalRProtocolsMessagePackPackageVersion>
<MicrosoftNETTestSdkPackageVersion>15.6.1</MicrosoftNETTestSdkPackageVersion>
Expand Down
32 changes: 6 additions & 26 deletions docs/build-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Building Azure SignalR Service SDK from source allows you tweak and customize th

Building Azure SignalR Service SDK requires:

* Latest Visual Studio. <https://visualstudio.com>
* Latest Visual Studio (include pre-release). <https://visualstudio.com>
* Git. <https://git-scm.org>
* AspNetCore 3.0 SDK (Version >= 3.0.0). <https://dotnet.microsoft.com/download/dotnet-core/3.0>
* .NET SDK (Version >= 7.0.0-preview.7). <https://dotnet.microsoft.com/download/dotnet>

## Clone the source code

Expand All @@ -25,34 +25,14 @@ git submodule update --init --recursive

## Building on command-line

You can build the entire project on command line with the `build.cmd`/`.sh` scripts.
You can build the entire project on command line with the [`dotnet` command](https://docs.microsoft.com/dotnet/core/tools/dotnet). Run command below in the repo's root folder.

On Windows:
```
.\build.cmd
```

On macOS/Linux:
```
./build.sh
dotnet build
```

## Building in Visual Studio

Before opening our .sln files in Visual Studio or VS Code, it is suggested to run `.\build.cmd` to make sure all the dependencies are restored correctly.

The solution file is **AzureSignalR.sln** in the root.

## Build properties

Additional properties can be added as an argument in the form `/property:$name=$value`, or `/p:$name=$value` for short. For example:
```
.\build.cmd /p:Configuration=Release
```

Common properties include:
Before opening our .sln files in Visual Studio or VS Code, it is suggested to run `dotnet restore` to make sure all the dependencies are restored correctly.

Property | Description
-------------------------|-------------------------------------------------------------------------------------------------------------
BuildNumber | (string). A specific build number, typically from a CI counter, which is appended to the preview1 label.
Configuration | `Debug` or `Release`. Default = `Debug`.
The solution file is **AzureSignalR.sln** in the root.
6 changes: 2 additions & 4 deletions docs/management-sdk-guide.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Azure SignalR Service Management SDK

> **NOTE**
>
> Azure SignalR Service only supports this SDK for ASP.NET CORE SignalR clients.
This SDK is for ASP.NET **Core** SignalR. For differences between ASP.NET SignalR and ASP.NET Core SignalR, see [here](https://learn.microsoft.com/aspnet/core/signalr/version-differences?view=aspnetcore-6.0).

## Build Status

Expand Down Expand Up @@ -190,4 +188,4 @@ This SDK can communicates to Azure SignalR Service with two transport types:


### Next steps
* [Customizing Json Serialization in Management SDK](./advanced-topics/json-object-serializer.md)
* [Customizing Json Serialization in Management SDK](./advanced-topics/json-object-serializer.md)
15 changes: 10 additions & 5 deletions docs/run-asp-net-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- [2. Configure Connection String](#2-configure-connection-string)
- [3. Configure Service Options](#3-configure-service-options)
- [`ConnectionString`](#connectionstring)
- [`ConnectionCount`](#connectioncount)
- [`InitialHubServerConnectionCount`](#initialhubserverconnectioncount)
- [`ApplicationName`](#applicationname)
- [`ClaimsProvider`](#claimsprovider)
- [`AccessTokenLifetime`](#accesstokenlifetime)
Expand All @@ -23,7 +23,7 @@
Run below command to install SignalR Service SDK to your ASP&#46;NET Core project.

```bash
dotnet add package Microsoft.Azure.SignalR --version 1.0.*
dotnet add package Microsoft.Azure.SignalR
```

In your `Startup` class, use SignalR Service SDK as the following code snippet.
Expand All @@ -37,7 +37,7 @@ public void ConfigureServices(IServiceCollection services)

public void Configure(IApplicationBuilder app)
{
app.UseAzureSignalR(routes =>
app.UseEndpoints(routes =>
{
routes.MapHub<YourHubClass>("/path_for_your_hub");
});
Expand Down Expand Up @@ -73,11 +73,16 @@ There are a few options you can customize when using Azure SignalR Service SDK.
- Default value is the `Azure:SignalR:ConnectionString` `connectionString` or `appSetting` in `web.config` file.
- It can be reconfigured, but please make sure the value is **NOT** hard coded.

### `ConnectionCount`
### `InitialHubServerConnectionCount`

- Default value is `5`.
- This option controls the initial count of connections per hub between application server and Azure SignalR Service. Usually keep it as the default value is enough. During runtime, the SDK might start new server connections for performance tuning or load balancing. When you have big number of clients, you can give it a larger number for better throughput. For example, if you have 100,000 clients in total, the connection count can be increased to `10` or `15`.

### `MaxHubServerConnectionCount`

- Default value is `null`.
- This option controls the max count of connections allowed per hub between application server and Azure SignalR Service. During runtime, the SDK might start new server connections for performance tuning or load balancing. By default a new server connection starts whenever needed. When the max allowed server connection count is configured, the SDK does not start new connections when server connection count reaches the limit.

### `ApplicationName`

- Default value is `null`.
Expand Down Expand Up @@ -150,7 +155,7 @@ You can configure above options like the following sample code.
services.AddSignalR()
.AddAzureSignalR(options =>
{
options.ConnectionCount = 10;
options.InitialHubServerConnectionCount = 10;
options.AccessTokenLifetime = TimeSpan.FromDays(1);
options.ClaimsProvider = context => context.User.Claims;

Expand Down
11 changes: 8 additions & 3 deletions docs/run-asp-net.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- [2. Configure Connection String](#2-configure-connection-string)
- [3. Configure Service Options](#3-configure-service-options)
- [`ConnectionString`](#connectionstring)
- [`ConnectionCount`](#connectioncount)
- [`InitialHubServerConnectionCount`](#initialhubserverconnectioncount)
- [`ApplicationName`](#applicationname)
- [`ClaimProvider`](#claimprovider)
- [`AccessTokenLifetime`](#accesstokenlifetime)
Expand Down Expand Up @@ -55,11 +55,16 @@ There are a few [options](https://github.com/Azure/azure-signalr/blob/dev/src/Mi
- Default value is the `Azure:SignalR:ConnectionString` `connectionString` or `appSetting` in `web.config` file.
- It can be reconfigured, but please make sure the value is **NOT** hard coded.

### `ConnectionCount`
### `InitialHubServerConnectionCount`

- Default value is `5`.
- This option controls the initial count of connections per hub between application server and Azure SignalR Service. Usually keep it as the default value is enough. During runtime, the SDK might start new server connections for performance tuning or load balancing. When you have big number of clients, you can give it a larger number for better throughput. For example, if you have 100,000 clients in total, the connection count can be increased to `10` or `15`.

### `MaxHubServerConnectionCount`

- Default value is `null`.
- This option controls the max count of connections allowed per hub between application server and Azure SignalR Service. During runtime, the SDK might start new server connections for performance tuning or load balancing. By default a new server connection starts whenever needed. When the max allowed server connection count is configured, the SDK does not start new connections when server connection count reaches the limit.

### `ApplicationName`

- Default value is `null`.
Expand Down Expand Up @@ -104,7 +109,7 @@ You can configure above options like the following sample code.
```csharp
app.Map("/signalr",subApp => subApp.RunAzureSignalR(this.GetType().FullName, new HubConfiguration(), options =>
{
options.ConnectionCount = 1;
options.InitialHubServerConnectionCount = 1;
options.AccessTokenLifetime = TimeSpan.FromDays(1);
options.ClaimProvider = context => context.Authentication?.User.Claims;
}));
Expand Down
9 changes: 3 additions & 6 deletions docs/use-signalr-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@ Go to [Azure Portal](https://portal.azure.com) to provision a SignalR service in

## Scale Out Application Server

With Azure SignalR Service, persistent connections are offloaded from application server.
It only has to take care of business logics in your hub classes.
With Azure SignalR Service, persistent connections are offloaded from application server so that you can focus on implementing your business logic in hub classes.
But you still need to scale out application servers for better performance when handling massive client connections.
Below are a few tips for scaling out application servers.

- Multiple application servers can connect to the same Azure SignalR Service instance.
- As long as name of the hub class is the same, connections from different application servers are grouped in the same hub.
- Each client connection will only be created in **one** of the application servers, and messages from that client will only be sent to the same application server.
- If you want to access client information globally (from all application servers), you have to use some storage to save client information from all application servers.
- As long as the name of the hub class is the same, connections from different application servers are grouped in the same hub.
- Each client connection will only be created in ***one*** of the application servers, and messages from that client will only be sent to that same application server. If you want to access client information globally *(from all application servers)*, you have to use some centralized storage to save client information from all application servers.
2 changes: 0 additions & 2 deletions korebuild-lock.txt

This file was deleted.

4 changes: 0 additions & 4 deletions korebuild.json

This file was deleted.

Loading