clean-up and renaming
renamed WebSockets project to clarify it's internalityness
This commit is contained in:
parent
d2dbd473a0
commit
affcb935d7
|
|
@ -23,9 +23,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{6A35B453-5
|
|||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Sockets.Tests", "test\Microsoft.AspNetCore.Sockets.Tests\Microsoft.AspNetCore.Sockets.Tests.xproj", "{AAD719D5-5E31-4ED1-A60F-6EB92EFA66D9}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Extensions.WebSockets", "src\Microsoft.Extensions.WebSockets\Microsoft.Extensions.WebSockets.xproj", "{5D9DA986-2EAB-4C6D-BF15-9A4BDD4DE775}"
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Extensions.WebSockets.Internal", "src\Microsoft.Extensions.WebSockets.Internal\Microsoft.Extensions.WebSockets.Internal.xproj", "{5D9DA986-2EAB-4C6D-BF15-9A4BDD4DE775}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Extensions.WebSockets.Tests", "test\Microsoft.Extensions.WebSockets.Tests\Microsoft.Extensions.WebSockets.Tests.xproj", "{8FA6BE8F-B5EB-42F9-9B16-101917CC45E2}"
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Extensions.WebSockets.Internal.Tests", "test\Microsoft.Extensions.WebSockets.Internal.Tests\Microsoft.Extensions.WebSockets.Internal.Tests.xproj", "{A7050BAE-3DB9-4FB3-A49D-303201415B13}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
|
@ -53,10 +53,10 @@ Global
|
|||
{5D9DA986-2EAB-4C6D-BF15-9A4BDD4DE775}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5D9DA986-2EAB-4C6D-BF15-9A4BDD4DE775}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5D9DA986-2EAB-4C6D-BF15-9A4BDD4DE775}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8FA6BE8F-B5EB-42F9-9B16-101917CC45E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8FA6BE8F-B5EB-42F9-9B16-101917CC45E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8FA6BE8F-B5EB-42F9-9B16-101917CC45E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8FA6BE8F-B5EB-42F9-9B16-101917CC45E2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A7050BAE-3DB9-4FB3-A49D-303201415B13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A7050BAE-3DB9-4FB3-A49D-303201415B13}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A7050BAE-3DB9-4FB3-A49D-303201415B13}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A7050BAE-3DB9-4FB3-A49D-303201415B13}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
@ -67,6 +67,6 @@ Global
|
|||
{BA99C2A1-48F9-4FA5-B95A-9687A73B7CC9} = {C4BC9889-B49F-41B6-806B-F84941B2549B}
|
||||
{AAD719D5-5E31-4ED1-A60F-6EB92EFA66D9} = {6A35B453-52EC-48AF-89CA-D4A69800F131}
|
||||
{5D9DA986-2EAB-4C6D-BF15-9A4BDD4DE775} = {DA69F624-5398-4884-87E4-B816698CDE65}
|
||||
{8FA6BE8F-B5EB-42F9-9B16-101917CC45E2} = {6A35B453-52EC-48AF-89CA-D4A69800F131}
|
||||
{A7050BAE-3DB9-4FB3-A49D-303201415B13} = {6A35B453-52EC-48AF-89CA-D4A69800F131}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
using System;
|
||||
using System.Buffers;
|
||||
using System.Threading;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Channels;
|
||||
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.Extensions.WebSockets
|
||||
namespace Microsoft.Extensions.WebSockets.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a connection to a WebSocket endpoint.
|
||||
|
|
@ -75,7 +75,8 @@ namespace Microsoft.Extensions.WebSockets
|
|||
/// <param name="messageHandler">The callback that will be invoked for each new frame</param>
|
||||
/// <returns>A <see cref="Task{WebSocketCloseResult}"/> that will complete when the client has sent a close frame, or the connection has been terminated</returns>
|
||||
public static Task<WebSocketCloseResult> ExecuteAsync(this IWebSocketConnection self, Action<WebSocketFrame> messageHandler) =>
|
||||
self.ExecuteAsync((frame, _) => {
|
||||
self.ExecuteAsync((frame, _) =>
|
||||
{
|
||||
messageHandler(frame);
|
||||
return Task.CompletedTask;
|
||||
}, null);
|
||||
|
|
@ -86,7 +87,8 @@ namespace Microsoft.Extensions.WebSockets
|
|||
/// <param name="messageHandler">The callback that will be invoked for each new frame</param>
|
||||
/// <returns>A <see cref="Task{WebSocketCloseResult}"/> that will complete when the client has sent a close frame, or the connection has been terminated</returns>
|
||||
public static Task<WebSocketCloseResult> ExecuteAsync(this IWebSocketConnection self, Action<WebSocketFrame, object> messageHandler, object state) =>
|
||||
self.ExecuteAsync((frame, s) => {
|
||||
self.ExecuteAsync((frame, s) =>
|
||||
{
|
||||
messageHandler(frame, s);
|
||||
return Task.CompletedTask;
|
||||
}, state);
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
using System.Binary;
|
||||
using Channels;
|
||||
|
||||
namespace Microsoft.Extensions.WebSockets
|
||||
namespace Microsoft.Extensions.WebSockets.Internal
|
||||
{
|
||||
internal static class MaskingUtilities
|
||||
{
|
||||
|
|
@ -3,7 +3,7 @@ using System.Text;
|
|||
using Channels;
|
||||
using Channels.Text.Primitives;
|
||||
|
||||
namespace Microsoft.Extensions.WebSockets
|
||||
namespace Microsoft.Extensions.WebSockets.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the payload of a Close frame (i.e. a <see cref="WebSocketFrame"/> with an <see cref="WebSocketFrame.Opcode"/> of <see cref="WebSocketOpcode.Close"/>).
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
namespace Microsoft.Extensions.WebSockets
|
||||
namespace Microsoft.Extensions.WebSockets.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents well-known WebSocket Close frame status codes.
|
||||
|
|
@ -5,9 +5,8 @@ using System.Security.Cryptography;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Channels;
|
||||
using Microsoft.Extensions.WebSockets.Internal;
|
||||
|
||||
namespace Microsoft.Extensions.WebSockets
|
||||
namespace Microsoft.Extensions.WebSockets.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides the default implementation of <see cref="IWebSocketConnection"/>.
|
||||
|
|
@ -1,9 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.Extensions.WebSockets
|
||||
namespace Microsoft.Extensions.WebSockets.Internal
|
||||
{
|
||||
public enum WebSocketConnectionState
|
||||
{
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
using Channels;
|
||||
using Channels;
|
||||
|
||||
namespace Microsoft.Extensions.WebSockets
|
||||
namespace Microsoft.Extensions.WebSockets.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a single Frame received or sent on a <see cref="IWebSocketConnection"/>.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
namespace Microsoft.Extensions.WebSockets
|
||||
namespace Microsoft.Extensions.WebSockets.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the possible values for the "opcode" field of a WebSocket frame.
|
||||
|
|
@ -6,8 +6,8 @@
|
|||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>8fa6be8f-b5eb-42f9-9b16-101917cc45e2</ProjectGuid>
|
||||
<RootNamespace>Microsoft.Extensions.WebSockets.Tests</RootNamespace>
|
||||
<ProjectGuid>a7050bae-3db9-4fb3-a49d-303201415b13</ProjectGuid>
|
||||
<RootNamespace>Microsoft.Extensions.WebSockets.Internal.Tests</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
using System.Threading.Tasks;
|
||||
using Channels;
|
||||
|
||||
namespace Microsoft.Extensions.WebSockets.Tests
|
||||
namespace Microsoft.Extensions.WebSockets.Internal.Tests
|
||||
{
|
||||
public static class WebSocketConnectionExtensions
|
||||
{
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.Extensions.WebSockets.Tests
|
||||
namespace Microsoft.Extensions.WebSockets.Internal.Tests
|
||||
{
|
||||
public class WebSocketConnectionSummary
|
||||
{
|
||||
|
|
@ -3,11 +3,9 @@ using System.Diagnostics;
|
|||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Channels;
|
||||
using Microsoft.Extensions.WebSockets.Test;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.Extensions.WebSockets.Tests
|
||||
namespace Microsoft.Extensions.WebSockets.Internal.Tests
|
||||
{
|
||||
public partial class WebSocketConnectionTests
|
||||
{
|
||||
|
|
@ -50,7 +48,7 @@ namespace Microsoft.Extensions.WebSockets.Tests
|
|||
[Fact]
|
||||
public async Task ExecuteReturnsWhenCloseFrameReceived()
|
||||
{
|
||||
using(var pair = WebSocketPair.Create())
|
||||
using (var pair = WebSocketPair.Create())
|
||||
{
|
||||
var client = pair.ClientSocket.ExecuteAndCaptureFramesAsync();
|
||||
await pair.ClientSocket.CloseAsync(new WebSocketCloseResult(WebSocketCloseStatus.InvalidMessageType, "Abc"));
|
||||
|
|
@ -71,7 +69,7 @@ namespace Microsoft.Extensions.WebSockets.Tests
|
|||
[Fact]
|
||||
public async Task AbnormalTerminationOfInboundChannelCausesExecuteToThrow()
|
||||
{
|
||||
using(var pair = WebSocketPair.Create())
|
||||
using (var pair = WebSocketPair.Create())
|
||||
{
|
||||
var client = pair.ClientSocket.ExecuteAndCaptureFramesAsync();
|
||||
var server = pair.ServerSocket.ExecuteAndCaptureFramesAsync();
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
|
@ -7,7 +6,7 @@ using System.Threading.Tasks;
|
|||
using Channels;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.Extensions.WebSockets.Tests
|
||||
namespace Microsoft.Extensions.WebSockets.Internal.Tests
|
||||
{
|
||||
public partial class WebSocketConnectionTests
|
||||
{
|
||||
|
|
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
|||
using Channels;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.Extensions.WebSockets.Tests
|
||||
namespace Microsoft.Extensions.WebSockets.Internal.Tests
|
||||
{
|
||||
public partial class WebSocketConnectionTests
|
||||
{
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using Channels;
|
||||
|
||||
namespace Microsoft.Extensions.WebSockets.Test
|
||||
namespace Microsoft.Extensions.WebSockets.Internal.Tests
|
||||
{
|
||||
internal class WebSocketPair : IDisposable
|
||||
{
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"dotnet-test-xunit": "1.0.0-rc3-000000-01",
|
||||
"Microsoft.Extensions.WebSockets": "0.1.0-*",
|
||||
"Microsoft.Extensions.WebSockets.Internal": "0.1.0-*",
|
||||
"xunit": "2.1.0"
|
||||
},
|
||||
"testRunner": "xunit",
|
||||
Loading…
Reference in New Issue