Module: nagvis Branch: nagvis-1.4 Commit: 4dc169372f8c20d57a98cc1e0d97e2792dd30db8 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=4dc169372f8c20d57a98cc1e0d97e2792dd30db8
Author: LaMi <[email protected]> Date: Tue Nov 24 22:54:12 2009 +0100 Implemented a class destructor to close the socket in a clean way --- .../includes/classes/GlobalBackendmklivestatus.php | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/nagvis/nagvis/includes/classes/GlobalBackendmklivestatus.php b/nagvis/nagvis/includes/classes/GlobalBackendmklivestatus.php index 5dfa894..4127852 100644 --- a/nagvis/nagvis/includes/classes/GlobalBackendmklivestatus.php +++ b/nagvis/nagvis/includes/classes/GlobalBackendmklivestatus.php @@ -79,6 +79,22 @@ class GlobalBackendmklivestatus implements GlobalBackendInterface { return true; } + + /** + * PUBLIC class destructor + * + * The descrutcor closes the socket when some is open + * at the moment when the class is destroyed. It is + * important to close the socket in a clean way. + * + * @author Lars Michelsen <[email protected]> + */ + public function __destruct() { + if($this->SOCKET !== null) { + socket_close($this->SOCKET); + $this->SOCKET = null; + } + } /** * PRIVATE parseSocket ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
