Module: nagvis Branch: master Commit: fb4bd6aa8a05492623b70cb5b21485d452cd4612 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=fb4bd6aa8a05492623b70cb5b21485d452cd4612
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 --- .../core/classes/GlobalBackendmklivestatus.php | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/share/server/core/classes/GlobalBackendmklivestatus.php b/share/server/core/classes/GlobalBackendmklivestatus.php index 239a988..c052128 100644 --- a/share/server/core/classes/GlobalBackendmklivestatus.php +++ b/share/server/core/classes/GlobalBackendmklivestatus.php @@ -76,6 +76,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
