icinga-powershell-framework/lib/web/New-IcingaTCPClient.psm1
2020-03-24 15:32:14 +01:00

21 lines
449 B
PowerShell

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}',
$Client.Client.RemoteEndPoint
)
);
return $Client;
}