mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 16:20:48 +08:00
更改了远程环境下websocket会来回发送重复消息的问题
This commit is contained in:
@@ -11,23 +11,28 @@ namespace Serein.Library.Network.WebSocketCommunication.Handle
|
||||
/// <summary>
|
||||
/// 消息处理上下文
|
||||
/// </summary>
|
||||
public class WebSocketMsgContext
|
||||
public class WebSocketMsgContext : IDisposable
|
||||
{
|
||||
public WebSocketMsgContext(Func<string, Task> sendAsync)
|
||||
{
|
||||
this._sendAsync = sendAsync;
|
||||
}
|
||||
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
JsonObject = null;
|
||||
MsgTheme = null;
|
||||
MsgId = null;
|
||||
MsgData = null;
|
||||
MsgData = null;
|
||||
_sendAsync = null;
|
||||
}
|
||||
/// <summary>
|
||||
/// 标记是否已经处理,如果是,则提前退出
|
||||
/// </summary>
|
||||
public bool Handle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息本体(文本)
|
||||
/// </summary>
|
||||
public string Msg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息本体(JObject)
|
||||
/// </summary>
|
||||
@@ -107,6 +112,7 @@ namespace Serein.Library.Network.WebSocketCommunication.Handle
|
||||
await SendAsync(msg);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user