mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Add tool function to close and flush TCP connections
This commit is contained in:
parent
5276b7a505
commit
afec954d35
1 changed files with 14 additions and 0 deletions
14
lib/core/tools/Close-IcingaTcpConnection.psm1
Normal file
14
lib/core/tools/Close-IcingaTcpConnection.psm1
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
function Close-IcingaTcpConnection()
|
||||||
|
{
|
||||||
|
param(
|
||||||
|
$TcpClient
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($null -eq $TcpClient) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$TcpClient.Close();
|
||||||
|
$TcpClient.Dispose();
|
||||||
|
$TcpClient = $null;
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue