File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
src/BenchmarksApps/TechEmpower/Kestrel Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 6
6
using Microsoft . Extensions . Options ;
7
7
8
8
var loggerFactory = new NullLoggerFactory ( ) ;
9
+ var configuration = new ConfigurationBuilder ( )
10
+ . AddEnvironmentVariables ( "ASPNETCORE_" )
11
+ . AddCommandLine ( args )
12
+ . Build ( ) ;
13
+
9
14
var socketOptions = new SocketTransportOptions ( )
10
15
{
11
16
WaitForDataBeforeAllocatingBuffer = false ,
12
17
UnsafePreferInlineScheduling = RuntimeInformation . IsOSPlatform ( OSPlatform . Linux )
13
18
&& Environment . GetEnvironmentVariable ( "DOTNET_SYSTEM_NET_SOCKETS_INLINE_COMPLETIONS" ) == "1"
14
19
} ;
15
- if ( int . TryParse ( Environment . GetEnvironmentVariable ( "threadCount" ) , out var value ) )
20
+ if ( int . TryParse ( configuration [ "threadCount" ] , out var value ) )
16
21
{
17
22
socketOptions . IOQueueCount = value ;
18
23
}
22
27
loggerFactory
23
28
) ;
24
29
30
+ var addresses = server . Features . GetRequiredFeature < IServerAddressesFeature > ( ) . Addresses ;
31
+ var urls = configuration [ "urls" ] ;
32
+ if ( ! string . IsNullOrEmpty ( urls ) )
33
+ {
34
+ foreach ( var url in urls . Split ( ';' , StringSplitOptions . RemoveEmptyEntries ) )
35
+ {
36
+ addresses . Add ( url ) ;
37
+ }
38
+ }
39
+
25
40
await server . StartAsync ( new BenchmarkApp ( ) , CancellationToken . None ) ;
26
41
27
- var addresses = server . Features . GetRequiredFeature < IServerAddressesFeature > ( ) . Addresses ;
28
42
foreach ( var address in addresses )
29
43
{
30
44
Console . WriteLine ( $ "Now listening on: { address } ") ;
Original file line number Diff line number Diff line change 5
5
"commandName" : " Project" ,
6
6
"dotnetRunMessages" : true ,
7
7
"launchBrowser" : false ,
8
+ "applicationUrl" : " http://localhost:5123" ,
8
9
"environmentVariables" : {
9
10
"ASPNETCORE_ENVIRONMENT" : " Development"
10
11
}
You can’t perform that action at this time.
0 commit comments