(buffer), CancellationToken.None);
}
+
+ if (closeFromServer)
+ {
+ return;
+ }
+
await webSocket.CloseAsync(result.CloseStatus.Value, result.CloseStatusDescription, CancellationToken.None);
}
diff --git a/test/WebRoot/WebSocket/chatplus.html b/test/WebRoot/WebSocket/chatplus.html
new file mode 100644
index 0000000000..ca903f4e63
--- /dev/null
+++ b/test/WebRoot/WebSocket/chatplus.html
@@ -0,0 +1,366 @@
+
+
+
+
+
+
+
+
+
+
+
+ WebSocket Sample Application
+ Ready to connect...
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Communication Log
+
+
+
+ | From |
+ To |
+ Data |
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/WebRoot/WebSocket/images/select_arrow.gif b/test/WebRoot/WebSocket/images/select_arrow.gif
new file mode 100644
index 0000000000..781c8bc433
Binary files /dev/null and b/test/WebRoot/WebSocket/images/select_arrow.gif differ
diff --git a/test/WebRoot/WebSocket/images/select_arrow_down.gif b/test/WebRoot/WebSocket/images/select_arrow_down.gif
new file mode 100644
index 0000000000..0be8124c20
Binary files /dev/null and b/test/WebRoot/WebSocket/images/select_arrow_down.gif differ
diff --git a/test/WebRoot/WebSocket/images/select_arrow_over.gif b/test/WebRoot/WebSocket/images/select_arrow_over.gif
new file mode 100644
index 0000000000..0620571c81
Binary files /dev/null and b/test/WebRoot/WebSocket/images/select_arrow_over.gif differ
diff --git a/test/WebSocketClientEXE/App.config b/test/WebSocketClientEXE/App.config
new file mode 100644
index 0000000000..8324aa6ff1
--- /dev/null
+++ b/test/WebSocketClientEXE/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/WebSocketClientEXE/Program.cs b/test/WebSocketClientEXE/Program.cs
new file mode 100644
index 0000000000..ea45603a33
--- /dev/null
+++ b/test/WebSocketClientEXE/Program.cs
@@ -0,0 +1,53 @@
+using AspNetCoreModule.Test.Framework;
+using AspNetCoreModule.Test.WebSocketClient;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace WebSocketClientEXE
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ using (WebSocketClientHelper websocketClient = new WebSocketClientHelper())
+ {
+ if (args.Length == 0)
+ {
+ TestUtility.LogInformation("Usage: WebSocketClientEXE http://localhost:40000/aspnetcoreapp/websocket");
+ return;
+ }
+ string url = "http://localhost:40000/aspnetcoreapp/websocket";
+ if (args[0].Contains("http:"))
+ {
+ url = args[0];
+ }
+ var frameReturned = websocketClient.Connect(new Uri(url), true, true);
+ TestUtility.LogInformation(frameReturned.Content);
+ TestUtility.LogInformation("Type any data and Enter key ('Q' to quit): ");
+
+ while (true)
+ {
+ Thread.Sleep(500);
+ if (!websocketClient.IsOpened)
+ {
+ TestUtility.LogInformation("Connection closed...");
+ break;
+ }
+
+ string data = Console.ReadLine();
+ if (data.Trim().ToLower() == "q")
+ {
+ frameReturned = websocketClient.Close();
+ TestUtility.LogInformation(frameReturned.Content);
+ break;
+ }
+ websocketClient.SendTextData(data);
+ }
+ }
+ }
+ }
+}
diff --git a/test/WebSocketClientEXE/Properties/AssemblyInfo.cs b/test/WebSocketClientEXE/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000..ed897b706e
--- /dev/null
+++ b/test/WebSocketClientEXE/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("WebSocketClientEXE")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("WebSocketClientEXE")]
+[assembly: AssemblyCopyright("Copyright © 2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("4062ea94-75f5-4691-86dc-c8594ba896de")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/test/WebSocketClientEXE/TestUtility.cs b/test/WebSocketClientEXE/TestUtility.cs
new file mode 100644
index 0000000000..852bda62bc
--- /dev/null
+++ b/test/WebSocketClientEXE/TestUtility.cs
@@ -0,0 +1,15 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+
+using System;
+
+namespace AspNetCoreModule.Test.Framework
+{
+ public class TestUtility
+ {
+ public static void LogInformation(string format, params object[] parameters)
+ {
+ Console.WriteLine(format, parameters);
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/WebSocketClientEXE/WebSocketClientEXE.csproj b/test/WebSocketClientEXE/WebSocketClientEXE.csproj
new file mode 100644
index 0000000000..67a5fa5efe
--- /dev/null
+++ b/test/WebSocketClientEXE/WebSocketClientEXE.csproj
@@ -0,0 +1,77 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {4062EA94-75F5-4691-86DC-C8594BA896DE}
+ Exe
+ WebSocketClientEXE
+ WebSocketClientEXE
+ v4.6
+ 512
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Frame.cs
+
+
+ Frames.cs
+
+
+ FrameType.cs
+
+
+ WebSocketClientHelper.cs
+
+
+ WebSocketClientUtility.cs
+
+
+ WebSocketConnect.cs
+
+
+ WebSocketConstants.cs
+
+
+ WebSocketState.cs
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file