php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #419 fsockopen() doesn't return meaningful error codes
Submitted: 1998-05-30 11:42 UTC Modified: 1998-05-30 18:24 UTC
From: explorer-php3 at flame dot org Assigned: rasmus (profile)
Status: Closed Package: Misbehaving function
PHP Version: 3.0 Latest CVS OS: NetBSD/i386-1.3.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: explorer-php3 at flame dot org
New email:
PHP Version: OS:

 

 [1998-05-30 11:42 UTC] explorer-php3 at flame dot org
fsockopen() doesn't return meaningful error codes, so there is no way to
tell the difference between, say, "connection refused" and "connection
timed out"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-05-30 18:24 UTC] rasmus
Ok, this has been cleaned up.  fsockopen() now returns FALSE like all the other PHP functions on a failure, but in order to get useful information from a failure you can now pass in two optional arguments (by reference).

ie.

  fsockopen($ip,$port,&$errno,&$errstr)

These will be set to the errno and error string that come back from the system-level connect() call.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 07:01:29 2024 UTC