note 32449 deleted from function.socket-read by alindeman
| From: | alindeman@php.net | Date: | Wed, 28 May 2003 12:53:24 +0000 |
| Subject: | note 32449 deleted from function.socket-read by alindeman | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-49171@lists.php.net to get a copy of this message | ||
Note Submitter: Scott "Dragonslicer" Lerman
----
Something has changed with socket_read sometime between 4.3.0 and the May 14, 2003 build of
5.0.0-dev. (Feel free to correct me on when exactly the change occured, or if the change was
repaired in a dev version after May 14). In the older versions, PHP_NORMAL_READ would pull the \r or
\n that ended the read out of the socket along with the rest of the string. In the 5.0.0-dev that I
have, however, it seems to pull the \r, but not the \n. Therefore, the \n stays in the socket
buffer, so subsequent calls to socket_read with PHP_NORMAL_READ will just pull out empty strings.
Creative use of socket_read($socket, 1) can work around this.