Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10977 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50731 invoked by uid 1010); 8 Jul 2004 11:05:11 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 50660 invoked by uid 1007); 8 Jul 2004 11:05:11 -0000 Message-ID: <20040708110511.50659.qmail@pb1.pair.com> To: internals@lists.php.net Date: Thu, 8 Jul 2004 14:03:14 +0200 Lines: 35 MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1255" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Posted-By: 62.219.161.16 Subject: sockets_read() on windows From: mosdoron@netvision.net.il ("moshe doron") Hi Using socket_read() on windows with PHP_NORMAL_READ (mean read till the next '\n' or '\r'), php always raise an error even when socket still response. sniffing around a bit: http://cvs.php.net/co.php/php-src/ext/sockets/sockets.c?r=1.165#870 http://cvs.php.net/co.php/php-src/ext/sockets/sockets.c?r=1.165#267 http://cvs.php.net/co.php/php-src/ext/sockets/php_sockets_win.c?r=1.11#97 i see that on with the NORMAL flag, socket_read() is using the php_read() function that always fails due to the php_sockets implementation of the fcntl() call on windows. according to implementation, php_sockets_win.c fcntl always returns -1 for F_GETFD,F_SETFD,F_GETFL flags (unsupported?). the fcntl() call is done to determind if blocking socket for some repeats. my questions are: can't fcntl() be implemented for windows at least to detect the non/blocking thing? else, we may wants just refering to the socket as blocking on win32, this behavior is better just then returning error as now. anyway, if we going to leave this 'behavior' as it, we need to give the windows user fair explain on the function parameters parsing step and on the documentation. more point: on the php.ini.dist i see: 'sockets.use_system_read = On' but without considering the socket_globals definition, there is no ref on the code to this thing, is this directive conected to the above issue? Moshe