Skip to content

Commit 6d981a8

Browse files
Merge pull request #271008 from Y-Sindo/patch-4
Update signalr-howto-use.md
2 parents d896d45 + 31e45d3 commit 6d981a8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

articles/azure-signalr/signalr-howto-use.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to use Azure SignalR Service in your app server
44
author: vicancy
55
ms.service: signalr
66
ms.topic: how-to
7-
ms.date: 12/18/2023
7+
ms.date: 04/18/2024
88
ms.author: lianwei
99
---
1010

@@ -148,6 +148,12 @@ You can increase this value to avoid client disconnect.
148148
- This option defines the max poll interval allowed for `LongPolling` connections in Azure SignalR Service. If the next poll request doesn't come in within `MaxPollIntervalInSeconds`, Azure SignalR Service cleans up the client connection. Note that Azure SignalR Service also cleans up connections when cached waiting to write buffer size is greater than `1Mb` to ensure service performance.
149149
- The value is limited to `[1, 300]`.
150150

151+
#### `TransportTypeDetector`
152+
153+
- Default value: All transports are enabled.
154+
- This option defines a function to customize the transports that clients can use to send HTTP requests.
155+
- Use this options instead of [`HttpConnectionDispatcherOptions.Transports`](https://learn.microsoft.com/aspnet/core/signalr/configuration?&tabs=dotnet#advanced-http-configuration-options) to configure transports.
156+
151157
### Sample
152158

153159
You can configure above options like the following sample code.
@@ -162,6 +168,7 @@ services.AddSignalR()
162168

163169
options.GracefulShutdown.Mode = GracefulShutdownMode.WaitForClientsClose;
164170
options.GracefulShutdown.Timeout = TimeSpan.FromSeconds(10);
171+
options.TransportTypeDetector = httpContext => AspNetCore.Http.Connections.HttpTransportType.WebSockets | AspNetCore.Http.Connections.HttpTransportType.LongPolling;
165172
});
166173
```
167174

0 commit comments

Comments
 (0)