Renamed the project and split into class library and sample
This commit is contained in:
parent
de291d4d2a
commit
c3753c4f0e
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DA69F624-5398-4884-87E4-B816698CDE65}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{83B2C3EB-A3D8-4E6F-9A3C-A380B005EF31}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
global.json = global.json
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{C4BC9889-B49F-41B6-806B-F84941B2549B}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "SocketsSample", "samples\SocketsSample\SocketsSample.xproj", "{C4AEAB04-F341-4539-B6C0-52368FB4BF9E}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Sockets", "src\Microsoft.AspNetCore.Sockets\Microsoft.AspNetCore.Sockets.xproj", "{1715EA8D-8E13-4ACF-8BCA-57D048E55ED8}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C4AEAB04-F341-4539-B6C0-52368FB4BF9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C4AEAB04-F341-4539-B6C0-52368FB4BF9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C4AEAB04-F341-4539-B6C0-52368FB4BF9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C4AEAB04-F341-4539-B6C0-52368FB4BF9E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1715EA8D-8E13-4ACF-8BCA-57D048E55ED8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1715EA8D-8E13-4ACF-8BCA-57D048E55ED8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1715EA8D-8E13-4ACF-8BCA-57D048E55ED8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1715EA8D-8E13-4ACF-8BCA-57D048E55ED8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{C4AEAB04-F341-4539-B6C0-52368FB4BF9E} = {C4BC9889-B49F-41B6-806B-F84941B2549B}
|
||||
{1715EA8D-8E13-4ACF-8BCA-57D048E55ED8} = {DA69F624-5398-4884-87E4-B816698CDE65}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DA69F624-5398-4884-87E4-B816698CDE65}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{83B2C3EB-A3D8-4E6F-9A3C-A380B005EF31}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
global.json = global.json
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApplication95", "src\WebApplication95\WebApplication95.xproj", "{52ED8B3A-2DBB-448A-A708-FAA0783B7917}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{52ED8B3A-2DBB-448A-A708-FAA0783B7917}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{52ED8B3A-2DBB-448A-A708-FAA0783B7917}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{52ED8B3A-2DBB-448A-A708-FAA0783B7917}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{52ED8B3A-2DBB-448A-A708-FAA0783B7917}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{52ED8B3A-2DBB-448A-A708-FAA0783B7917} = {DA69F624-5398-4884-87E4-B816698CDE65}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
@ -6,7 +6,7 @@ using System.Threading;
|
|||
using System.Threading.Tasks;
|
||||
using Channels;
|
||||
|
||||
namespace WebApplication95
|
||||
namespace Microsoft.AspNetCore.Sockets
|
||||
{
|
||||
public class Message
|
||||
{
|
||||
|
|
@ -3,8 +3,9 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Channels;
|
||||
using Microsoft.AspNetCore.Sockets;
|
||||
|
||||
namespace WebApplication95.EndPoints
|
||||
namespace SocketsSample
|
||||
{
|
||||
public class ChatEndPoint : EndPoint
|
||||
{
|
||||
|
|
@ -5,17 +5,14 @@ using System.Linq;
|
|||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
||||
namespace WebApplication95
|
||||
namespace SocketsSample
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var host = new WebHostBuilder()
|
||||
.UseKestrel(options =>
|
||||
{
|
||||
options.UseConnectionLogging();
|
||||
})
|
||||
.UseKestrel()
|
||||
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||
.UseIISIntegration()
|
||||
.UseStartup<Startup>()
|
||||
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>52ed8b3a-2dbb-448a-a708-faa0783b7917</ProjectGuid>
|
||||
<RootNamespace>WebApplication95</RootNamespace>
|
||||
<ProjectGuid>c4aeab04-f341-4539-b6c0-52368fb4bf9e</ProjectGuid>
|
||||
<RootNamespace>SocketsSample</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
|
|
@ -3,10 +3,8 @@ using Microsoft.AspNetCore.Hosting;
|
|||
using Microsoft.AspNetCore.Routing;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using WebApplication95.EndPoints;
|
||||
using WebApplication95.Routing;
|
||||
|
||||
namespace WebApplication95
|
||||
namespace SocketsSample
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"Channels": "0.2.0-beta-*",
|
||||
"Microsoft.AspNetCore.Sockets": {
|
||||
"target": "project"
|
||||
},
|
||||
"Microsoft.NETCore.App": {
|
||||
"version": "1.0.0",
|
||||
"type": "platform"
|
||||
},
|
||||
"Microsoft.AspNetCore.Routing": "1.0.0",
|
||||
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
|
||||
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
|
||||
|
||||
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
|
||||
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
|
||||
"Microsoft.Extensions.Logging.Console": "1.0.0"
|
||||
|
|
@ -3,7 +3,7 @@ using System.Collections.Concurrent;
|
|||
using System.Threading;
|
||||
using Channels;
|
||||
|
||||
namespace WebApplication95
|
||||
namespace Microsoft.AspNetCore.Sockets
|
||||
{
|
||||
public class ConnectionManager
|
||||
{
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using Channels;
|
||||
|
||||
namespace WebApplication95
|
||||
namespace Microsoft.AspNetCore.Sockets
|
||||
{
|
||||
public class ConnectionState
|
||||
{
|
||||
|
|
@ -1,10 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Channels;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebApplication95
|
||||
namespace Microsoft.AspNetCore.Sockets
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an end point that multiple connections connect to. For HTTP, endpoints are URLs, for non HTTP it can be a TCP listener (or similar)
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using Channels;
|
||||
|
||||
namespace WebApplication95
|
||||
namespace Microsoft.AspNetCore.Sockets
|
||||
{
|
||||
public class HttpChannel : IChannel
|
||||
{
|
||||
|
|
@ -6,11 +6,11 @@ using Channels;
|
|||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using Microsoft.AspNetCore.Sockets.Routing;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
using WebApplication95.Routing;
|
||||
|
||||
namespace WebApplication95
|
||||
namespace Microsoft.AspNetCore.Sockets
|
||||
{
|
||||
public class HttpConnectionDispatcher
|
||||
{
|
||||
|
|
@ -1,10 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Sockets;
|
||||
|
||||
namespace WebApplication95
|
||||
namespace Microsoft.AspNetCore.Builder
|
||||
{
|
||||
public static class HttpDispatcherAppBuilderExtensions
|
||||
{
|
||||
|
|
@ -16,5 +13,4 @@ namespace WebApplication95
|
|||
return app;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ using System.Threading.Tasks;
|
|||
using Channels;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace WebApplication95
|
||||
namespace Microsoft.AspNetCore.Sockets
|
||||
{
|
||||
public class LongPolling
|
||||
{
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>1715ea8d-8e13-4acf-8bca-57d048e55ed8</ProjectGuid>
|
||||
<RootNamespace>Microsoft.AspNetCore.Sockets</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
|
|
@ -4,9 +4,9 @@ using System.Linq;
|
|||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
|
||||
namespace WebApplication95.Routing
|
||||
namespace Microsoft.AspNetCore.Sockets.Routing
|
||||
{
|
||||
public class PrefixRoute : IRouter
|
||||
internal class PrefixRoute : IRouter
|
||||
{
|
||||
private readonly IRouteHandler _target;
|
||||
private readonly string _prefix;
|
||||
|
|
@ -4,10 +4,9 @@ using System.Linq;
|
|||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
|
||||
namespace WebApplication95.Routing
|
||||
namespace Microsoft.AspNetCore.Sockets.Routing
|
||||
{
|
||||
|
||||
public static class RouteBuilderExtensions
|
||||
internal static class RouteBuilderExtensions
|
||||
{
|
||||
public static IRouteBuilder AddPrefixRoute(
|
||||
this IRouteBuilder routeBuilder,
|
||||
|
|
@ -3,7 +3,7 @@ using System.Threading.Tasks;
|
|||
using Channels;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace WebApplication95
|
||||
namespace Microsoft.AspNetCore.Sockets
|
||||
{
|
||||
public class ServerSentEvents
|
||||
{
|
||||
|
|
@ -94,7 +94,7 @@ namespace WebApplication95
|
|||
{
|
||||
return Post(async state =>
|
||||
{
|
||||
var data = ((ReadableBuffer)state);
|
||||
var data = (ReadableBuffer)state;
|
||||
// TODO: Pooled buffers
|
||||
// 8 = 6(data: ) + 2 (\n\n)
|
||||
var buffer = new byte[8 + data.Length];
|
||||
|
|
@ -5,7 +5,7 @@ using System.Threading.Tasks;
|
|||
using Channels;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace WebApplication95
|
||||
namespace Microsoft.AspNetCore.Sockets
|
||||
{
|
||||
public class WebSockets
|
||||
{
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"version": "0.1.0-*",
|
||||
"dependencies": {
|
||||
"Channels": "0.2.0-beta-*",
|
||||
"Microsoft.AspNetCore.Routing": "1.0.0"
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard1.3": {
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue