XFEExtension
【DLL】XFE各类拓展是一个C#的DLL库,旨在优化C#代码中常用语句的使用,并提供更简洁的访问方式,同时提供Xunit测试框架,快速搭建服务器/客户端,免费ChatGPTAPI接口,免费通讯服务器,XFE下载器,新增格式等
关注
0
Fork
0
Star
0
返回提交历史
Modified
XFEExtension.NetCore/CyberComm/CyberCommServer.cs
+14
-1
Added
XFEExtension.NetCore/XFEExtension - Backup (1).NetCore.csproj
+83
-0
Modified
XFEExtension.NetCore/XFEExtension.NetCore.csproj
+3
-3
XFEstudio/XFEExtension
为CyberComm添加终止服务器功能
eebe52a
代码差异
3 个文件
+100
-4
@@ -13,6 +13,10 @@ public class CyberCommServer
13
13
private readonly string[] serverURLs;
14
14
#region 公共属性
15
15
/// <summary>
16
/// 服务器正在运行
17
/// </summary>
18
public bool ServerRunning { get; set; }
19
/// <summary>
16
20
/// 是否自动接收完整消息
17
21
/// </summary>
18
22
public bool AutoReceiveCompletedMessage { get; set; }
@@ -55,8 +59,9 @@ public class CyberCommServer
55
59
Server.Prefixes.Add(url);
56
60
}
57
61
Server.Start();
62
ServerRunning = true;
58
63
ServerStarted?.Invoke(this, EventArgs.Empty);
59
while (true)
64
while (ServerRunning)
60
65
{
61
66
var httpListenerContext = await Server.GetContextAsync();
62
67
var requestURL = httpListenerContext.Request.Url;
@@ -97,6 +102,14 @@ public class CyberCommServer
97
102
throw new XFECyberCommException("启动服务器时发生异常", ex);
98
103
}
99
104
}
105
/// <summary>
106
/// 停止CyberComm服务器
107
/// </summary>
108
public void StopCyberCommServer()
109
{
110
ServerRunning = false;
111
Server.Close();
112
}
100
113
private async void CyberCommClientConnected(Uri? requestURL, WebSocket webSocket, NameValueCollection wsHeader, string clientIP)
101
114
{
102
115
while (webSocket.State == WebSocketState.Open)
@@ -0,0 +1,83 @@
1
<Project Sdk="Microsoft.NET.Sdk">
2
3
<PropertyGroup>
4
<TargetFramework>net8.0</TargetFramework>
5
<ImplicitUsings>enable</ImplicitUsings>
6
<Nullable>enable</Nullable>
7
<GenerateDocumentationFile>True</GenerateDocumentationFile>
8
<Title>XFEExtension</Title>
9
<RepositoryUrl>https://github.com/XFEstudio/XFEExtension</RepositoryUrl>
10
<AnalysisLevel>latest</AnalysisLevel>
11
<PackAsTool>False</PackAsTool>
12
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
13
<SignAssembly>True</SignAssembly>
14
<Copyright>寰宇朽力网络科技有限公司版权所有</Copyright>
15
<PackageProjectUrl>https://github.com/XFEstudio/XFEExtension</PackageProjectUrl>
16
<PackageIcon>logoIcon.png</PackageIcon>
17
<Description>XFEExtension提供,免费ChatGPTAPI接口,快速搭建服务器/客户端,免费通讯服务器,XFE下载器,新增格式等</Description>
18
<PackageReadmeFile>README.md</PackageReadmeFile>
19
<PackageTags>XFE;拓展;GPT;Server;服务器;测试;XFEExtension</PackageTags>
20
<PackageReleaseNotes>## 调整
21
22
修复CyberComm中的部分问题
23
优化网址匹配正则
24
25
## 新增
26
27
无
28
29
## 严重
30
31
无</PackageReleaseNotes>
32
<NeutralLanguage>zh-CN</NeutralLanguage>
33
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
34
<PackageLicenseFile>LICENSE</PackageLicenseFile>
35
<AssemblyOriginatorKeyFile>..\XFEstudio.pfx</AssemblyOriginatorKeyFile>
36
<Version>3.0.2</Version>
37
<Authors>XFEstudio</Authors>
38
</PropertyGroup>
39
40
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
41
<DefineConstants>$(DefineConstants);WINDOWS</DefineConstants>
42
</PropertyGroup>
43
44
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
45
<DefineConstants>$(DefineConstants);WINDOWS</DefineConstants>
46
</PropertyGroup>
47
48
<ItemGroup>
49
<None Include="..\LICENSE">
50
<Pack>True</Pack>
51
<PackagePath>\</PackagePath>
52
</None>
53
<None Include="..\README.md">
54
<Pack>True</Pack>
55
<PackagePath>\</PackagePath>
56
</None>
57
<None Include="..\XFEstudio.pfx">
58
<Pack>True</Pack>
59
<PackagePath>\</PackagePath>
60
</None>
61
<None Include="..\logoIcon.png">
62
<Pack>True</Pack>
63
<PackagePath>\</PackagePath>
64
</None>
65
<None Include="..\XFEExtension.NetCore.Analyzer\bin\Release\netstandard2.0\XFEExtension.NetCore.Analyzer.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
66
</ItemGroup>
67
68
<ItemGroup>
69
<Compile Update="Properties\Resources.Designer.cs">
70
<DesignTime>True</DesignTime>
71
<AutoGen>True</AutoGen>
72
<DependentUpon>Resources.resx</DependentUpon>
73
</Compile>
74
</ItemGroup>
75
76
<ItemGroup>
77
<EmbeddedResource Update="Properties\Resources.resx">
78
<Generator>ResXFileCodeGenerator</Generator>
79
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
80
</EmbeddedResource>
81
</ItemGroup>
82
83
</Project>
@@ -19,8 +19,8 @@
19
19
<PackageTags>XFE;拓展;GPT;Server;服务器;测试;XFEExtension</PackageTags>
20
20
<PackageReleaseNotes>## 调整
21
21
22
修复CyberComm中的部分问题
23
优化网址匹配正则
22
修复分析中的部分bug
23
为CyberComm添加终止服务器功能
24
24
25
25
## 新增
26
26
@@ -33,7 +33,7 @@
33
33
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
34
34
<PackageLicenseFile>LICENSE</PackageLicenseFile>
35
35
<AssemblyOriginatorKeyFile>..\XFEstudio.pfx</AssemblyOriginatorKeyFile>
36
<Version>3.0.1</Version>
36
<Version>3.0.2</Version>
37
37
<Authors>XFEstudio</Authors>
38
38
</PropertyGroup>
39
39