icinga-powershell-framework/lib/webserver/Close-IcingaTCPSocket.psm1

20 lines
340 B
PowerShell
Raw Normal View History

2020-03-24 07:42:14 -04:00
function Close-IcingaTCPSocket()
{
param(
[System.Net.Sockets.TcpListener]$Socket = $null
);
if ($null -eq $Socket) {
return;
}
Write-IcingaDebugMessage -Message (
[string]::Format(
'Closing TCP socket {0}',
$Socket.LocalEndpoint
)
);
2020-03-24 07:42:14 -04:00
$Socket.Stop();
}