Skip to content

Commit

Permalink
这个状态检查会导致本该释放的socket连接不能释放,不能通知上层代码连接已经断开,从而导致上层(Hik.Communication.Sc…
Browse files Browse the repository at this point in the history
…sServices.Service.ScsServiceApplication的_serviceClients)一直缓存着已经断开连接的客户端,最后耗光内存。

此问题是我在配合consul做服务发现时发现的,consul的tcp健康检查会不断的连接断开,在ReceiveCallback函数报异常去执行Disconnect函数,但是Disconnect函数因为条件判断为true直接return了
  • Loading branch information
NeedJustWord committed Apr 1, 2019
1 parent b3959f4 commit 8bf6fa8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ public TcpCommunicationChannel(Socket clientSocket)
/// </summary>
public override void Disconnect()
{
if (CommunicationState != CommunicationStates.Connected)
{
return;
}

_running = false;
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ public TcpCommunicationChannel(Socket clientSocket)
/// </summary>
public override void Disconnect()
{
if (CommunicationState != CommunicationStates.Connected)
{
return;
}

_running = false;
try
{
Expand Down

0 comments on commit 8bf6fa8

Please sign in to comment.