php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17964 socket fclose CLOSE_WAIT
Submitted: 2002-06-25 05:37 UTC Modified: 2002-07-01 17:33 UTC
Votes:9
Avg. Score:4.4 ± 0.8
Reproduced:8 of 8 (100.0%)
Same Version:0 (0.0%)
Same OS:2 (25.0%)
From: filippo at zirak dot it Assigned:
Status: No Feedback Package: Sockets related
PHP Version: 4.2.1 OS: linux 2.4.4
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2002-06-25 05:37 UTC] filippo at zirak dot it
$fp=fopen("127.0.0.1", $myport, 3);
... (actions)
fclose($fp);

if the server does not close itself the connetion, but is the php client to close it with fclose, this leads invariably to leave the server connection in a CLOSE_WAIT state (for looooong time, not secs!).

Filippo

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-25 05:42 UTC] derick@php.net
Can you please try the latest non-stable snapshot from snaps.php.net, it is likely that this is fixed already.

Derick
 [2002-07-01 17:33 UTC] jason@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

I can not reproduce this, and their was no feedback
 [2003-09-13 17:27 UTC] n-a at mail dot com
I have the same bug in php 4.3.1
This bug is presented only with SOME servers. Approx. 5-10% of internet servers.
 [2004-01-14 04:45 UTC] ruben at textinfo dot nl
I'm experiencing the same problem with PHP 4.3.4 on Windows 2000 Advanced Server running IIS 5 and on a Solaris 9 machine running PHP 4.2.2.

I'm using:

 $this->socket = fsockopen($serverip, $serverport);

to open the connection and:
 fclose($this->socket);

to close it. If I check the server it connects to with netstat after the fclose call the connection stays in CLOSE_WAIT state.
Is there any solution for this already?
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Feb 19 13:01:30 2020 UTC