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
 [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 09:01:30 2024 UTC