icinga-powershell-framework/lib/web/Close-IcingaTCPConnection.psm1

22 lines
437 B
PowerShell
Raw Normal View History

2020-03-24 07:42:14 -04:00
function Close-IcingaTCPConnection()
{
param(
[System.Net.Sockets.TcpClient]$Client = $null
);
if ($null -eq $Client) {
return;
}
Write-IcingaDebugMessage -Message (
[string]::Format(
'Closing client connection for endpoint {0}',
(Get-IcingaTCPClientRemoteEndpoint -Client $Client)
)
);
2020-03-24 07:42:14 -04:00
$Client.Close();
$Client.Dispose();
$Client = $null;
}