mirror of
https://github.com/netchx/netch.git
synced 2026-03-18 18:13:21 +08:00
Update GetProcessByUsedTcpPort (Fix #591)
This commit is contained in:
@@ -193,7 +193,17 @@ namespace Netch.Controllers
|
||||
{
|
||||
foreach (var p in PortHelper.GetProcessByUsedTcpPort(port))
|
||||
{
|
||||
if (p.MainModule!.FileName.StartsWith(Global.NetchDir))
|
||||
try
|
||||
{
|
||||
_ = p.MainModule!.FileName;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logging.Warning(e.ToString());
|
||||
continue;
|
||||
}
|
||||
|
||||
if (p.MainModule.FileName.StartsWith(Global.NetchDir))
|
||||
{
|
||||
p.Kill();
|
||||
p.WaitForExit();
|
||||
|
||||
Reference in New Issue
Block a user