mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-05 10:49:37 +02:00
Move from React 0.4.0 to 0.3.4 for PHP 5.3 compatibility reasons
This commit is contained in:
parent
d3f01a3bc7
commit
7f82bea13e
50 changed files with 608 additions and 1937 deletions
|
@ -2,14 +2,17 @@
|
|||
|
||||
namespace React\Socket;
|
||||
|
||||
use Evenement\EventEmitter;
|
||||
use React\EventLoop\LoopInterface;
|
||||
use React\Stream\WritableStreamInterface;
|
||||
use React\Stream\Buffer;
|
||||
use React\Stream\Stream;
|
||||
use React\Stream\Util;
|
||||
|
||||
class Connection extends Stream implements ConnectionInterface
|
||||
{
|
||||
public function handleData($stream)
|
||||
{
|
||||
// Socket is raw, not using fread as it's interceptable by filters
|
||||
// See issues #192, #209, and #240
|
||||
$data = stream_socket_recvfrom($stream, $this->bufferSize);
|
||||
if ('' === $data || false === $data || feof($stream)) {
|
||||
$this->end();
|
||||
|
@ -21,7 +24,9 @@ class Connection extends Stream implements ConnectionInterface
|
|||
public function handleClose()
|
||||
{
|
||||
if (is_resource($this->stream)) {
|
||||
// http://chat.stackoverflow.com/transcript/message/7727858#7727858
|
||||
stream_socket_shutdown($this->stream, STREAM_SHUT_RDWR);
|
||||
stream_set_blocking($this->stream, false);
|
||||
fclose($this->stream);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue