mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Add debug output messages for TCP handling
This commit is contained in:
parent
b947f71f3a
commit
08e3594008
4 changed files with 35 additions and 0 deletions
|
|
@ -8,6 +8,13 @@ function Close-IcingaTCPConnection()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Write-IcingaDebugMessage -Message (
|
||||||
|
[string]::Format(
|
||||||
|
'Closing client connection for endpoint {0}',
|
||||||
|
$Client.Client.RemoteEndPoint
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
$Client.Close();
|
$Client.Close();
|
||||||
$Client.Dispose();
|
$Client.Dispose();
|
||||||
$Client = $null;
|
$Client = $null;
|
||||||
|
|
|
||||||
|
|
@ -8,5 +8,12 @@ function Close-IcingaTCPSocket()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Write-IcingaDebugMessage -Message (
|
||||||
|
[string]::Format(
|
||||||
|
'Closing TCP socket {0}',
|
||||||
|
$Socket.LocalEndpoint
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
$Socket.Stop();
|
$Socket.Stop();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,12 @@ function New-IcingaTCPClient()
|
||||||
|
|
||||||
[System.Net.Sockets.TcpClient]$Client = $Socket.AcceptTcpClient();
|
[System.Net.Sockets.TcpClient]$Client = $Socket.AcceptTcpClient();
|
||||||
|
|
||||||
|
Write-IcingaDebugMessage -Message (
|
||||||
|
[string]::Format(
|
||||||
|
'New incoming client connection for endpoint {0}',
|
||||||
|
$Client.Client.RemoteEndPoint
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
return $Client;
|
return $Client;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,21 @@ function New-IcingaTCPSocket()
|
||||||
|
|
||||||
$TCPSocket = [System.Net.Sockets.TcpListener]$Port;
|
$TCPSocket = [System.Net.Sockets.TcpListener]$Port;
|
||||||
|
|
||||||
|
Write-IcingaDebugMessage -Message (
|
||||||
|
[string]::Format(
|
||||||
|
'Creating new TCP socket on Port {0}. Endpoint configuration {1}',
|
||||||
|
$Port,
|
||||||
|
$TCPSocket.LocalEndpoint
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
if ($Start) {
|
if ($Start) {
|
||||||
|
Write-IcingaDebugMessage -Message (
|
||||||
|
[string]::Format(
|
||||||
|
'Starting TCP socket for endpoint {0}',
|
||||||
|
$TCPSocket.LocalEndpoint
|
||||||
|
)
|
||||||
|
);
|
||||||
$TCPSocket.Start();
|
$TCPSocket.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue