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 66using Microsoft . Extensions . Options ;
77
88var loggerFactory = new NullLoggerFactory ( ) ;
9+ var configuration = new ConfigurationBuilder ( )
10+ . AddEnvironmentVariables ( "ASPNETCORE_" )
11+ . AddCommandLine ( args )
12+ . Build ( ) ;
13+
914var socketOptions = new SocketTransportOptions ( )
1015{
1116 WaitForDataBeforeAllocatingBuffer = false ,
1217 UnsafePreferInlineScheduling = RuntimeInformation . IsOSPlatform ( OSPlatform . Linux )
1318 && Environment . GetEnvironmentVariable ( "DOTNET_SYSTEM_NET_SOCKETS_INLINE_COMPLETIONS" ) == "1"
1419} ;
15- if ( int . TryParse ( Environment . GetEnvironmentVariable ( "threadCount" ) , out var value ) )
20+ if ( int . TryParse ( configuration [ "threadCount" ] , out var value ) )
1621{
1722 socketOptions . IOQueueCount = value ;
1823}
2227 loggerFactory
2328 ) ;
2429
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+
2540await server . StartAsync ( new BenchmarkApp ( ) , CancellationToken . None ) ;
2641
27- var addresses = server . Features . GetRequiredFeature < IServerAddressesFeature > ( ) . Addresses ;
2842foreach ( var address in addresses )
2943{
3044 Console . WriteLine ( $ "Now listening on: { address } ") ;
Original file line number Diff line number Diff line change 55 "commandName" : " Project" ,
66 "dotnetRunMessages" : true ,
77 "launchBrowser" : false ,
8+ "applicationUrl" : " http://localhost:5123" ,
89 "environmentVariables" : {
910 "ASPNETCORE_ENVIRONMENT" : " Development"
1011 }
You can’t perform that action at this time.
0 commit comments