Bug #15976 Updated: socket_get_status(...) returns nothing
| From: | sean at caedmon dot net | Date: | Wed, 13 Mar 2002 02:44:50 +0000 |
| Subject: | Bug #15976 Updated: socket_get_status(...) returns nothing | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-2348@lists.php.net to get a copy of this message | ||
ID: 15976
Updated by: sean@caedmon.net
Reported By: sean@caedmon.net
Status: Open
Bug Type: Sockets related
Operating System: Win32 (2000) AND Linux2.2
PHP Version: 4.1.2
New Comment:
Alright. So, here's what I've dug up so far:
file: [php]/ext/standard/file.c
line: 968
code: zend_fetch_resource(socket_arg TSRMLS_CC,-1,"Socket
-Handle",NULL,1,php_file_le_socket());
This always line returns false for a valid socket resource (I verified
the resource using
is_resource($sock) and get_resource_type($sock)
for both my listen socket and my message socket.
get_resource_type($sock) returns "Socket".
So, when the next line (969), "ZEND_VERIFY_RESOURCE(what);" is called,
it determines that 'what' is false and calls RETURN_NULL;
I tried screwing with the args in zend_fetch_resource(...), but I don't
know the API well enough (and my C/C++ is more than rusty).
I hope someone takes a look at this soon, I currently have no way of
knowing the status of my sockets (I need to know when a client
disconnects -> eof )
S
Previous Comments:
------------------------------------------------------------------------
[2002-03-12 21:00:39] sean@caedmon.net
It's a non-blocking socket, if that helps
S
------------------------------------------------------------------------
[2002-03-09 17:34:26] sean@caedmon.net
Also note: This is a listening socket (host / server / whatever) -- ie,
not created with fsockopen; created with socket_create, socket_bind,
socket_listen, socket_accept. There's a note in the manual about this
not working properly, but I didn't see it in the bug DB.
------------------------------------------------------------------------
[2002-03-09 17:31:39] sean@caedmon.net
socket_get_status is supposed to return an associative array, it
_always_ returns null for me. No array, no object, no string
print_r(socket_get_status($verifiedSocketResource)) prints nothing.
I've tried this on two separate 4.1.x installs. The php4win version
(4.1.1) and the Debian Unstable version (4.1.2 -- CGI).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15976&edit=1