XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEExtension.NetCore.ServerInteractive

[DLL] Server interaction extension, including user identity verification and querying in conjunction with AutoConfig

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFEExtension.NetCore.ServerInteractive

扩展关闭方法并调整接口实现为异步

新增 Close(byte[] buffer) 和 Close(Stream stream) 异步方法,支持多种关闭通讯方式。将 CloseWithError 方法改为异步。IXFEServerCoreServiceBase 接口移除默认实现,仅保留方法签名。项目版本升级至 1.1.5。

3765006
XFE工作室室长 <mail@xfegzs.com>
提交于

代码差异

3 个文件 +17 -14
Modified XFEExtension.NetCore.ServerInteractive/Implements/CoreService/XFEServerCoreServiceBase.cs +7 -1
@@ -32,11 +32,17 @@ public abstract class XFEServerCoreServiceBase : IXFEServerCoreServiceBase
32 32 /// <inheritdoc/>
33 33 public async Task Close(string message) => await ReturnArgs.Close(message);
34 34
35 /// <inheritdoc/>
36 public async Task Close(byte[] buffer) => await ReturnArgs.Close(buffer);
37
38 /// <inheritdoc/>
39 public async Task Close(Stream stream) => await ReturnArgs.Close(stream);
40
35 41 /// <inheritdoc/>
36 42 public void OK() => ReturnArgs?.OK();
37 43
38 44 /// <inheritdoc/>
39 public Task CloseWithError(string message, HttpStatusCode code) => ReturnArgs!.CloseWithError(message, code);
45 public async Task CloseWithError(string message, HttpStatusCode code) => await ReturnArgs!.CloseWithError(message, code);
40 46
41 47 /// <inheritdoc/>
42 48 public ServerCoreReturnArgs Error(string message, HttpStatusCode code = HttpStatusCode.BadRequest, bool handled = false) => ReturnArgs!.Error(message, code, handled);
Modified XFEExtension.NetCore.ServerInteractive/Interfaces/CoreService/IXFEServerCoreServiceBase.cs +2 -10
@@ -67,21 +67,13 @@ public interface IXFEServerCoreServiceBase
67 67 /// 结束与客户端的通讯
68 68 /// </summary>
69 69 /// <param name="buffer"></param>
70 public async Task Close(byte[] buffer)
71 {
72 await Send(buffer);
73 OK();
74 }
70 Task Close(byte[] buffer);
75 71
76 72 /// <summary>
77 73 /// 结束与客户端的通讯
78 74 /// </summary>
79 75 /// <param name="stream"></param>
80 public async Task Close(Stream stream)
81 {
82 await Send(stream);
83 OK();
84 }
76 Task Close(Stream stream);
85 77
86 78 /// <summary>
87 79 /// 返回错误信息并关闭
Modified XFEExtension.NetCore.ServerInteractive/XFEExtension.NetCore.ServerInteractive.csproj +8 -3
@@ -5,7 +5,7 @@
5 5 <ImplicitUsings>enable</ImplicitUsings>
6 6 <Nullable>enable</Nullable>
7 7 <GenerateDocumentationFile>True</GenerateDocumentationFile>
8 <Version>1.1.4</Version>
8 <Version>1.1.5</Version>
9 9 <Title>XFEExtension.NetCore.ServerInteractive</Title>
10 10 <RepositoryUrl>https://github.com/XFEstudio/XFEExtension.NetCore.ServerInteractive</RepositoryUrl>
11 11 <AnalysisLevel>latest</AnalysisLevel>
@@ -21,12 +21,17 @@
21 21 <PackageReleaseNotes>
22 22 ## 调整
23 23
24
24 扩展关闭方法并调整接口实现为异步
25
26 新增 Close(byte[] buffer) 和 Close(Stream stream) 异步方法,支持多种关闭通讯方式。
27 将 CloseWithError 方法改为异步。
28 IXFEServerCoreServiceBase 接口移除默认实现,仅保留方法签名。
29 项目版本升级至 1.1.5。
25 30
26 31
27 32 ## 新增
28 33
29 添加Send方法以及二进制数据发送方法
34
30 35
31 36 ## 严重
32 37