客户端离线,终止listener

This commit is contained in:
gui.h 2021-12-29 16:52:53 +08:00
parent f1b6492435
commit 9568077a27
2 changed files with 13 additions and 2 deletions

View File

@ -120,9 +120,7 @@ namespace FastTunnel.Core.Listener
{
shutdown = true;
listenSocket.Close();
Interlocked.Decrement(ref m_numConnectedSockets);
}
}
}
}

View File

@ -81,6 +81,19 @@ namespace FastTunnel.Core.Models
internal void Logout()
{
// forward监听终止
if (forwardInfos != null)
{
foreach (var item in forwardInfos)
{
try
{
item.Listener.Stop();
}
catch { }
}
}
// TODO:
}
}