note 115463 added to function.socket-write

From: Date: Mon, 28 Jul 2014 15:12:28 +0000
Subject: note 115463 added to function.socket-write
Groups: php.notes 
Request: Send a blank email to php-notes+get-200064@lists.php.net to get a copy of this message
Watch out for these examples and contributions. First off, in the official examples you must confirm that socket_write() has written your data, and in most cases that it has written all your data, as the example is usually a "write one thing and then finish" case where the socket is not left open. I am pretty sure you cannot keep calling socket_write() on data that you already called it upon just because it has not been sent in the first call to socket_write(). If buffering ever occurs, you would end up re-sending fragments of your data. You should not use a sleep/wait to compensate for the fact that output is buffered. And finally, you should not be confused as to why separating your data into two separate calls to socket_write() results in receiving data on the far end, and yet one call does not. All of these problems with the contributed examples show a lack of understanding of Buffering. ---- Server IP: 72.52.91.14 Probable Submitter: 206.47.249.246 ---- Manual Page -- http://php.net/manual/en/function.socket-write.php Edit -- https://master.php.net/note/edit/115463 Del: integrated -- https://master.php.net/note/delete/115463/integrated Del: useless -- https://master.php.net/note/delete/115463/useless Del: bad code -- https://master.php.net/note/delete/115463/bad+code Del: spam -- https://master.php.net/note/delete/115463/spam Del: non-english -- https://master.php.net/note/delete/115463/non-english Del: in docs -- https://master.php.net/note/delete/115463/in+docs Del: other reasons-- https://master.php.net/note/delete/115463 Reject -- https://master.php.net/note/reject/115463 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#200064) next »