note 72922 added to function.socket-read

From: Date: Sun, 04 Feb 2007 23:27:47 +0000
Subject: note 72922 added to function.socket-read
Groups: php.notes 
Request: Send a blank email to php-notes+get-122827@lists.php.net to get a copy of this message
PHP 5.2.0 / Win32 / Apache 1.3 - It seems like... PHP_BINARY_READ - works, but returns '', not FALSE... - is blocking, until data received or connection closed - does pass-through \r\n etc. - returns data on data, '' on connection closed - you can detect closed connection by checking for '' (not FALSE as stated i manual) PHP_NORMAL_READ - not working so good... - is non-blocking - does not pass-through \r\n etc. - returns false on no-data, false on connection closed :( - (no way here to detect a closed connection...?) - (is this a bug? http://bugs.php.net/bug.php?id=21880 ) - (is this a bug? http://bugs.php.net/bug.php?id=21197 ) - (could not get data from this option at all in fact...) PHP_BINARY_READ seems to be the "right way to go" for now. Both checking for '' and false to detect closed connection is probably smart, as this "bug"(?) may be fixed... ---- Server IP: 193.27.201.10 (proxied: 193.27.201.10 1.0 www1.shellkonto.se:3128 (squid/2.5.STABLE4)) Probable Submitter: 81.227.19.81 ---- Manual Page -- http://www.php.net/manual/en/function.socket-read.php Edit -- https://master.php.net/note/edit/72922 Del: integrated -- https://master.php.net/note/delete/72922/integrated Del: useless -- https://master.php.net/note/delete/72922/useless Del: bad code -- https://master.php.net/note/delete/72922/bad+code Del: spam -- https://master.php.net/note/delete/72922/spam Del: non-english -- https://master.php.net/note/delete/72922/non-english Del: in docs -- https://master.php.net/note/delete/72922/in+docs Del: other reasons-- https://master.php.net/note/delete/72922 Reject -- https://master.php.net/note/reject/72922 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#122827) next »