#48473 [Opn->Fbk]: $errstr in stream_socket_client() periodically not set when error occurs
ID: 48473
Updated by: jani@php.net
Reported By: nick dot telford at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: Streams related
Operating System: CentOS 5.3
PHP Version: 5.2.9
New Comment:
Please try using this snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2009-06-04 16:46:58] nick dot telford at gmail dot com
Description:
------------
I've noticed that some errors in stream_socket_client()s connection
don't populate errstr with an error. As far as I can tell, errno is
always populated.
The most consistent case I've found for this if when the error code is
16 - $errstr SHOULD be "Device or resource busy" (according to some
googling), however, it is empty.
I've also come across many errono's that are > 127 and have no errstr.
e.g. 5736689
Reproduce code:
---------------
Unless someone knows how to reproduce "Device or resource busy", then I
can't create any code to reproduce errno 16 having no errstr.
I can reproduce the oddly high errno's (with no errstr) as the example
above appears to be for invalid URLs:
<?php
$stream = stream_socket_client('tcp://tinyu:80', $errno, $errstr);
echo "$errno\n";
echo "'$errstr'\n";
Expected result:
----------------
Not sure what the error number *should* be, possibly 22 (EINVAL),
Invalid argument. I'll go with that:
22
'Invalid argument'
Actual result:
--------------
5736689
''
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48473&edit=1
Thread (4 messages)