php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40041 fsockopen doesn't close socket at timeout
Submitted: 2007-01-06 08:31 UTC Modified: 2007-01-06 16:45 UTC
From: nhnui dot mail at gmail dot com Assigned:
Status: Not a bug Package: Sockets related
PHP Version: 5.2.0 OS: windows 2003
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nhnui dot mail at gmail dot com
New email:
PHP Version: OS:

 

 [2007-01-06 08:31 UTC] nhnui dot mail at gmail dot com
Description:
------------
when fsockopen() can't connect within timeout it doesn't close the opened socked

I discovered this using Process Explorer

Reproduce code:
---------------
$fp=fsockopen($some_unreachable_ip,$some_port,$errno,$errstr,$some_timeout);
if ($fp)
  fclose($fp);


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-06 16:45 UTC] iliaa@php.net
If fsockopen() timesout while trying to open a socket it won't 
return you a socket resource to close.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 04:01:27 2025 UTC