ID: 15976 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Sockets related Operating System: Win32 (2000) AND Linux2.2 PHP Version: 4.1.2 New Comment:
Oops. Regarding my previous comment: line 968 reads "what = zend_fetch_resource(socket TSRMLS_CC, -1, "File-Handle", &type, 1, le_socket);" in CVS, not what I posted above... S Previous Comments: ------------------------------------------------------------------------ [2002-03-12 21:44:49] [EMAIL PROTECTED] 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 ------------------------------------------------------------------------ [2002-03-12 21:00:39] [EMAIL PROTECTED] It's a non-blocking socket, if that helps S ------------------------------------------------------------------------ [2002-03-09 17:34:26] [EMAIL PROTECTED] 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] [EMAIL PROTECTED] 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