From fcc601a3615f405903e7e078c28025dac5781b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=A4=E7=A5=9E=E5=B0=8F=E6=80=AA=E5=85=BD?= Date: Tue, 3 Dec 2019 20:29:27 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20RE?= =?UTF-8?q?ADME.en.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.en.md | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 README.en.md diff --git a/README.en.md b/README.en.md deleted file mode 100644 index cf10fa0..0000000 --- a/README.en.md +++ /dev/null @@ -1,36 +0,0 @@ -# HPSocket.Net - -#### Description -the C# SDK for HP-Socket https://gitee.com/ldcsaa/HP-Socket - -#### Software Architecture -Software architecture description - -#### Installation - -1. xxxx -2. xxxx -3. xxxx - -#### Instructions - -1. xxxx -2. xxxx -3. xxxx - -#### Contribution - -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request - - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) -- Gitee From 22321ce496dcd764e394e11296da3a5bf30355d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=A4=E7=A5=9E=E5=B0=8F=E6=80=AA=E5=85=BD?= Date: Tue, 3 Dec 2019 20:30:07 +0800 Subject: [PATCH 02/10] update README.md. --- README.md | 182 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 158 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 748b8fc..cb619d9 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,171 @@ # HPSocket.Net -#### 介绍 -the C# SDK for HP-Socket https://gitee.com/ldcsaa/HP-Socket +## Overview +the C# SDK for [HP-Socket](https://github.com/ldcsaa/HP-Socket) -#### 软件架构 -软件架构说明 +#### .Net Framework Supported +`.Net Framework 2.0+` +`.Net Core 2.0+` -#### 安装教程 +#### Platform supported +`Windows 7+ x86/x64` -1. xxxx -2. xxxx -3. xxxx +`Linux kernel 2.6.32+ x86/x64` -#### 使用说明 +`mac OS 10.12+ x64` -1. xxxx -2. xxxx -3. xxxx -#### 参与贡献 +## Installation Guide +`HPSocket.Net` deploy via NuGet package manager -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request +Use the following command in the Package Manager console to manually install `HPSocket.Net` +``` +Install-Package HPSocket.Net +``` +Or right-click on the project name in the solution of Visual Studio-> Manage NuGet Packages-> Browse the page-> search box and enter HPSocket.Net and then install -#### 码云特技 +### About macOS +`HPSocket.Net` now supports development using` .net core2.0 + `in` osx 10.12 + ` -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 -5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +`Libhpsocket4c.dylib` in Nuget package is compiled from [HP-Socket-for-macOS](https://gitee.com/xin_chong/HP-Socket-for-macOS) + + +## Components List +### Basic COmponents +Basic component is the original component provided by HP-Socket. For related usage, please refer to [HP-Socket Doc](https://github.com/ldcsaa/HP-Socket/tree/master/Doc) + +*In addition to the `Pack` series model, the `Agent` series components provided by `HPSocket.Net` (including the `ITcpPortForwarding` component) support to setting `HTTP` or `Socks5` proxy, which can be set in the manner of`List`. Multiple proxies can be set at the same time, which will be used randomly, and can be mixed with `HTTP` and `Socks5` proxy at the same time. For the usage method, refer to the `demo` of each` Agent` component.* + +##### TCP ++ `ITcpServer` ++ `ITcpAgent` ++ `ITcpClient` ++ `ITcpPullServer` ++ `ITcpPullAgent` ++ `ITcpPullClient` ++ `ITcpPackServer` ++ `ITcpPackAgent` ++ `ITcpPacClient` + +##### UDP ++ `IUdpServer` ++ `IUdpClient` ++ `IUdpCast` ++ `IUdpArqServer` ++ `IUdpArqClient` ++ `IUdpNode` + +##### SSL ++ `ISslServer` ++ `ISslAgent` ++ `ISslClient` ++ `ISslPullServer` ++ `ISslPullAgent` ++ `ISslPullClient` ++ `ISslPackServer` ++ `ISslPackAgent` ++ `ISslPackClient` + +##### HTTP ++ `IHttpServer` ++ `IHttpsServer` ++ `IHttpAgent` ++ `IHttpsAgent` ++ `IHttpClient` ++ `IHttpsClient` ++ `IHttpSyncClient` ++ `IHttpsSyncClient` + +#### ThreadPool ++ `ThreadPool` + +### Extended components ++ `ITcpPortForwarding` ++ `IHttpEasyServer` ++ `IHttpsEasyServer` ++ `IHttpEasyAgent` ++ `IHttpsEasyAgent` ++ `IHttpEasyClient` ++ `IHttpsEasyClient` ++ `IWebSocketServer` ++ `IWebSocketAgent` + +`HPSocket.Net` provides a TCP port forwarding component` ITcpPortForwarding`, 10 lines of code can complete TCP port forwarding. + +`HPSocket.Net` currently provides 6 Easy components and 2 WebSocket components for easier processing of http / https / ws data packets. The basic http components provided by `HP-Socket` need to implement the data packets themselves. Complete acquisition, Easy component has done these processing, http / https Easy component is bound to the following events, when the event arrives, you can get the complete data packet. + ++ `OnEasyChunkData` Complete packet event for http CHUNK message ++ `OnEasyMessageData` Complete packet event for http GET or POST message ++ `OnEasyWebSocketMessageData` Complete packet event for WebSocket message + +`WebSocket` can also use the following two components directly + ++ `IWebSocketServer` WebSocket Server ++ `IWebSocketAgent` WebSocket Client (Unlike other Agent components, the WebSocket Agent component does not support connecting to different WebSocket Servers, which means that all connections of the `IWebSocketAgent` component can only connect to the same server) + + +## Instructions +1. For the use of most components, please refer to the project in the `demo` directory +2. `Easy` extended component event binding for` HPSocket.Net` +#### IHttpEasyServer +```cs +// Create HttpEasyServer instance +using(IHttpEasyServer httpServer = new HttpEasyServer()) +{ + // ... other settings + + // Binding OnEasyMessageData event + httpServer.OnEasyMessageData += (sender, id, data) => + { + // The data parameter is a complete packet each time + // ... Process data + + return HttpParseResult.Ok; + }; +} +``` + +#### IHttpEasyAgent +```cs +// Create HttpEasyAgent instance +using(IHttpEasyAgent httpAgent = new HttpEasyAgent()) +{ + // ... other settings + + // Binding OnEasyMessageData event + httpAgent.OnEasyMessageData += (sender, id, data) => + { + // The data parameter is a complete packet each time + // ... Process data + + return HttpParseResult.Ok; + }; +} +``` + +#### IHttpEasyClient +```cs +// Create HttpEasyClient instance +using(IHttpEasyClient httpClient = new HttpEasyClient()) +{ + // ... other settings + + // Binding OnEasyMessageData event + httpClient.OnEasyMessageData += (sender, data) => + { + // The data parameter is a complete packet each time + // ... Process data + + return HttpParseResult.Ok; + }; +} +``` + +## Contribute + +1. Fork this Repository +2. Create a new Feat_xxx branch +3. Submit code +4. Create a new Pull Request \ No newline at end of file -- Gitee From bd96b160567bcff0409a9d8994d48662f89d28c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=A4=E7=A5=9E=E5=B0=8F=E6=80=AA=E5=85=BD?= Date: Tue, 3 Dec 2019 20:31:17 +0800 Subject: [PATCH 03/10] create README_zh.md --- README_zh.md | 171 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 README_zh.md diff --git a/README_zh.md b/README_zh.md new file mode 100644 index 0000000..0ef129e --- /dev/null +++ b/README_zh.md @@ -0,0 +1,171 @@ +# HPSocket.Net + +## 概览 +the C# SDK for [HP-Socket](https://github.com/ldcsaa/HP-Socket) + +#### .Net 框架支持 +`.Net Framework 2.0+` + +`.Net Core 2.0+` + +#### 平台支持 +`Windows 7+ x86/x64` + +`Linux kernel 2.6.32+ x86/x64` + +`mac OS 10.12+ x64` + + +## 安装教程 +`HPSocket.Net`通过NuGet软件包管理器部署 + +在 Package Manager 控制台中使用以下命令来手动安装 `HPSocket.Net` +``` +Install-Package HPSocket.Net +``` +或在`Visual Studio`的解决方案中的`项目名`上`鼠标右键`->`管理 NuGet 程序包`->`浏览`页面->搜索框输入`HPSocket.Net`->然后安装 + + +### 关于macOS +`HPSocket.Net`现在支持在`osx 10.12+`中使用`.net core2.0+`进行开发 + +Nuget软件包中的`libhpsocket4c.dylib`编译自`HP-Socket`的`macOS分支`[HP-Socket-for-macOS](https://gitee.com/xin_chong/HP-Socket-for-macOS) + + +## 组件列表 +### 基础组件 +基础组件是`HP-Socket`提供的原始组件, 相关使用方法请参考[HP-Socket Doc](https://github.com/ldcsaa/HP-Socket/tree/master/Doc) + +*`HPSocket.Net`提供的`Agent`系列组件除`Pack`系列模型外, 包括`ITcpPortForwarding`组件, 都支持设置`http`或`socks5`代理, 以`List`方式设置, 可同时设置多个代理, 组件内部会随机使用, 可以同时混用`http`和`socks5`代理, 使用方法参考各`Agent`组件的`demo`* + +##### TCP ++ `ITcpServer` ++ `ITcpAgent` ++ `ITcpClient` ++ `ITcpPullServer` ++ `ITcpPullAgent` ++ `ITcpPullClient` ++ `ITcpPackServer` ++ `ITcpPackAgent` ++ `ITcpPacClient` + +##### UDP ++ `IUdpServer` ++ `IUdpClient` ++ `IUdpCast` ++ `IUdpArqServer` ++ `IUdpArqClient` ++ `IUdpNode` + +##### SSL ++ `ISslServer` ++ `ISslAgent` ++ `ISslClient` ++ `ISslPullServer` ++ `ISslPullAgent` ++ `ISslPullClient` ++ `ISslPackServer` ++ `ISslPackAgent` ++ `ISslPackClient` + +##### HTTP ++ `IHttpServer` ++ `IHttpsServer` ++ `IHttpAgent` ++ `IHttpsAgent` ++ `IHttpClient` ++ `IHttpsClient` ++ `IHttpSyncClient` ++ `IHttpsSyncClient` + +#### ThreadPool ++ `ThreadPool` + +### 扩展组件 ++ `ITcpPortForwarding` ++ `IHttpEasyServer` ++ `IHttpsEasyServer` ++ `IHttpEasyAgent` ++ `IHttpsEasyAgent` ++ `IHttpEasyClient` ++ `IHttpsEasyClient` ++ `IWebSocketServer` ++ `IWebSocketAgent` + +`HPSocket.Net` 提供一个Tcp端口转发组件`ITcpPortForwarding`, 10行代码即可完成TCP端口转发 + +`HPSocket.Net`目前提供6个Easy组件和2个WebSocket组件, 用来更简单的处理http/https/ws的数据包, `HP-Socket`提供的基础http组件, 需要自己来实现数据包的完整获取, Easy组件已经做了这些处理, http/https的Easy组件绑定以下事件, 当事件到达, 即可获得完整数据包 + ++ `OnEasyChunkData` http CHUNK消息的完整数据包事件 ++ `OnEasyMessageData` http GET或POST的完整数据包事件 ++ `OnEasyWebSocketMessageData` WebSocket消息的完整数据包事件 + +`WebSocket` 也可以直接使用以下两个组件 + ++ `IWebSocketServer` WebSocket 服务端 ++ `IWebSocketAgent` WebSocket 客户端 (与其他Agent组件不同, WebSocket的Agent组件不支持连接到不同的WebSocket Server, 也就是说`IWebSocketAgent`组件所有的连接都只能连接到同一个服务器) + + +## 使用说明 +1. 大部分组件使用方法请参考`demo`目录下的工程 +2. `HPSocket.Net`的`Easy`扩展组件事件绑定 +#### IHttpEasyServer +```cs +// 创建 HttpEasyServer 的实例 +using(IHttpEasyServer httpServer = new HttpEasyServer()) +{ + // ...其他设置 + + // 绑定 OnEasyMessageData 事件 + httpServer.OnEasyMessageData += (sender, id, data) => + { + // data 参数每次都是一个完整的数据包 + // ... 处理 data + + return HttpParseResult.Ok; + }; +} +``` + +#### IHttpEasyAgent +```cs +// 创建 HttpEasyAgent 的实例 +using(IHttpEasyAgent httpAgent = new HttpEasyAgent()) +{ + // ...其他设置 + + // 绑定 OnEasyMessageData 事件 + httpAgent.OnEasyMessageData += (sender, id, data) => + { + // data 参数每次都是一个完整的数据包 + // ... 处理 data + + return HttpParseResult.Ok; + }; +} +``` + +#### IHttpEasyClient +```cs +// 创建 HttpEasyClient 的实例 +using(IHttpEasyClient httpClient = new HttpEasyClient()) +{ + // ...其他设置 + + // 绑定 OnEasyMessageData 事件 + httpClient.OnEasyMessageData += (sender, data) => + { + // data 参数每次都是一个完整的数据包 + // ... 处理 data + + return HttpParseResult.Ok; + }; +} +``` + +## 参与贡献 + +1. Fork 本仓库 +2. 新建 Feat_xxx 分支 +3. 提交代码 +4. 新建 Pull Request \ No newline at end of file -- Gitee From 1fbe8fa88df51e3c73d839c3cf078a86d64c8b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=A4=E7=A5=9E=E5=B0=8F=E6=80=AA=E5=85=BD?= Date: Tue, 3 Dec 2019 21:29:09 +0800 Subject: [PATCH 04/10] update README.md. --- README.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index cb619d9..3ef7bf7 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,13 @@ the C# SDK for [HP-Socket](https://github.com/ldcsaa/HP-Socket) #### .Net Framework Supported -`.Net Framework 2.0+` - -`.Net Core 2.0+` +* `.Net Framework 2.0+` +* `.Net Core 2.0+` #### Platform supported -`Windows 7+ x86/x64` - -`Linux kernel 2.6.32+ x86/x64` - -`mac OS 10.12+ x64` - +* `Windows 7+ x86/x64` +* `Linux kernel 2.6.32+ x86/x64` +* `mac OS 10.12+ x64` ## Installation Guide `HPSocket.Net` deploy via NuGet package manager -- Gitee From b5fe954eb76695005f83dd257df9ac74082d1dc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=A4=E7=A5=9E=E5=B0=8F=E6=80=AA=E5=85=BD?= Date: Tue, 3 Dec 2019 21:29:33 +0800 Subject: [PATCH 05/10] update README_zh.md. --- README_zh.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/README_zh.md b/README_zh.md index 0ef129e..f6f1a2b 100644 --- a/README_zh.md +++ b/README_zh.md @@ -4,17 +4,13 @@ the C# SDK for [HP-Socket](https://github.com/ldcsaa/HP-Socket) #### .Net 框架支持 -`.Net Framework 2.0+` - -`.Net Core 2.0+` +* `.Net Framework 2.0+` +* `.Net Core 2.0+` #### 平台支持 -`Windows 7+ x86/x64` - -`Linux kernel 2.6.32+ x86/x64` - -`mac OS 10.12+ x64` - +* `Windows 7+ x86/x64` +* `Linux kernel 2.6.32+ x86/x64` +* `mac OS 10.12+ x64` ## 安装教程 `HPSocket.Net`通过NuGet软件包管理器部署 -- Gitee From 4818ef88ec9bc7b73df09a21afd07df45182d466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=A4=E7=A5=9E=E5=B0=8F=E6=80=AA=E5=85=BD?= Date: Tue, 3 Dec 2019 22:21:48 +0800 Subject: [PATCH 06/10] update README.md. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3ef7bf7..1f09de5 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,6 @@ Or right-click on the project name in the solution of Visual Studio-> Manage NuG ### Basic COmponents Basic component is the original component provided by HP-Socket. For related usage, please refer to [HP-Socket Doc](https://github.com/ldcsaa/HP-Socket/tree/master/Doc) -*In addition to the `Pack` series model, the `Agent` series components provided by `HPSocket.Net` (including the `ITcpPortForwarding` component) support to setting `HTTP` or `Socks5` proxy, which can be set in the manner of`List`. Multiple proxies can be set at the same time, which will be used randomly, and can be mixed with `HTTP` and `Socks5` proxy at the same time. For the usage method, refer to the `demo` of each` Agent` component.* - ##### TCP + `ITcpServer` + `ITcpAgent` @@ -105,6 +103,8 @@ Basic component is the original component provided by HP-Socket. For related usa ## Instructions 1. For the use of most components, please refer to the project in the `demo` directory 2. `Easy` extended component event binding for` HPSocket.Net` +3. In addition to the `Pack` series model, the `Agent` series components provided by `HPSocket.Net` (including the `ITcpPortForwarding` component) support to setting `HTTP` or `Socks5` proxy, which can be set in the manner of`List`. Multiple proxies can be set at the same time, which will be used randomly, and can be mixed with `HTTP` and `Socks5` proxy at the same time. For the usage method, refer to the `demo` of each` Agent` component. + #### IHttpEasyServer ```cs // Create HttpEasyServer instance -- Gitee From fa3de2722baae1efe01c1c7185db269d5767b896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BC=A4=E7=A5=9E=E5=B0=8F=E6=80=AA=E5=85=BD?= Date: Tue, 3 Dec 2019 22:22:27 +0800 Subject: [PATCH 07/10] update README_zh.md. --- README_zh.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_zh.md b/README_zh.md index f6f1a2b..8afea58 100644 --- a/README_zh.md +++ b/README_zh.md @@ -32,8 +32,6 @@ Nuget软件包中的`libhpsocket4c.dylib`编译自`HP-Socket`的`macOS分支`[HP ### 基础组件 基础组件是`HP-Socket`提供的原始组件, 相关使用方法请参考[HP-Socket Doc](https://github.com/ldcsaa/HP-Socket/tree/master/Doc) -*`HPSocket.Net`提供的`Agent`系列组件除`Pack`系列模型外, 包括`ITcpPortForwarding`组件, 都支持设置`http`或`socks5`代理, 以`List`方式设置, 可同时设置多个代理, 组件内部会随机使用, 可以同时混用`http`和`socks5`代理, 使用方法参考各`Agent`组件的`demo`* - ##### TCP + `ITcpServer` + `ITcpAgent` @@ -105,6 +103,8 @@ Nuget软件包中的`libhpsocket4c.dylib`编译自`HP-Socket`的`macOS分支`[HP ## 使用说明 1. 大部分组件使用方法请参考`demo`目录下的工程 2. `HPSocket.Net`的`Easy`扩展组件事件绑定 +3. `HPSocket.Net`提供的`Agent`系列组件除`Pack`系列模型外, 包括`ITcpPortForwarding`组件, 都支持设置`http`或`socks5`代理, 以`List`方式设置, 可同时设置多个代理, 组件内部会随机使用, 可以同时混用`http`和`socks5`代理, 使用方法参考各`Agent`组件的`demo` + #### IHttpEasyServer ```cs // 创建 HttpEasyServer 的实例 -- Gitee From 5787ee79171ebdddb8353be6b8acde82915bf6b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E7=88=B1=E8=8B=B9=E6=9E=9CC?= <842352715@qq.com> Date: Mon, 23 Dec 2019 15:13:39 +0800 Subject: [PATCH 08/10] =?UTF-8?q?Demo.TcpServer-TestEcho=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=B8=ADThreadPool=E6=94=B9=E7=94=A8AsyncQueue=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E5=BC=82=E6=AD=A5=E5=A4=84=E7=90=86=E8=80=97=E6=97=B6?= =?UTF-8?q?=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/Demo.sln | 534 +++++++++--------- .../TextDataReceiveAdapter.cs | 2 +- .../Program-Terminator.cs | 2 +- .../AsyncQueue/AsyncQueue.cs | 71 +++ demo/TcpServer-TestEcho/AsyncQueue/Worker.cs | 56 ++ demo/TcpServer-TestEcho/FormServer.cs | 91 ++- .../TcpServer-TestEcho.csproj | 306 +++++----- 7 files changed, 615 insertions(+), 447 deletions(-) create mode 100644 demo/TcpServer-TestEcho/AsyncQueue/AsyncQueue.cs create mode 100644 demo/TcpServer-TestEcho/AsyncQueue/Worker.cs diff --git a/demo/Demo.sln b/demo/Demo.sln index 844b716..fd42bb5 100644 --- a/demo/Demo.sln +++ b/demo/Demo.sln @@ -1,267 +1,267 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29326.143 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpClient-TestEcho", "TcpClient-TestEcho\TcpClient-TestEcho.csproj", "{C76C5BFC-6741-464D-8C19-1B526F546627}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Models", "Models\Models.csproj", "{EFF012B0-9AF5-46A7-BF05-C1DE109E4785}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpPullServer-TestEcho", "TcpPullServer-TestEcho\TcpPullServer-TestEcho.csproj", "{72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpPullClient-TestEcho", "TcpPullClient-TestEcho\TcpPullClient-TestEcho.csproj", "{C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpPackServer-TestEcho", "TcpPackServer-TestEcho\TcpPackServer-TestEcho.csproj", "{6A4AE1C7-C545-4020-AB44-905D2889D031}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpPackClient-TestEcho", "TcpPackClient-TestEcho\TcpPackClient-TestEcho.csproj", "{F4EDF210-CAB7-412D-B001-F4F210E88C0C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpPackAgent-TestEcho", "TcpPackAgent-TestEcho\TcpPackAgent-TestEcho.csproj", "{2AB65132-8A20-4016-9BA3-9996DC0B3F33}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpPullAgent-TestEcho", "TcpPullAgent-TestEcho\TcpPullAgent-TestEcho.csproj", "{79952989-BB34-47DE-86E1-912225656F75}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpAgent-TestEcho", "TcpAgent-TestEcho\TcpAgent-TestEcho.csproj", "{23376F16-1967-45F7-8E52-4F5A36B94062}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SslAgent-TestEcho", "SslAgent-TestEcho\SslAgent-TestEcho.csproj", "{DE048EE0-40DB-4D11-A216-DA676F458699}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SslClient-TestEcho", "SslClient-TestEcho\SslClient-TestEcho.csproj", "{6F52CBB9-A48F-46D7-8E5E-F631C4E15874}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SslServer-TestEcho", "SslServer-TestEcho\SslServer-TestEcho.csproj", "{B59D79CC-DD24-46AD-BCE5-A2FF802C8336}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebSocketServer-TestEcho", "netcoreapp\WebSocketServer-TestEcho\WebSocketServer-TestEcho.csproj", "{D4D997F5-854E-4B1F-8B08-7983F320032F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebSocketClient-TestEcho", "netcoreapp\WebSocketClient-TestEcho\WebSocketClient-TestEcho.csproj", "{61E0D926-BC61-489F-A6FA-E9EEDD486812}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpPortForwarding", "TcpPortForwarding\TcpPortForwarding.csproj", "{3EEE8931-3B36-409F-9FA5-6A31AE08BB51}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "netcoreapp", "netcoreapp", "{3967FFF0-ED1D-40D0-A169-D04239AA60BC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpServer-TestEcho", "TcpServer-TestEcho\TcpServer-TestEcho.csproj", "{5BC55483-F140-4C87-B6DD-ECA268DEBD9C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpServer-TestEcho-Adapter", "TcpServer-TestEcho-Adapter\TcpServer-TestEcho-Adapter.csproj", "{BB5B3E95-69CF-4867-8C0E-C989525342DA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C76C5BFC-6741-464D-8C19-1B526F546627}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C76C5BFC-6741-464D-8C19-1B526F546627}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C76C5BFC-6741-464D-8C19-1B526F546627}.Debug|x64.ActiveCfg = Debug|x64 - {C76C5BFC-6741-464D-8C19-1B526F546627}.Debug|x64.Build.0 = Debug|x64 - {C76C5BFC-6741-464D-8C19-1B526F546627}.Debug|x86.ActiveCfg = Debug|x86 - {C76C5BFC-6741-464D-8C19-1B526F546627}.Debug|x86.Build.0 = Debug|x86 - {C76C5BFC-6741-464D-8C19-1B526F546627}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C76C5BFC-6741-464D-8C19-1B526F546627}.Release|Any CPU.Build.0 = Release|Any CPU - {C76C5BFC-6741-464D-8C19-1B526F546627}.Release|x64.ActiveCfg = Release|Any CPU - {C76C5BFC-6741-464D-8C19-1B526F546627}.Release|x64.Build.0 = Release|Any CPU - {C76C5BFC-6741-464D-8C19-1B526F546627}.Release|x86.ActiveCfg = Release|Any CPU - {C76C5BFC-6741-464D-8C19-1B526F546627}.Release|x86.Build.0 = Release|Any CPU - {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Debug|x64.ActiveCfg = Debug|Any CPU - {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Debug|x64.Build.0 = Debug|Any CPU - {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Debug|x86.ActiveCfg = Debug|Any CPU - {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Debug|x86.Build.0 = Debug|Any CPU - {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Release|Any CPU.Build.0 = Release|Any CPU - {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Release|x64.ActiveCfg = Release|Any CPU - {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Release|x64.Build.0 = Release|Any CPU - {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Release|x86.ActiveCfg = Release|Any CPU - {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Release|x86.Build.0 = Release|Any CPU - {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Debug|x64.ActiveCfg = Debug|x64 - {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Debug|x64.Build.0 = Debug|x64 - {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Debug|x86.ActiveCfg = Debug|x86 - {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Debug|x86.Build.0 = Debug|x86 - {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Release|Any CPU.Build.0 = Release|Any CPU - {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Release|x64.ActiveCfg = Release|x64 - {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Release|x64.Build.0 = Release|x64 - {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Release|x86.ActiveCfg = Release|x86 - {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Release|x86.Build.0 = Release|x86 - {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Debug|x64.ActiveCfg = Debug|x64 - {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Debug|x64.Build.0 = Debug|x64 - {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Debug|x86.ActiveCfg = Debug|x86 - {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Debug|x86.Build.0 = Debug|x86 - {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Release|Any CPU.Build.0 = Release|Any CPU - {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Release|x64.ActiveCfg = Release|x64 - {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Release|x64.Build.0 = Release|x64 - {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Release|x86.ActiveCfg = Release|x86 - {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Release|x86.Build.0 = Release|x86 - {6A4AE1C7-C545-4020-AB44-905D2889D031}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6A4AE1C7-C545-4020-AB44-905D2889D031}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6A4AE1C7-C545-4020-AB44-905D2889D031}.Debug|x64.ActiveCfg = Debug|x64 - {6A4AE1C7-C545-4020-AB44-905D2889D031}.Debug|x64.Build.0 = Debug|x64 - {6A4AE1C7-C545-4020-AB44-905D2889D031}.Debug|x86.ActiveCfg = Debug|x86 - {6A4AE1C7-C545-4020-AB44-905D2889D031}.Debug|x86.Build.0 = Debug|x86 - {6A4AE1C7-C545-4020-AB44-905D2889D031}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6A4AE1C7-C545-4020-AB44-905D2889D031}.Release|Any CPU.Build.0 = Release|Any CPU - {6A4AE1C7-C545-4020-AB44-905D2889D031}.Release|x64.ActiveCfg = Release|x64 - {6A4AE1C7-C545-4020-AB44-905D2889D031}.Release|x64.Build.0 = Release|x64 - {6A4AE1C7-C545-4020-AB44-905D2889D031}.Release|x86.ActiveCfg = Release|x86 - {6A4AE1C7-C545-4020-AB44-905D2889D031}.Release|x86.Build.0 = Release|x86 - {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Debug|x64.ActiveCfg = Debug|x64 - {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Debug|x64.Build.0 = Debug|x64 - {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Debug|x86.ActiveCfg = Debug|x86 - {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Debug|x86.Build.0 = Debug|x86 - {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Release|Any CPU.Build.0 = Release|Any CPU - {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Release|x64.ActiveCfg = Release|x64 - {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Release|x64.Build.0 = Release|x64 - {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Release|x86.ActiveCfg = Release|x86 - {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Release|x86.Build.0 = Release|x86 - {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Debug|x64.ActiveCfg = Debug|x64 - {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Debug|x64.Build.0 = Debug|x64 - {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Debug|x86.ActiveCfg = Debug|x86 - {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Debug|x86.Build.0 = Debug|x86 - {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Release|Any CPU.Build.0 = Release|Any CPU - {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Release|x64.ActiveCfg = Release|x64 - {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Release|x64.Build.0 = Release|x64 - {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Release|x86.ActiveCfg = Release|x86 - {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Release|x86.Build.0 = Release|x86 - {79952989-BB34-47DE-86E1-912225656F75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {79952989-BB34-47DE-86E1-912225656F75}.Debug|Any CPU.Build.0 = Debug|Any CPU - {79952989-BB34-47DE-86E1-912225656F75}.Debug|x64.ActiveCfg = Debug|x64 - {79952989-BB34-47DE-86E1-912225656F75}.Debug|x64.Build.0 = Debug|x64 - {79952989-BB34-47DE-86E1-912225656F75}.Debug|x86.ActiveCfg = Debug|x86 - {79952989-BB34-47DE-86E1-912225656F75}.Debug|x86.Build.0 = Debug|x86 - {79952989-BB34-47DE-86E1-912225656F75}.Release|Any CPU.ActiveCfg = Release|Any CPU - {79952989-BB34-47DE-86E1-912225656F75}.Release|Any CPU.Build.0 = Release|Any CPU - {79952989-BB34-47DE-86E1-912225656F75}.Release|x64.ActiveCfg = Release|x64 - {79952989-BB34-47DE-86E1-912225656F75}.Release|x64.Build.0 = Release|x64 - {79952989-BB34-47DE-86E1-912225656F75}.Release|x86.ActiveCfg = Release|x86 - {79952989-BB34-47DE-86E1-912225656F75}.Release|x86.Build.0 = Release|x86 - {23376F16-1967-45F7-8E52-4F5A36B94062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {23376F16-1967-45F7-8E52-4F5A36B94062}.Debug|Any CPU.Build.0 = Debug|Any CPU - {23376F16-1967-45F7-8E52-4F5A36B94062}.Debug|x64.ActiveCfg = Debug|x64 - {23376F16-1967-45F7-8E52-4F5A36B94062}.Debug|x64.Build.0 = Debug|x64 - {23376F16-1967-45F7-8E52-4F5A36B94062}.Debug|x86.ActiveCfg = Debug|x86 - {23376F16-1967-45F7-8E52-4F5A36B94062}.Debug|x86.Build.0 = Debug|x86 - {23376F16-1967-45F7-8E52-4F5A36B94062}.Release|Any CPU.ActiveCfg = Release|Any CPU - {23376F16-1967-45F7-8E52-4F5A36B94062}.Release|Any CPU.Build.0 = Release|Any CPU - {23376F16-1967-45F7-8E52-4F5A36B94062}.Release|x64.ActiveCfg = Release|x64 - {23376F16-1967-45F7-8E52-4F5A36B94062}.Release|x64.Build.0 = Release|x64 - {23376F16-1967-45F7-8E52-4F5A36B94062}.Release|x86.ActiveCfg = Release|x86 - {23376F16-1967-45F7-8E52-4F5A36B94062}.Release|x86.Build.0 = Release|x86 - {DE048EE0-40DB-4D11-A216-DA676F458699}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DE048EE0-40DB-4D11-A216-DA676F458699}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DE048EE0-40DB-4D11-A216-DA676F458699}.Debug|x64.ActiveCfg = Debug|x64 - {DE048EE0-40DB-4D11-A216-DA676F458699}.Debug|x64.Build.0 = Debug|x64 - {DE048EE0-40DB-4D11-A216-DA676F458699}.Debug|x86.ActiveCfg = Debug|x86 - {DE048EE0-40DB-4D11-A216-DA676F458699}.Debug|x86.Build.0 = Debug|x86 - {DE048EE0-40DB-4D11-A216-DA676F458699}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DE048EE0-40DB-4D11-A216-DA676F458699}.Release|Any CPU.Build.0 = Release|Any CPU - {DE048EE0-40DB-4D11-A216-DA676F458699}.Release|x64.ActiveCfg = Release|x64 - {DE048EE0-40DB-4D11-A216-DA676F458699}.Release|x64.Build.0 = Release|x64 - {DE048EE0-40DB-4D11-A216-DA676F458699}.Release|x86.ActiveCfg = Release|x86 - {DE048EE0-40DB-4D11-A216-DA676F458699}.Release|x86.Build.0 = Release|x86 - {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Debug|x64.ActiveCfg = Debug|x64 - {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Debug|x64.Build.0 = Debug|x64 - {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Debug|x86.ActiveCfg = Debug|x86 - {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Debug|x86.Build.0 = Debug|x86 - {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Release|Any CPU.Build.0 = Release|Any CPU - {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Release|x64.ActiveCfg = Release|x64 - {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Release|x64.Build.0 = Release|x64 - {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Release|x86.ActiveCfg = Release|x86 - {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Release|x86.Build.0 = Release|x86 - {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Debug|x64.ActiveCfg = Debug|x64 - {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Debug|x64.Build.0 = Debug|x64 - {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Debug|x86.ActiveCfg = Debug|x86 - {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Debug|x86.Build.0 = Debug|x86 - {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Release|Any CPU.Build.0 = Release|Any CPU - {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Release|x64.ActiveCfg = Release|x64 - {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Release|x64.Build.0 = Release|x64 - {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Release|x86.ActiveCfg = Release|x86 - {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Release|x86.Build.0 = Release|x86 - {D4D997F5-854E-4B1F-8B08-7983F320032F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D4D997F5-854E-4B1F-8B08-7983F320032F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D4D997F5-854E-4B1F-8B08-7983F320032F}.Debug|x64.ActiveCfg = Debug|Any CPU - {D4D997F5-854E-4B1F-8B08-7983F320032F}.Debug|x64.Build.0 = Debug|Any CPU - {D4D997F5-854E-4B1F-8B08-7983F320032F}.Debug|x86.ActiveCfg = Debug|Any CPU - {D4D997F5-854E-4B1F-8B08-7983F320032F}.Debug|x86.Build.0 = Debug|Any CPU - {D4D997F5-854E-4B1F-8B08-7983F320032F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D4D997F5-854E-4B1F-8B08-7983F320032F}.Release|Any CPU.Build.0 = Release|Any CPU - {D4D997F5-854E-4B1F-8B08-7983F320032F}.Release|x64.ActiveCfg = Release|Any CPU - {D4D997F5-854E-4B1F-8B08-7983F320032F}.Release|x64.Build.0 = Release|Any CPU - {D4D997F5-854E-4B1F-8B08-7983F320032F}.Release|x86.ActiveCfg = Release|Any CPU - {D4D997F5-854E-4B1F-8B08-7983F320032F}.Release|x86.Build.0 = Release|Any CPU - {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Debug|Any CPU.Build.0 = Debug|Any CPU - {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Debug|x64.ActiveCfg = Debug|Any CPU - {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Debug|x64.Build.0 = Debug|Any CPU - {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Debug|x86.ActiveCfg = Debug|Any CPU - {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Debug|x86.Build.0 = Debug|Any CPU - {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Release|Any CPU.ActiveCfg = Release|Any CPU - {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Release|Any CPU.Build.0 = Release|Any CPU - {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Release|x64.ActiveCfg = Release|Any CPU - {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Release|x64.Build.0 = Release|Any CPU - {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Release|x86.ActiveCfg = Release|Any CPU - {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Release|x86.Build.0 = Release|Any CPU - {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Debug|x64.ActiveCfg = Debug|x64 - {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Debug|x64.Build.0 = Debug|x64 - {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Debug|x86.ActiveCfg = Debug|x86 - {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Debug|x86.Build.0 = Debug|x86 - {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Release|Any CPU.Build.0 = Release|Any CPU - {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Release|x64.ActiveCfg = Release|x64 - {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Release|x64.Build.0 = Release|x64 - {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Release|x86.ActiveCfg = Release|x86 - {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Release|x86.Build.0 = Release|x86 - {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Debug|x64.ActiveCfg = Debug|x64 - {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Debug|x64.Build.0 = Debug|x64 - {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Debug|x86.ActiveCfg = Debug|x86 - {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Debug|x86.Build.0 = Debug|x86 - {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Release|Any CPU.Build.0 = Release|Any CPU - {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Release|x64.ActiveCfg = Release|x64 - {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Release|x64.Build.0 = Release|x64 - {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Release|x86.ActiveCfg = Release|x86 - {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Release|x86.Build.0 = Release|x86 - {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Debug|x64.ActiveCfg = Debug|Any CPU - {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Debug|x64.Build.0 = Debug|Any CPU - {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Debug|x86.ActiveCfg = Debug|Any CPU - {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Debug|x86.Build.0 = Debug|Any CPU - {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Release|Any CPU.Build.0 = Release|Any CPU - {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Release|x64.ActiveCfg = Release|Any CPU - {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Release|x64.Build.0 = Release|Any CPU - {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Release|x86.ActiveCfg = Release|Any CPU - {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {D4D997F5-854E-4B1F-8B08-7983F320032F} = {3967FFF0-ED1D-40D0-A169-D04239AA60BC} - {61E0D926-BC61-489F-A6FA-E9EEDD486812} = {3967FFF0-ED1D-40D0-A169-D04239AA60BC} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {3B39A216-F902-4215-8555-BD292219247C} - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29326.143 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpClient-TestEcho", "TcpClient-TestEcho\TcpClient-TestEcho.csproj", "{C76C5BFC-6741-464D-8C19-1B526F546627}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Models", "Models\Models.csproj", "{EFF012B0-9AF5-46A7-BF05-C1DE109E4785}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpPullServer-TestEcho", "TcpPullServer-TestEcho\TcpPullServer-TestEcho.csproj", "{72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpPullClient-TestEcho", "TcpPullClient-TestEcho\TcpPullClient-TestEcho.csproj", "{C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpPackServer-TestEcho", "TcpPackServer-TestEcho\TcpPackServer-TestEcho.csproj", "{6A4AE1C7-C545-4020-AB44-905D2889D031}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpPackClient-TestEcho", "TcpPackClient-TestEcho\TcpPackClient-TestEcho.csproj", "{F4EDF210-CAB7-412D-B001-F4F210E88C0C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpPackAgent-TestEcho", "TcpPackAgent-TestEcho\TcpPackAgent-TestEcho.csproj", "{2AB65132-8A20-4016-9BA3-9996DC0B3F33}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpPullAgent-TestEcho", "TcpPullAgent-TestEcho\TcpPullAgent-TestEcho.csproj", "{79952989-BB34-47DE-86E1-912225656F75}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpAgent-TestEcho", "TcpAgent-TestEcho\TcpAgent-TestEcho.csproj", "{23376F16-1967-45F7-8E52-4F5A36B94062}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SslAgent-TestEcho", "SslAgent-TestEcho\SslAgent-TestEcho.csproj", "{DE048EE0-40DB-4D11-A216-DA676F458699}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SslClient-TestEcho", "SslClient-TestEcho\SslClient-TestEcho.csproj", "{6F52CBB9-A48F-46D7-8E5E-F631C4E15874}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SslServer-TestEcho", "SslServer-TestEcho\SslServer-TestEcho.csproj", "{B59D79CC-DD24-46AD-BCE5-A2FF802C8336}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebSocketServer-TestEcho", "netcoreapp\WebSocketServer-TestEcho\WebSocketServer-TestEcho.csproj", "{D4D997F5-854E-4B1F-8B08-7983F320032F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebSocketClient-TestEcho", "netcoreapp\WebSocketClient-TestEcho\WebSocketClient-TestEcho.csproj", "{61E0D926-BC61-489F-A6FA-E9EEDD486812}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpPortForwarding", "TcpPortForwarding\TcpPortForwarding.csproj", "{3EEE8931-3B36-409F-9FA5-6A31AE08BB51}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "netcoreapp", "netcoreapp", "{3967FFF0-ED1D-40D0-A169-D04239AA60BC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpServer-TestEcho", "TcpServer-TestEcho\TcpServer-TestEcho.csproj", "{5BC55483-F140-4C87-B6DD-ECA268DEBD9C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TcpServer-TestEcho-Adapter", "TcpServer-TestEcho-Adapter\TcpServer-TestEcho-Adapter.csproj", "{BB5B3E95-69CF-4867-8C0E-C989525342DA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C76C5BFC-6741-464D-8C19-1B526F546627}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C76C5BFC-6741-464D-8C19-1B526F546627}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C76C5BFC-6741-464D-8C19-1B526F546627}.Debug|x64.ActiveCfg = Debug|x64 + {C76C5BFC-6741-464D-8C19-1B526F546627}.Debug|x64.Build.0 = Debug|x64 + {C76C5BFC-6741-464D-8C19-1B526F546627}.Debug|x86.ActiveCfg = Debug|x86 + {C76C5BFC-6741-464D-8C19-1B526F546627}.Debug|x86.Build.0 = Debug|x86 + {C76C5BFC-6741-464D-8C19-1B526F546627}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C76C5BFC-6741-464D-8C19-1B526F546627}.Release|Any CPU.Build.0 = Release|Any CPU + {C76C5BFC-6741-464D-8C19-1B526F546627}.Release|x64.ActiveCfg = Release|Any CPU + {C76C5BFC-6741-464D-8C19-1B526F546627}.Release|x64.Build.0 = Release|Any CPU + {C76C5BFC-6741-464D-8C19-1B526F546627}.Release|x86.ActiveCfg = Release|Any CPU + {C76C5BFC-6741-464D-8C19-1B526F546627}.Release|x86.Build.0 = Release|Any CPU + {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Debug|x64.ActiveCfg = Debug|Any CPU + {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Debug|x64.Build.0 = Debug|Any CPU + {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Debug|x86.ActiveCfg = Debug|Any CPU + {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Debug|x86.Build.0 = Debug|Any CPU + {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Release|Any CPU.Build.0 = Release|Any CPU + {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Release|x64.ActiveCfg = Release|Any CPU + {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Release|x64.Build.0 = Release|Any CPU + {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Release|x86.ActiveCfg = Release|Any CPU + {EFF012B0-9AF5-46A7-BF05-C1DE109E4785}.Release|x86.Build.0 = Release|Any CPU + {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Debug|x64.ActiveCfg = Debug|x64 + {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Debug|x64.Build.0 = Debug|x64 + {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Debug|x86.ActiveCfg = Debug|x86 + {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Debug|x86.Build.0 = Debug|x86 + {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Release|Any CPU.Build.0 = Release|Any CPU + {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Release|x64.ActiveCfg = Release|x64 + {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Release|x64.Build.0 = Release|x64 + {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Release|x86.ActiveCfg = Release|x86 + {72D403A8-024D-4DE1-BB1C-CFEE7C42EAD1}.Release|x86.Build.0 = Release|x86 + {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Debug|x64.ActiveCfg = Debug|x64 + {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Debug|x64.Build.0 = Debug|x64 + {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Debug|x86.ActiveCfg = Debug|x86 + {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Debug|x86.Build.0 = Debug|x86 + {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Release|Any CPU.Build.0 = Release|Any CPU + {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Release|x64.ActiveCfg = Release|x64 + {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Release|x64.Build.0 = Release|x64 + {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Release|x86.ActiveCfg = Release|x86 + {C972F0FD-5CB6-4BE4-850E-DD6BDEB681ED}.Release|x86.Build.0 = Release|x86 + {6A4AE1C7-C545-4020-AB44-905D2889D031}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6A4AE1C7-C545-4020-AB44-905D2889D031}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6A4AE1C7-C545-4020-AB44-905D2889D031}.Debug|x64.ActiveCfg = Debug|x64 + {6A4AE1C7-C545-4020-AB44-905D2889D031}.Debug|x64.Build.0 = Debug|x64 + {6A4AE1C7-C545-4020-AB44-905D2889D031}.Debug|x86.ActiveCfg = Debug|x86 + {6A4AE1C7-C545-4020-AB44-905D2889D031}.Debug|x86.Build.0 = Debug|x86 + {6A4AE1C7-C545-4020-AB44-905D2889D031}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6A4AE1C7-C545-4020-AB44-905D2889D031}.Release|Any CPU.Build.0 = Release|Any CPU + {6A4AE1C7-C545-4020-AB44-905D2889D031}.Release|x64.ActiveCfg = Release|x64 + {6A4AE1C7-C545-4020-AB44-905D2889D031}.Release|x64.Build.0 = Release|x64 + {6A4AE1C7-C545-4020-AB44-905D2889D031}.Release|x86.ActiveCfg = Release|x86 + {6A4AE1C7-C545-4020-AB44-905D2889D031}.Release|x86.Build.0 = Release|x86 + {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Debug|x64.ActiveCfg = Debug|x64 + {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Debug|x64.Build.0 = Debug|x64 + {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Debug|x86.ActiveCfg = Debug|x86 + {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Debug|x86.Build.0 = Debug|x86 + {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Release|Any CPU.Build.0 = Release|Any CPU + {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Release|x64.ActiveCfg = Release|x64 + {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Release|x64.Build.0 = Release|x64 + {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Release|x86.ActiveCfg = Release|x86 + {F4EDF210-CAB7-412D-B001-F4F210E88C0C}.Release|x86.Build.0 = Release|x86 + {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Debug|x64.ActiveCfg = Debug|x64 + {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Debug|x64.Build.0 = Debug|x64 + {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Debug|x86.ActiveCfg = Debug|x86 + {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Debug|x86.Build.0 = Debug|x86 + {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Release|Any CPU.Build.0 = Release|Any CPU + {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Release|x64.ActiveCfg = Release|x64 + {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Release|x64.Build.0 = Release|x64 + {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Release|x86.ActiveCfg = Release|x86 + {2AB65132-8A20-4016-9BA3-9996DC0B3F33}.Release|x86.Build.0 = Release|x86 + {79952989-BB34-47DE-86E1-912225656F75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {79952989-BB34-47DE-86E1-912225656F75}.Debug|Any CPU.Build.0 = Debug|Any CPU + {79952989-BB34-47DE-86E1-912225656F75}.Debug|x64.ActiveCfg = Debug|x64 + {79952989-BB34-47DE-86E1-912225656F75}.Debug|x64.Build.0 = Debug|x64 + {79952989-BB34-47DE-86E1-912225656F75}.Debug|x86.ActiveCfg = Debug|x86 + {79952989-BB34-47DE-86E1-912225656F75}.Debug|x86.Build.0 = Debug|x86 + {79952989-BB34-47DE-86E1-912225656F75}.Release|Any CPU.ActiveCfg = Release|Any CPU + {79952989-BB34-47DE-86E1-912225656F75}.Release|Any CPU.Build.0 = Release|Any CPU + {79952989-BB34-47DE-86E1-912225656F75}.Release|x64.ActiveCfg = Release|x64 + {79952989-BB34-47DE-86E1-912225656F75}.Release|x64.Build.0 = Release|x64 + {79952989-BB34-47DE-86E1-912225656F75}.Release|x86.ActiveCfg = Release|x86 + {79952989-BB34-47DE-86E1-912225656F75}.Release|x86.Build.0 = Release|x86 + {23376F16-1967-45F7-8E52-4F5A36B94062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23376F16-1967-45F7-8E52-4F5A36B94062}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23376F16-1967-45F7-8E52-4F5A36B94062}.Debug|x64.ActiveCfg = Debug|x64 + {23376F16-1967-45F7-8E52-4F5A36B94062}.Debug|x64.Build.0 = Debug|x64 + {23376F16-1967-45F7-8E52-4F5A36B94062}.Debug|x86.ActiveCfg = Debug|x86 + {23376F16-1967-45F7-8E52-4F5A36B94062}.Debug|x86.Build.0 = Debug|x86 + {23376F16-1967-45F7-8E52-4F5A36B94062}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23376F16-1967-45F7-8E52-4F5A36B94062}.Release|Any CPU.Build.0 = Release|Any CPU + {23376F16-1967-45F7-8E52-4F5A36B94062}.Release|x64.ActiveCfg = Release|x64 + {23376F16-1967-45F7-8E52-4F5A36B94062}.Release|x64.Build.0 = Release|x64 + {23376F16-1967-45F7-8E52-4F5A36B94062}.Release|x86.ActiveCfg = Release|x86 + {23376F16-1967-45F7-8E52-4F5A36B94062}.Release|x86.Build.0 = Release|x86 + {DE048EE0-40DB-4D11-A216-DA676F458699}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DE048EE0-40DB-4D11-A216-DA676F458699}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DE048EE0-40DB-4D11-A216-DA676F458699}.Debug|x64.ActiveCfg = Debug|x64 + {DE048EE0-40DB-4D11-A216-DA676F458699}.Debug|x64.Build.0 = Debug|x64 + {DE048EE0-40DB-4D11-A216-DA676F458699}.Debug|x86.ActiveCfg = Debug|x86 + {DE048EE0-40DB-4D11-A216-DA676F458699}.Debug|x86.Build.0 = Debug|x86 + {DE048EE0-40DB-4D11-A216-DA676F458699}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DE048EE0-40DB-4D11-A216-DA676F458699}.Release|Any CPU.Build.0 = Release|Any CPU + {DE048EE0-40DB-4D11-A216-DA676F458699}.Release|x64.ActiveCfg = Release|x64 + {DE048EE0-40DB-4D11-A216-DA676F458699}.Release|x64.Build.0 = Release|x64 + {DE048EE0-40DB-4D11-A216-DA676F458699}.Release|x86.ActiveCfg = Release|x86 + {DE048EE0-40DB-4D11-A216-DA676F458699}.Release|x86.Build.0 = Release|x86 + {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Debug|x64.ActiveCfg = Debug|x64 + {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Debug|x64.Build.0 = Debug|x64 + {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Debug|x86.ActiveCfg = Debug|x86 + {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Debug|x86.Build.0 = Debug|x86 + {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Release|Any CPU.Build.0 = Release|Any CPU + {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Release|x64.ActiveCfg = Release|x64 + {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Release|x64.Build.0 = Release|x64 + {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Release|x86.ActiveCfg = Release|x86 + {6F52CBB9-A48F-46D7-8E5E-F631C4E15874}.Release|x86.Build.0 = Release|x86 + {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Debug|x64.ActiveCfg = Debug|x64 + {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Debug|x64.Build.0 = Debug|x64 + {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Debug|x86.ActiveCfg = Debug|x86 + {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Debug|x86.Build.0 = Debug|x86 + {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Release|Any CPU.Build.0 = Release|Any CPU + {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Release|x64.ActiveCfg = Release|x64 + {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Release|x64.Build.0 = Release|x64 + {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Release|x86.ActiveCfg = Release|x86 + {B59D79CC-DD24-46AD-BCE5-A2FF802C8336}.Release|x86.Build.0 = Release|x86 + {D4D997F5-854E-4B1F-8B08-7983F320032F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D4D997F5-854E-4B1F-8B08-7983F320032F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D4D997F5-854E-4B1F-8B08-7983F320032F}.Debug|x64.ActiveCfg = Debug|Any CPU + {D4D997F5-854E-4B1F-8B08-7983F320032F}.Debug|x64.Build.0 = Debug|Any CPU + {D4D997F5-854E-4B1F-8B08-7983F320032F}.Debug|x86.ActiveCfg = Debug|Any CPU + {D4D997F5-854E-4B1F-8B08-7983F320032F}.Debug|x86.Build.0 = Debug|Any CPU + {D4D997F5-854E-4B1F-8B08-7983F320032F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D4D997F5-854E-4B1F-8B08-7983F320032F}.Release|Any CPU.Build.0 = Release|Any CPU + {D4D997F5-854E-4B1F-8B08-7983F320032F}.Release|x64.ActiveCfg = Release|Any CPU + {D4D997F5-854E-4B1F-8B08-7983F320032F}.Release|x64.Build.0 = Release|Any CPU + {D4D997F5-854E-4B1F-8B08-7983F320032F}.Release|x86.ActiveCfg = Release|Any CPU + {D4D997F5-854E-4B1F-8B08-7983F320032F}.Release|x86.Build.0 = Release|Any CPU + {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Debug|Any CPU.Build.0 = Debug|Any CPU + {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Debug|x64.ActiveCfg = Debug|Any CPU + {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Debug|x64.Build.0 = Debug|Any CPU + {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Debug|x86.ActiveCfg = Debug|Any CPU + {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Debug|x86.Build.0 = Debug|Any CPU + {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Release|Any CPU.ActiveCfg = Release|Any CPU + {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Release|Any CPU.Build.0 = Release|Any CPU + {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Release|x64.ActiveCfg = Release|Any CPU + {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Release|x64.Build.0 = Release|Any CPU + {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Release|x86.ActiveCfg = Release|Any CPU + {61E0D926-BC61-489F-A6FA-E9EEDD486812}.Release|x86.Build.0 = Release|Any CPU + {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Debug|x64.ActiveCfg = Debug|x64 + {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Debug|x64.Build.0 = Debug|x64 + {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Debug|x86.ActiveCfg = Debug|x86 + {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Debug|x86.Build.0 = Debug|x86 + {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Release|Any CPU.Build.0 = Release|Any CPU + {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Release|x64.ActiveCfg = Release|x64 + {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Release|x64.Build.0 = Release|x64 + {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Release|x86.ActiveCfg = Release|x86 + {3EEE8931-3B36-409F-9FA5-6A31AE08BB51}.Release|x86.Build.0 = Release|x86 + {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Debug|x64.ActiveCfg = Debug|x64 + {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Debug|x64.Build.0 = Debug|x64 + {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Debug|x86.ActiveCfg = Debug|x86 + {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Debug|x86.Build.0 = Debug|x86 + {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Release|Any CPU.Build.0 = Release|Any CPU + {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Release|x64.ActiveCfg = Release|x64 + {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Release|x64.Build.0 = Release|x64 + {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Release|x86.ActiveCfg = Release|x86 + {5BC55483-F140-4C87-B6DD-ECA268DEBD9C}.Release|x86.Build.0 = Release|x86 + {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Debug|x64.ActiveCfg = Debug|Any CPU + {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Debug|x64.Build.0 = Debug|Any CPU + {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Debug|x86.ActiveCfg = Debug|Any CPU + {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Debug|x86.Build.0 = Debug|Any CPU + {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Release|Any CPU.Build.0 = Release|Any CPU + {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Release|x64.ActiveCfg = Release|Any CPU + {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Release|x64.Build.0 = Release|Any CPU + {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Release|x86.ActiveCfg = Release|Any CPU + {BB5B3E95-69CF-4867-8C0E-C989525342DA}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {D4D997F5-854E-4B1F-8B08-7983F320032F} = {3967FFF0-ED1D-40D0-A169-D04239AA60BC} + {61E0D926-BC61-489F-A6FA-E9EEDD486812} = {3967FFF0-ED1D-40D0-A169-D04239AA60BC} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3B39A216-F902-4215-8555-BD292219247C} + EndGlobalSection +EndGlobal diff --git a/demo/TcpServer-TestEcho-Adapter/DataReceiveAdapter/TextDataReceiveAdapter.cs b/demo/TcpServer-TestEcho-Adapter/DataReceiveAdapter/TextDataReceiveAdapter.cs index 6770a3a..fc35f6f 100644 --- a/demo/TcpServer-TestEcho-Adapter/DataReceiveAdapter/TextDataReceiveAdapter.cs +++ b/demo/TcpServer-TestEcho-Adapter/DataReceiveAdapter/TextDataReceiveAdapter.cs @@ -4,7 +4,7 @@ using HPSocket.Adapter; namespace TcpServerTestEchoAdapter.DataReceiveAdapter { /// - /// 定长包数据接收适配器 + /// 指定终止符包数据接收适配器 /// public class TextDataReceiveAdapter : TerminatorDataReceiveAdapter { diff --git a/demo/TcpServer-TestEcho-Adapter/Program-Terminator.cs b/demo/TcpServer-TestEcho-Adapter/Program-Terminator.cs index c4ac02e..db4b33f 100644 --- a/demo/TcpServer-TestEcho-Adapter/Program-Terminator.cs +++ b/demo/TcpServer-TestEcho-Adapter/Program-Terminator.cs @@ -6,7 +6,7 @@ using TcpServerTestEchoAdapter.DataReceiveAdapter; namespace TcpServerTestEchoAdapter { /// - /// 定长包数据适配器示例 + /// 指定终止符数据适配器示例 /// class ProgramTerminator { diff --git a/demo/TcpServer-TestEcho/AsyncQueue/AsyncQueue.cs b/demo/TcpServer-TestEcho/AsyncQueue/AsyncQueue.cs new file mode 100644 index 0000000..9473005 --- /dev/null +++ b/demo/TcpServer-TestEcho/AsyncQueue/AsyncQueue.cs @@ -0,0 +1,71 @@ +#if !NET20 +using System; +using System.Collections.Concurrent; +using System.Threading; + +namespace HPSocket.AsyncQueue +{ + /// + /// 多消费者异步消费队列 + /// + /// + public class AsyncQueue : IDisposable + { + #region 私有 + /// + /// 数据操作类 + /// + private ConcurrentBag> workers { get; set; } + /// + /// 消费队列实体 + /// + private BlockingCollection queue { get; set; } + /// + /// 控制线程令牌源 + /// + private CancellationTokenSource cts { get; set; } + #endregion + /// + /// 构造方法 + /// + /// 消费者数量 + /// 任务处理函数 + public AsyncQueue(uint consumerCount, Action taskProc) + { + if (consumerCount == 0) { throw new ArgumentException($"{nameof(consumerCount)} must be > 0"); } + if (taskProc == null) { throw new ArgumentNullException($"{nameof(taskProc)} must not be null"); } + workers = new ConcurrentBag>(); + queue = new BlockingCollection(); + cts = new CancellationTokenSource(); + for (var i = 0; i < consumerCount; i++) + { + workers.Add(new Worker(queue, taskProc, cts.Token)); + } + } + /// + /// 剩余数据数量 + /// + /// + public int Count { get => this.queue.Count; } + /// + /// 队列添加数据 + /// + /// 数据实体 + /// 成功返回true,失败返回false + public bool Enqueue(T item) => this.queue.TryAdd(item); + /// + /// 停止消费 + /// + public void Shutdown() + { + this.cts.Cancel(); + while (!this.workers.IsEmpty) + { + Worker w; + this.workers.TryTake(out w); + } + } + public void Dispose() => Shutdown(); + } +} +#endif \ No newline at end of file diff --git a/demo/TcpServer-TestEcho/AsyncQueue/Worker.cs b/demo/TcpServer-TestEcho/AsyncQueue/Worker.cs new file mode 100644 index 0000000..2863524 --- /dev/null +++ b/demo/TcpServer-TestEcho/AsyncQueue/Worker.cs @@ -0,0 +1,56 @@ +#if !NET20 +using System; +using System.Collections.Concurrent; +using System.Threading; +using System.Threading.Tasks; + +namespace HPSocket.AsyncQueue +{ + public class Worker + { + /// + /// 消费队列实体 + /// + private readonly BlockingCollection collection; + /// + /// 任务处理函数 + /// + private readonly Action taskProc; + /// + /// 控制线程令牌 + /// + private CancellationToken ct { get; set; } + /// + /// 构造方法 + /// + /// 消费队列实体 + /// 任务处理函数 + /// + public Worker(BlockingCollection collection, Action taskProc, CancellationToken ct) + { + this.collection = collection ?? throw new ArgumentNullException(nameof(collection)); + this.taskProc = taskProc ?? throw new ArgumentNullException(nameof(taskProc)); + this.ct = ct; + Task.Factory.StartNew(this.DoWork, ct); + } + /// + /// 消费数据方法 + /// + private void DoWork() + { + while (!this.ct.IsCancellationRequested) + { + try + { + var item = this.collection.Take(this.ct); + this.taskProc?.Invoke(item); + } + catch (OperationCanceledException) + { + //令牌已取消 + } + } + } + } +} +#endif \ No newline at end of file diff --git a/demo/TcpServer-TestEcho/FormServer.cs b/demo/TcpServer-TestEcho/FormServer.cs index 5332c07..a9a2aee 100644 --- a/demo/TcpServer-TestEcho/FormServer.cs +++ b/demo/TcpServer-TestEcho/FormServer.cs @@ -1,16 +1,21 @@ -using System; +//#define ThreadPool +#define AsyncQueue +using System; using System.Collections.Generic; using System.Text; using System.Threading; using System.Windows.Forms; using HPSocket; using HPSocket.Tcp; -using HPSocket.Thread; using Models; using Newtonsoft.Json; -using ThreadPool = HPSocket.Thread.ThreadPool; using Timer = System.Timers.Timer; - +#if ThreadPool +using HPSocket.Thread; +using ThreadPool = HPSocket.Thread.ThreadPool; +#elif AsyncQueue +using HPSocket.AsyncQueue; +#endif namespace TcpServerTestEcho { public partial class FormServer : Form @@ -18,13 +23,18 @@ namespace TcpServerTestEcho delegate void AddLogHandler(string log); #pragma warning disable IDE0069 // 应释放可释放的字段 - private readonly ITcpServer _server = new TcpServer(); - + private readonly ITcpServer _server = new TcpServer(); +#if ThreadPool /// /// 线程池 /// private readonly ThreadPool _threadPool = new ThreadPool(); - +#elif AsyncQueue + /// + /// 异步消费者队列 + /// + private AsyncQueue _asyncQueue; +#endif /// /// 定时器 /// @@ -34,12 +44,12 @@ namespace TcpServerTestEcho }; #pragma warning restore IDE0069 // 应释放可释放的字段 - +#if ThreadPool /// /// 线程池回调函数 /// private TaskProcEx _taskTaskProc; - +#endif /// /// 最大封包长度 /// @@ -68,9 +78,9 @@ namespace TcpServerTestEcho _server.OnAccept += OnAccept; _server.OnReceive += OnReceive; _server.OnClose += OnClose; - _server.OnShutdown += OnShutdown; - - + _server.OnShutdown += OnShutdown; + +#if ThreadPool // 线程池相关设置 // 线程池回调函数 _taskTaskProc = TaskTaskProc; @@ -83,6 +93,19 @@ namespace TcpServerTestEcho AddLog($"线程池当前在执行的任务数: {_threadPool.TaskCount}, 任务队列数: {_threadPool.QueueSize}"); } }; +#elif AsyncQueue + uint ConsumerCount = 2; + _asyncQueue = new AsyncQueue(ConsumerCount, TaskTaskProc); + + // 定时输出线程池任务数 + _timer.Elapsed += (_, args) => + { + if (_server.HasStarted) + { + AddLog($"异步消费者队列的消费者数: {ConsumerCount}, 未执行任务队列数: {_asyncQueue.Count}"); + } + }; +#endif _timer.Start(); } @@ -90,13 +113,18 @@ namespace TcpServerTestEcho { if (_server.HasStarted) { - MessageBox.Show(@"请先停止服务", @"服务正在运行:", MessageBoxButtons.OK, MessageBoxIcon.Warning); + MessageBox.Show(@"请先停止服务", @"服务正在运行:", MessageBoxButtons.OK, MessageBoxIcon.Warning); +#if AsyncQueue + _asyncQueue.Shutdown(); +#endif e.Cancel = true; return; } +#if ThreadPool // 停止并释放线程池, 会等待所有任务结束 _threadPool.Dispose(); +#endif // 停止并释放定时器 _timer.Stop(); @@ -285,10 +313,15 @@ namespace TcpServerTestEcho break; } case PacketType.Time: // 假如获取服务器时间是耗时操作, 将该操作放入队列 - { + { +#if ThreadPool // 向线程池提交任务 if (!_threadPool.Submit(_taskTaskProc, new TaskInfo - { +#elif AsyncQueue + // 向异步队列添加数据 + if (!_asyncQueue.Enqueue(new TaskInfo +#endif + { Client = client, Packet = packet, })) @@ -303,19 +336,23 @@ namespace TcpServerTestEcho break; } return result; - } - + } + /// /// 线程池任务回调函数 /// /// 任务参数 +#if ThreadPool private void TaskTaskProc(object obj) { if (!(obj is TaskInfo taskInfo)) { return; } - +#elif AsyncQueue + private void TaskTaskProc(TaskInfo taskInfo) + { +#endif // 如果连接已经断开了(可能被踢了) // 它的任务就不做了(根据自己业务需求来, 也许你的任务就是要完成每个连接的所有任务, 每个包都要处理, 不管连接断开与否, 就不要写这个判断, 但是你回发包的时候要判断是否有效连接) if (!_server.IsConnected(taskInfo.Client.ConnId)) @@ -391,14 +428,15 @@ namespace TcpServerTestEcho try { if (btnSwitchService.Text == @"启动") - { - // 2个线程处理耗时操作, 作为相对耗时的任务, 可根据业务需求多开线程处理 + { +#if ThreadPool + // 2个线程处理耗时操作, 作为相对耗时的任务, 可根据业务需求多开线程处理 if (!_threadPool.Start(2, RejectedPolicy.WaitFor)) { btnSwitchService.Enabled = false; throw new Exception($"线程池启动失败, 错误码: {_threadPool.ErrorCode}"); } - +#endif // 启动服务 if (!_server.Start()) { @@ -406,10 +444,10 @@ namespace TcpServerTestEcho } btnSwitchService.Text = @"停止"; - +#if ThreadPool // 等待线程池停止 await _threadPool.WaitAsync(); - +#endif // 等待服务停止 await _server.WaitAsync(); @@ -420,11 +458,12 @@ namespace TcpServerTestEcho } else { - btnSwitchService.Enabled = false; + btnSwitchService.Enabled = false; +#if ThreadPool // 停止并等待线程池任务全部完成 await _threadPool.StopAsync(); - - // 等待服务停止 +#endif + // 等待服务停止 await _server.StopAsync(); } } diff --git a/demo/TcpServer-TestEcho/TcpServer-TestEcho.csproj b/demo/TcpServer-TestEcho/TcpServer-TestEcho.csproj index cd26fd8..7b4d0eb 100644 --- a/demo/TcpServer-TestEcho/TcpServer-TestEcho.csproj +++ b/demo/TcpServer-TestEcho/TcpServer-TestEcho.csproj @@ -1,153 +1,155 @@ - - - - - Debug - AnyCPU - {5BC55483-F140-4C87-B6DD-ECA268DEBD9C} - WinExe - TcpServerTestEcho - TcpServer-TestEcho - v4.8 - 512 - true - - - - - - AnyCPU - true - full - false - ..\Bin\ - DEBUG;TRACE - prompt - 4 - false - - - AnyCPU - pdbonly - true - ..\Bin\ - TRACE - prompt - 4 - false - - - app.manifest - - - true - ..\Bin\ - DEBUG;TRACE - full - x64 - 7.3 - prompt - MinimumRecommendedRules.ruleset - - - ..\Bin\ - TRACE - true - pdbonly - x64 - 7.3 - prompt - MinimumRecommendedRules.ruleset - - - true - ..\Bin\ - DEBUG;TRACE - full - x86 - 7.3 - prompt - MinimumRecommendedRules.ruleset - - - ..\Bin\ - TRACE - true - pdbonly - x86 - 7.3 - prompt - MinimumRecommendedRules.ruleset - - - - ..\packages\HPSocket.Net.5.7.1-rc2\lib\net48\HPSocket.Net.dll - - - ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - - - - - - - - - - - - - - Form - - - FormServer.cs - - - - - FormServer.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - {eff012b0-9af5-46a7-bf05-c1de109e4785} - Models - - - - - - - - - - - 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 - - - + + + + + Debug + AnyCPU + {5BC55483-F140-4C87-B6DD-ECA268DEBD9C} + WinExe + TcpServerTestEcho + TcpServer-TestEcho + v4.8 + 512 + true + + + + + + AnyCPU + true + full + false + ..\Bin\ + DEBUG;TRACE + prompt + 4 + false + + + AnyCPU + pdbonly + true + ..\Bin\ + TRACE + prompt + 4 + false + + + app.manifest + + + true + ..\Bin\ + DEBUG;TRACE + full + x64 + 7.3 + prompt + MinimumRecommendedRules.ruleset + + + ..\Bin\ + TRACE + true + pdbonly + x64 + 7.3 + prompt + MinimumRecommendedRules.ruleset + + + true + ..\Bin\ + DEBUG;TRACE + full + x86 + 7.3 + prompt + MinimumRecommendedRules.ruleset + + + ..\Bin\ + TRACE + true + pdbonly + x86 + 7.3 + prompt + MinimumRecommendedRules.ruleset + + + + ..\packages\HPSocket.Net.5.7.1-rc2\lib\net48\HPSocket.Net.dll + + + ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + + + + + + + + + + + + + + + + Form + + + FormServer.cs + + + + + FormServer.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {eff012b0-9af5-46a7-bf05-c1de109e4785} + Models + + + + + + + + + + + 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 + + + \ No newline at end of file -- Gitee From 088ead97136759413a2d9fd7fca799af597b3785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E7=88=B1=E8=8B=B9=E6=9E=9CC?= <842352715@qq.com> Date: Mon, 23 Dec 2019 15:26:42 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BC=82=E6=AD=A5?= =?UTF-8?q?=E6=B6=88=E8=B4=B9=E8=80=85=E9=98=9F=E5=88=97=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=8C=E5=8F=AF=E4=BB=A3=E6=9B=BF=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B=E6=B1=A0=E6=96=B9=E5=BC=8F=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/HPSocket.Net/AsyncQueue/AsyncQueue.cs | 71 +++++++++++++++++++++++ src/HPSocket.Net/AsyncQueue/Worker.cs | 56 ++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 src/HPSocket.Net/AsyncQueue/AsyncQueue.cs create mode 100644 src/HPSocket.Net/AsyncQueue/Worker.cs diff --git a/src/HPSocket.Net/AsyncQueue/AsyncQueue.cs b/src/HPSocket.Net/AsyncQueue/AsyncQueue.cs new file mode 100644 index 0000000..9473005 --- /dev/null +++ b/src/HPSocket.Net/AsyncQueue/AsyncQueue.cs @@ -0,0 +1,71 @@ +#if !NET20 +using System; +using System.Collections.Concurrent; +using System.Threading; + +namespace HPSocket.AsyncQueue +{ + /// + /// 多消费者异步消费队列 + /// + /// + public class AsyncQueue : IDisposable + { + #region 私有 + /// + /// 数据操作类 + /// + private ConcurrentBag> workers { get; set; } + /// + /// 消费队列实体 + /// + private BlockingCollection queue { get; set; } + /// + /// 控制线程令牌源 + /// + private CancellationTokenSource cts { get; set; } + #endregion + /// + /// 构造方法 + /// + /// 消费者数量 + /// 任务处理函数 + public AsyncQueue(uint consumerCount, Action taskProc) + { + if (consumerCount == 0) { throw new ArgumentException($"{nameof(consumerCount)} must be > 0"); } + if (taskProc == null) { throw new ArgumentNullException($"{nameof(taskProc)} must not be null"); } + workers = new ConcurrentBag>(); + queue = new BlockingCollection(); + cts = new CancellationTokenSource(); + for (var i = 0; i < consumerCount; i++) + { + workers.Add(new Worker(queue, taskProc, cts.Token)); + } + } + /// + /// 剩余数据数量 + /// + /// + public int Count { get => this.queue.Count; } + /// + /// 队列添加数据 + /// + /// 数据实体 + /// 成功返回true,失败返回false + public bool Enqueue(T item) => this.queue.TryAdd(item); + /// + /// 停止消费 + /// + public void Shutdown() + { + this.cts.Cancel(); + while (!this.workers.IsEmpty) + { + Worker w; + this.workers.TryTake(out w); + } + } + public void Dispose() => Shutdown(); + } +} +#endif \ No newline at end of file diff --git a/src/HPSocket.Net/AsyncQueue/Worker.cs b/src/HPSocket.Net/AsyncQueue/Worker.cs new file mode 100644 index 0000000..2863524 --- /dev/null +++ b/src/HPSocket.Net/AsyncQueue/Worker.cs @@ -0,0 +1,56 @@ +#if !NET20 +using System; +using System.Collections.Concurrent; +using System.Threading; +using System.Threading.Tasks; + +namespace HPSocket.AsyncQueue +{ + public class Worker + { + /// + /// 消费队列实体 + /// + private readonly BlockingCollection collection; + /// + /// 任务处理函数 + /// + private readonly Action taskProc; + /// + /// 控制线程令牌 + /// + private CancellationToken ct { get; set; } + /// + /// 构造方法 + /// + /// 消费队列实体 + /// 任务处理函数 + /// + public Worker(BlockingCollection collection, Action taskProc, CancellationToken ct) + { + this.collection = collection ?? throw new ArgumentNullException(nameof(collection)); + this.taskProc = taskProc ?? throw new ArgumentNullException(nameof(taskProc)); + this.ct = ct; + Task.Factory.StartNew(this.DoWork, ct); + } + /// + /// 消费数据方法 + /// + private void DoWork() + { + while (!this.ct.IsCancellationRequested) + { + try + { + var item = this.collection.Take(this.ct); + this.taskProc?.Invoke(item); + } + catch (OperationCanceledException) + { + //令牌已取消 + } + } + } + } +} +#endif \ No newline at end of file -- Gitee From 1a2448eef8a6c5a8bf276b2da14f4a98b3d7650b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E7=88=B1=E8=8B=B9=E6=9E=9CC?= <842352715@qq.com> Date: Tue, 24 Dec 2019 11:10:05 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E5=BC=82=E6=AD=A5=E9=98=9F=E5=88=97Async?= =?UTF-8?q?Queue=E4=BF=AE=E6=94=B9=20=E6=B7=BB=E5=8A=A0=E6=B6=88=E8=B4=B9?= =?UTF-8?q?=E8=80=85=E6=95=B0=E9=87=8F=E5=B1=9E=E6=80=A7ConsumerCount?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E5=A2=9E=E5=88=A0=E6=B6=88=E8=B4=B9=E8=80=85?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/HPSocket.Net/AsyncQueue/AsyncQueue.cs | 47 ++++++++++++++++++----- src/HPSocket.Net/AsyncQueue/Worker.cs | 20 ++++++---- 2 files changed, 50 insertions(+), 17 deletions(-) diff --git a/src/HPSocket.Net/AsyncQueue/AsyncQueue.cs b/src/HPSocket.Net/AsyncQueue/AsyncQueue.cs index 9473005..7e92b83 100644 --- a/src/HPSocket.Net/AsyncQueue/AsyncQueue.cs +++ b/src/HPSocket.Net/AsyncQueue/AsyncQueue.cs @@ -1,7 +1,6 @@ #if !NET20 using System; using System.Collections.Concurrent; -using System.Threading; namespace HPSocket.AsyncQueue { @@ -21,9 +20,9 @@ namespace HPSocket.AsyncQueue /// private BlockingCollection queue { get; set; } /// - /// 控制线程令牌源 + /// 任务处理函数 /// - private CancellationTokenSource cts { get; set; } + private Action taskProc { get; set; } #endregion /// /// 构造方法 @@ -34,12 +33,12 @@ namespace HPSocket.AsyncQueue { if (consumerCount == 0) { throw new ArgumentException($"{nameof(consumerCount)} must be > 0"); } if (taskProc == null) { throw new ArgumentNullException($"{nameof(taskProc)} must not be null"); } - workers = new ConcurrentBag>(); - queue = new BlockingCollection(); - cts = new CancellationTokenSource(); + this.workers = new ConcurrentBag>(); + this.queue = new BlockingCollection(); + this.taskProc = taskProc; for (var i = 0; i < consumerCount; i++) { - workers.Add(new Worker(queue, taskProc, cts.Token)); + workers.Add(new Worker(queue, taskProc)); } } /// @@ -54,15 +53,43 @@ namespace HPSocket.AsyncQueue /// 成功返回true,失败返回false public bool Enqueue(T item) => this.queue.TryAdd(item); /// + /// 消费者数量 + /// + public int ConsumerCount { get => this.workers.Count; } + /// + /// 添加消费者 + /// + public void AddConsumer(uint consumerCount) + { + for (var i = 0; i < consumerCount; i++) + { + workers.Add(new Worker(queue, taskProc)); + } + } + /// + /// 删除消费者 + /// + public void RemoveConsumer(uint consumerCount) + { + while (!this.workers.IsEmpty && consumerCount-- > 0) + { + if(workers.TryTake(out var w)) + { + w.Stop(); + } + } + } + /// /// 停止消费 /// public void Shutdown() { - this.cts.Cancel(); while (!this.workers.IsEmpty) { - Worker w; - this.workers.TryTake(out w); + if(workers.TryTake(out var w)) + { + w.Stop(); + } } } public void Dispose() => Shutdown(); diff --git a/src/HPSocket.Net/AsyncQueue/Worker.cs b/src/HPSocket.Net/AsyncQueue/Worker.cs index 2863524..bbbda77 100644 --- a/src/HPSocket.Net/AsyncQueue/Worker.cs +++ b/src/HPSocket.Net/AsyncQueue/Worker.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace HPSocket.AsyncQueue { - public class Worker + public class Worker :IDisposable { /// /// 消费队列实体 @@ -19,30 +19,30 @@ namespace HPSocket.AsyncQueue /// /// 控制线程令牌 /// - private CancellationToken ct { get; set; } + private CancellationTokenSource cts { get; set; } /// /// 构造方法 /// /// 消费队列实体 /// 任务处理函数 /// - public Worker(BlockingCollection collection, Action taskProc, CancellationToken ct) + public Worker(BlockingCollection collection, Action taskProc) { this.collection = collection ?? throw new ArgumentNullException(nameof(collection)); this.taskProc = taskProc ?? throw new ArgumentNullException(nameof(taskProc)); - this.ct = ct; - Task.Factory.StartNew(this.DoWork, ct); + this.cts = new CancellationTokenSource(); + Task.Factory.StartNew(this.DoWork, cts.Token); } /// /// 消费数据方法 /// private void DoWork() { - while (!this.ct.IsCancellationRequested) + while (!this.cts.Token.IsCancellationRequested) { try { - var item = this.collection.Take(this.ct); + var item = this.collection.Take(this.cts.Token); this.taskProc?.Invoke(item); } catch (OperationCanceledException) @@ -51,6 +51,12 @@ namespace HPSocket.AsyncQueue } } } + /// + /// 停止线程工作 + /// + public void Stop() => cts.Cancel(); + + public void Dispose() => Stop(); } } #endif \ No newline at end of file -- Gitee