Skip to content

Commit 77d3c27

Browse files
committed
Remove scheduling mode
1 parent ba6ae60 commit 77d3c27

File tree

4 files changed

+2
-53
lines changed

4 files changed

+2
-53
lines changed

src/Servers/Kestrel/samples/Http2SampleApp/Program.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ public static void Main(string[] args)
2929
{
3030
var basePort = context.Configuration.GetValue<int?>("BASE_PORT") ?? 5000;
3131

32-
// Run callbacks on the transport thread
33-
options.ApplicationSchedulingMode = SchedulingMode.Inline;
34-
3532
// Http/1.1 endpoint for comparison
3633
options.Listen(IPAddress.Any, basePort, listenOptions =>
3734
{

src/Servers/Kestrel/samples/PlaintextApp/Startup.cs

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
using Microsoft.AspNetCore.Builder;
1111
using Microsoft.AspNetCore.Connections;
1212
using Microsoft.AspNetCore.Hosting;
13-
using Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets;
1413

1514
namespace PlaintextApp
1615
{
@@ -40,52 +39,11 @@ public static async Task Main(string[] args)
4039
{
4140
options.Listen(IPAddress.Loopback, 5001);
4241
})
43-
// .UseLibuv()
4442
.UseContentRoot(Directory.GetCurrentDirectory())
4543
.UseStartup<Startup>()
4644
.Build();
4745

48-
var hostTask = host.RunAsync();
49-
var serverTask = ServerAsync(new SocketTransportFactory(), 5002);
50-
51-
await hostTask;;
52-
}
53-
54-
private static async Task ServerAsync(IConnectionListenerFactory factory, int port)
55-
{
56-
await using var listener = await factory.BindAsync(new IPEndPoint(IPAddress.Loopback, port));
57-
58-
while (true)
59-
{
60-
var connection = await listener.AcceptAsync();
61-
62-
// Fire and forget so we can handle more than a single connection at a time
63-
_ = HandleConnectionAsync(connection);
64-
65-
static async Task HandleConnectionAsync(ConnectionContext connection)
66-
{
67-
await using (connection)
68-
{
69-
while (true)
70-
{
71-
var result = await connection.Transport.Input.ReadAsync();
72-
var buffer = result.Buffer;
73-
74-
foreach (var segment in buffer)
75-
{
76-
await connection.Transport.Output.WriteAsync(segment);
77-
}
78-
79-
if (result.IsCompleted)
80-
{
81-
break;
82-
}
83-
84-
connection.Transport.Input.AdvanceTo(buffer.End);
85-
}
86-
}
87-
}
88-
}
46+
await host.RunAsync();
8947
}
9048
}
9149

src/Servers/Kestrel/samples/SampleApp/Startup.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ public static Task Main(string[] args)
9595
httpsOptions.SslProtocols = SslProtocols.Tls12;
9696
});
9797

98-
// Run callbacks on the transport thread
99-
options.ApplicationSchedulingMode = SchedulingMode.Inline;
100-
10198
options.Listen(IPAddress.Loopback, basePort, listenOptions =>
10299
{
103100
// Uncomment the following to enable Nagle's algorithm for this endpoint.

src/Servers/Kestrel/samples/SystemdTestApp/Startup.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ public static Task Main(string[] args)
5151
{
5252
var basePort = context.Configuration.GetValue<int?>("BASE_PORT") ?? 5000;
5353

54-
// Run callbacks on the transport thread
55-
options.ApplicationSchedulingMode = SchedulingMode.Inline;
56-
5754
options.Listen(IPAddress.Loopback, basePort, listenOptions =>
5855
{
5956
// Uncomment the following to enable Nagle's algorithm for this endpoint.
@@ -89,4 +86,4 @@ public static Task Main(string[] args)
8986
return hostBuilder.Build().RunAsync();
9087
}
9188
}
92-
}
89+
}

0 commit comments

Comments
 (0)