mirror of
https://github.com/RRQM/TouchSocket.git
synced 2025-12-18 01:16:44 +08:00
!67 fix: 服务端WebSocket使用AsyncClose()主动关闭连接时引发NullReferenceException异常
Merge pull request !67 from 千层饼/master
This commit is contained in:
@@ -76,11 +76,17 @@ internal sealed partial class InternalWebSocket : IWebSocket
|
||||
await this.SendAsync(frame).ConfigureAwait(EasyTask.ContinueOnCapturedContext);
|
||||
}
|
||||
}
|
||||
await this.m_httpClientBase.ShutdownAsync(System.Net.Sockets.SocketShutdown.Both);
|
||||
await this.m_httpClientBase.SafeCloseAsync(statusDescription).ConfigureAwait(EasyTask.ContinueOnCapturedContext);
|
||||
|
||||
await this.m_httpSocketClient.ShutdownAsync(System.Net.Sockets.SocketShutdown.Both);
|
||||
await this.m_httpSocketClient.SafeCloseAsync(statusDescription).ConfigureAwait(EasyTask.ContinueOnCapturedContext);
|
||||
|
||||
if (this.m_isServer)
|
||||
{
|
||||
await this.m_httpSocketClient.ShutdownAsync(System.Net.Sockets.SocketShutdown.Both);
|
||||
await this.m_httpSocketClient.SafeCloseAsync(statusDescription).ConfigureAwait(EasyTask.ContinueOnCapturedContext);
|
||||
}
|
||||
else
|
||||
{
|
||||
await this.m_httpClientBase.ShutdownAsync(System.Net.Sockets.SocketShutdown.Both);
|
||||
await this.m_httpClientBase.SafeCloseAsync(statusDescription).ConfigureAwait(EasyTask.ContinueOnCapturedContext);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task PingAsync()
|
||||
|
||||
Reference in New Issue
Block a user