增加TCP 客户端主动关闭监听
This commit is contained in:
parent
9603b02532
commit
070173af4f
@ -16,7 +16,7 @@ using Volo.Abp.Domain.Repositories;
|
|||||||
|
|
||||||
namespace JiShe.CollectBus.Plugins
|
namespace JiShe.CollectBus.Plugins
|
||||||
{
|
{
|
||||||
public partial class TcpMonitor : PluginBase, ITransientDependency, ITcpReceivedPlugin, ITcpConnectingPlugin, ITcpConnectedPlugin, ITcpClosedPlugin
|
public partial class TcpMonitor : PluginBase, ITransientDependency, ITcpReceivedPlugin, ITcpConnectingPlugin, ITcpConnectedPlugin, ITcpClosedPlugin, ITcpClosingPlugin
|
||||||
{
|
{
|
||||||
private readonly IProducerService _producerService;
|
private readonly IProducerService _producerService;
|
||||||
private readonly ILogger<TcpMonitor> _logger;
|
private readonly ILogger<TcpMonitor> _logger;
|
||||||
@ -115,5 +115,11 @@ namespace JiShe.CollectBus.Plugins
|
|||||||
await e.InvokeNext();
|
await e.InvokeNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task OnTcpClosing(ITcpSession client, ClosingEventArgs e)
|
||||||
|
{
|
||||||
|
var tcpSessionClient = (ITcpSessionClient)client;
|
||||||
|
_logger.LogWarning($"[TCP] ID:{tcpSessionClient.Id} IP:{client.GetIPPort()}终端主动关闭");
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user