note 97521 added to mysqli.close

From: Date: Fri, 23 Apr 2010 21:43:30 +0000
Subject: note 97521 added to mysqli.close
Groups: php.notes 
Request: Send a blank email to php-notes+get-168578@lists.php.net to get a copy of this message
The mysqli_close() function and object method only remove the ability to use the mysql object again in the script, essentially on the surface only nulling out all object parameters. At least with PHP5.3.2 and Windows connecting by tcp, this differs by the old mysql_close() function in that it does not actually close out the tcp socket being used. You should always use mysqli_kill() function before mysqli_close() to actually close and free up the tcp socket being used by PHP. Garbage collection after script execution nor mysqli_close() do not kill the tcp socket on their own. The socket would otherwise remain in 'wait' state for approximately 30 seconds, and any additional page loads/connection attempts would only add to the total number of open tcp connections. This wait time does not appear to be configurable via PHP settings. Also as of this version, mysqli created links cannot be "deactivated", and will continue to accumulate in process memory until the PHP server or process is restarted, essentially making mysqli.max_links = -1 required. ---- Server IP: 192.41.40.227 Probable Submitter: 66.25.188.193 ---- Manual Page -- http://www.php.net/manual/en/mysqli.close.php Edit -- https://master.php.net/note/edit/97521 Del: integrated -- https://master.php.net/note/delete/97521/integrated Del: useless -- https://master.php.net/note/delete/97521/useless Del: bad code -- https://master.php.net/note/delete/97521/bad+code Del: spam -- https://master.php.net/note/delete/97521/spam Del: non-english -- https://master.php.net/note/delete/97521/non-english Del: in docs -- https://master.php.net/note/delete/97521/in+docs Del: other reasons-- https://master.php.net/note/delete/97521 Reject -- https://master.php.net/note/reject/97521 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#168578) next »