mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
21 lines
437 B
PowerShell
21 lines
437 B
PowerShell
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)
|
|
)
|
|
);
|
|
|
|
$Client.Close();
|
|
$Client.Dispose();
|
|
$Client = $null;
|
|
}
|