From bbe1da2c18721b5efae2f0c5563689aa2c150d60 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8B=A5=E6=B1=9D=E6=A3=8B=E8=8C=97?= <505554090@qq.com>
Date: Mon, 28 Apr 2025 10:09:01 +0800
Subject: [PATCH] Update:touchsocket version to 3.1.0
---
.../touchsocket/src/TouchSocketHttp/TouchSocketHttp.csproj | 2 +-
.../CSharp/touchsocket/src/TouchSocketWebApi/Program.cs | 6 +++---
.../src/TouchSocketWebApi/TouchSocketWebApi.csproj | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/frameworks/CSharp/touchsocket/src/TouchSocketHttp/TouchSocketHttp.csproj b/frameworks/CSharp/touchsocket/src/TouchSocketHttp/TouchSocketHttp.csproj
index 861df016264..aaef77cb15b 100644
--- a/frameworks/CSharp/touchsocket/src/TouchSocketHttp/TouchSocketHttp.csproj
+++ b/frameworks/CSharp/touchsocket/src/TouchSocketHttp/TouchSocketHttp.csproj
@@ -12,6 +12,6 @@
-
+
diff --git a/frameworks/CSharp/touchsocket/src/TouchSocketWebApi/Program.cs b/frameworks/CSharp/touchsocket/src/TouchSocketWebApi/Program.cs
index 9ff88e76fa2..52fcf5a4edf 100644
--- a/frameworks/CSharp/touchsocket/src/TouchSocketWebApi/Program.cs
+++ b/frameworks/CSharp/touchsocket/src/TouchSocketWebApi/Program.cs
@@ -58,9 +58,9 @@ public static void Main(string[] args)
}
}
-public partial class ApiServer : RpcServer
+public partial class ApiServer : SingletonRpcServer
{
- private HttpContent m_contentPlaintext = new StringHttpContent("Hello, World!", Encoding.UTF8, $"text/plain");
+ private readonly HttpContent m_contentPlaintext = new StringHttpContent("Hello, World!", Encoding.UTF8, $"text/plain");
public static MyJson MyJson { get; set; } = new MyJson() { Message = "Hello, World!" };
@@ -71,7 +71,7 @@ public async Task Plaintext(IWebApiCallContext callContext)
var response= callContext.HttpContext.Response;
response.SetStatus(200, "success");
response.Content= m_contentPlaintext;
- await response.AnswerAsync();
+ await response.AnswerAsync().ConfigureAwait(false);
}
[Router("/json")]
diff --git a/frameworks/CSharp/touchsocket/src/TouchSocketWebApi/TouchSocketWebApi.csproj b/frameworks/CSharp/touchsocket/src/TouchSocketWebApi/TouchSocketWebApi.csproj
index 87b1299e11e..6d44f27c2f5 100644
--- a/frameworks/CSharp/touchsocket/src/TouchSocketWebApi/TouchSocketWebApi.csproj
+++ b/frameworks/CSharp/touchsocket/src/TouchSocketWebApi/TouchSocketWebApi.csproj
@@ -12,8 +12,8 @@
-
-
-
+
+
+