icinga-powershell-framework/lib/web/New-IcingaTCPClient.psm1

22 lines
471 B
PowerShell
Raw Normal View History

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