Skip to content
This repository was archived by the owner on Mar 19, 2019. It is now read-only.

Merge and rename packages and components to HttpSys* #286

Merged
merged 6 commits into from
Jan 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
45 changes: 3 additions & 42 deletions WebListener.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{E183C826-1
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{3A1E31E3-2794-4CA3-B8E2-253E96BDE514}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Net.Http.Server", "src\Microsoft.Net.Http.Server\Microsoft.Net.Http.Server.xproj", "{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "HelloWorld", "samples\HelloWorld\HelloWorld.xproj", "{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "SelfHostServer", "samples\SelfHostServer\SelfHostServer.xproj", "{1236F93A-AC5C-4A77-9477-C88F040151CA}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Server.WebListener.FunctionalTests", "test\Microsoft.AspNetCore.Server.WebListener.FunctionalTests\Microsoft.AspNetCore.Server.WebListener.FunctionalTests.xproj", "{4492FF4C-9032-411D-853F-46B01755E504}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Server.WebListener", "src\Microsoft.AspNetCore.Server.WebListener\Microsoft.AspNetCore.Server.WebListener.xproj", "{B9F45F9D-D206-47F0-8E5F-54CE2F0BDF92}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Server.HttpSys.FunctionalTests", "test\Microsoft.AspNetCore.Server.HttpSys.FunctionalTests\Microsoft.AspNetCore.Server.HttpSys.FunctionalTests.xproj", "{4492FF4C-9032-411D-853F-46B01755E504}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Net.Http.Server.FunctionalTests", "test\Microsoft.Net.Http.Server.FunctionalTests\Microsoft.Net.Http.Server.FunctionalTests.xproj", "{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Server.HttpSys", "src\Microsoft.AspNetCore.Server.HttpSys\Microsoft.AspNetCore.Server.HttpSys.xproj", "{B9F45F9D-D206-47F0-8E5F-54CE2F0BDF92}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5E9B546C-17AC-4BDF-BCB3-5955D4755ED8}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -29,7 +23,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "HotAddSample", "samples\HotAddSample\HotAddSample.xproj", "{8BFA392A-8B67-4454-916B-67C545EDFAEF}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Net.Http.Server.Tests", "test\Microsoft.Net.Http.Server.Tests\Microsoft.Net.Http.Server.Tests.xproj", "{E837249E-E666-4DF2-AFC3-7A4D70234F9F}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Server.HttpSys.Tests", "test\Microsoft.AspNetCore.Server.HttpSys.Tests\Microsoft.AspNetCore.Server.HttpSys.Tests.xproj", "{E837249E-E666-4DF2-AFC3-7A4D70234F9F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -51,26 +45,6 @@ Global
{8B828433-B333-4C19-96AE-00BFFF9D8841}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{8B828433-B333-4C19-96AE-00BFFF9D8841}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{8B828433-B333-4C19-96AE-00BFFF9D8841}.Release|x86.ActiveCfg = Release|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Debug|x86.ActiveCfg = Debug|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Release|Any CPU.Build.0 = Release|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1}.Release|x86.ActiveCfg = Release|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Debug|x86.ActiveCfg = Debug|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Release|Any CPU.Build.0 = Release|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4}.Release|x86.ActiveCfg = Release|Any CPU
{1236F93A-AC5C-4A77-9477-C88F040151CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1236F93A-AC5C-4A77-9477-C88F040151CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1236F93A-AC5C-4A77-9477-C88F040151CA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -101,16 +75,6 @@ Global
{B9F45F9D-D206-47F0-8E5F-54CE2F0BDF92}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{B9F45F9D-D206-47F0-8E5F-54CE2F0BDF92}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{B9F45F9D-D206-47F0-8E5F-54CE2F0BDF92}.Release|x86.ActiveCfg = Release|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Debug|x86.ActiveCfg = Debug|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Release|Any CPU.Build.0 = Release|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1}.Release|x86.ActiveCfg = Release|Any CPU
{8BFA392A-8B67-4454-916B-67C545EDFAEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8BFA392A-8B67-4454-916B-67C545EDFAEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8BFA392A-8B67-4454-916B-67C545EDFAEF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -141,12 +105,9 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{8B828433-B333-4C19-96AE-00BFFF9D8841} = {3A1E31E3-2794-4CA3-B8E2-253E96BDE514}
{3F5212AA-E287-49DD-8CEC-44BF0A2AC9A1} = {99D5E5F3-88F5-4CCF-8D8C-717C8925DF09}
{6DAF3E6B-8E1B-4E6E-B9FE-7B1E5FDB7DB4} = {3A1E31E3-2794-4CA3-B8E2-253E96BDE514}
{1236F93A-AC5C-4A77-9477-C88F040151CA} = {3A1E31E3-2794-4CA3-B8E2-253E96BDE514}
{4492FF4C-9032-411D-853F-46B01755E504} = {E183C826-1360-4DFF-9994-F33CED5C8525}
{B9F45F9D-D206-47F0-8E5F-54CE2F0BDF92} = {99D5E5F3-88F5-4CCF-8D8C-717C8925DF09}
{DCB6E0B1-223D-44E6-8696-4767E5B6E6A1} = {E183C826-1360-4DFF-9994-F33CED5C8525}
{8BFA392A-8B67-4454-916B-67C545EDFAEF} = {3A1E31E3-2794-4CA3-B8E2-253E96BDE514}
{E837249E-E666-4DF2-AFC3-7A4D70234F9F} = {E183C826-1360-4DFF-9994-F33CED5C8525}
EndGlobalSection
Expand Down
17 changes: 0 additions & 17 deletions samples/HelloWorld/HelloWorld.xproj

This file was deleted.

89 changes: 0 additions & 89 deletions samples/HelloWorld/Program.cs

This file was deleted.

9 changes: 0 additions & 9 deletions samples/HelloWorld/Properties/launchSettings.json

This file was deleted.

22 changes: 0 additions & 22 deletions samples/HelloWorld/project.json

This file was deleted.

13 changes: 6 additions & 7 deletions samples/HotAddSample/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Server.WebListener;
using Microsoft.AspNetCore.Server.HttpSys;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Server;

namespace HotAddSample
{
Expand All @@ -16,19 +15,19 @@ public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.Configure<WebListenerOptions>(options =>
services.Configure<HttpSysOptions>(options =>
{
ListenerSettings = options.ListenerSettings;
ServerOptions = options;
});
}

public WebListenerSettings ListenerSettings { get; set; }
public HttpSysOptions ServerOptions { get; set; }

public void Configure(IApplicationBuilder app, ILoggerFactory loggerfactory)
{
loggerfactory.AddConsole(LogLevel.Information);

var addresses = ListenerSettings.UrlPrefixes;
var addresses = ServerOptions.UrlPrefixes;
addresses.Add("http://localhost:12346/pathBase/");

app.Use(async (context, next) =>
Expand Down Expand Up @@ -103,7 +102,7 @@ public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseStartup<Startup>()
.UseWebListener()
.UseHttpSys()
.Build();

host.Run();
Expand Down
2 changes: 1 addition & 1 deletion samples/HotAddSample/project.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"Microsoft.AspNetCore.Server.WebListener": "1.2.0-*",
"Microsoft.AspNetCore.Server.HttpSys": "1.2.0-*",
"Microsoft.Extensions.Logging.Console": "1.2.0-*"
},
"buildOptions": {
Expand Down
15 changes: 7 additions & 8 deletions samples/SelfHostServer/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Server.WebListener;
using Microsoft.AspNetCore.Server.HttpSys;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Server;

namespace SelfHostServer
{
Expand All @@ -17,10 +16,10 @@ public class Startup
public void ConfigureServices(IServiceCollection services)
{
// Server options can be configured here instead of in Main.
services.Configure<WebListenerOptions>(options =>
services.Configure<HttpSysOptions>(options =>
{
options.ListenerSettings.Authentication.Schemes = AuthenticationSchemes.None;
options.ListenerSettings.Authentication.AllowAnonymous = true;
options.Authentication.Schemes = AuthenticationSchemes.None;
options.Authentication.AllowAnonymous = true;
});
}

Expand Down Expand Up @@ -50,10 +49,10 @@ public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseStartup<Startup>()
.UseWebListener(options =>
.UseHttpSys(options =>
{
options.ListenerSettings.Authentication.Schemes = AuthenticationSchemes.None;
options.ListenerSettings.Authentication.AllowAnonymous = true;
options.Authentication.Schemes = AuthenticationSchemes.None;
options.Authentication.AllowAnonymous = true;
})
.Build();

Expand Down
2 changes: 1 addition & 1 deletion samples/SelfHostServer/project.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"Microsoft.AspNetCore.Server.WebListener": "1.2.0-*",
"Microsoft.AspNetCore.Server.HttpSys": "1.2.0-*",
"Microsoft.Extensions.Logging.Console": "1.2.0-*"
},
"buildOptions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
using System.Threading;
using System.Threading.Tasks;

namespace Microsoft.Net.Http.Server
namespace Microsoft.AspNetCore.Server.HttpSys
{
internal unsafe class AsyncAcceptContext : IAsyncResult, IDisposable
{
internal static readonly IOCompletionCallback IOCallback = new IOCompletionCallback(IOWaitCallback);

private TaskCompletionSource<RequestContext> _tcs;
private WebListener _server;
private HttpSysListener _server;
private NativeRequestContext _nativeRequestContext;

internal AsyncAcceptContext(WebListener server)
internal AsyncAcceptContext(HttpSysListener server)
{
_server = server;
_tcs = new TaskCompletionSource<RequestContext>();
Expand All @@ -40,7 +40,7 @@ private TaskCompletionSource<RequestContext> Tcs
}
}

internal WebListener Server
internal HttpSysListener Server
{
get
{
Expand All @@ -58,12 +58,12 @@ private static void IOCompleted(AsyncAcceptContext asyncResult, uint errorCode,
if (errorCode != UnsafeNclNativeMethods.ErrorCodes.ERROR_SUCCESS &&
errorCode != UnsafeNclNativeMethods.ErrorCodes.ERROR_MORE_DATA)
{
asyncResult.Tcs.TrySetException(new WebListenerException((int)errorCode));
asyncResult.Tcs.TrySetException(new HttpSysException((int)errorCode));
complete = true;
}
else
{
WebListener server = asyncResult.Server;
HttpSysListener server = asyncResult.Server;
if (errorCode == UnsafeNclNativeMethods.ErrorCodes.ERROR_SUCCESS)
{
// at this point we have received an unmanaged HTTP_REQUEST and memoryBlob
Expand Down Expand Up @@ -106,7 +106,7 @@ private static void IOCompleted(AsyncAcceptContext asyncResult, uint errorCode,
{
// someother bad error, possible(?) return values are:
// ERROR_INVALID_HANDLE, ERROR_INSUFFICIENT_BUFFER, ERROR_OPERATION_ABORTED
asyncResult.Tcs.TrySetException(new WebListenerException((int)statusCode));
asyncResult.Tcs.TrySetException(new HttpSysException((int)statusCode));
complete = true;
}
}
Expand Down Expand Up @@ -169,7 +169,7 @@ internal uint QueueBeginGetContext()
retry = true;
}
else if (statusCode == UnsafeNclNativeMethods.ErrorCodes.ERROR_SUCCESS
&& WebListener.SkipIOCPCallbackOnSuccess)
&& HttpSysListener.SkipIOCPCallbackOnSuccess)
{
// IO operation completed synchronously - callback won't be called to signal completion.
IOCompleted(this, statusCode, bytesTransferred);
Expand Down
Loading