Skip to content

Commit d5b4c60

Browse files
committed
Merge branch 'refs/heads/jm-child-process' into 0.4
Conflicts: src/React/Socket/Connection.php
2 parents 6f33723 + c212d55 commit d5b4c60

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Buffer.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ class Buffer extends EventEmitter implements WritableStreamInterface
2121
'file' => '',
2222
'line' => 0,
2323
);
24+
private $meta;
2425

2526
public function __construct($stream, LoopInterface $loop)
2627
{
2728
$this->stream = $stream;
2829
$this->loop = $loop;
30+
31+
if (is_resource($stream)) {
32+
$this->meta = stream_get_meta_data($stream);
33+
}
2934
}
3035

3136
public function isWritable()
@@ -78,7 +83,7 @@ public function close()
7883

7984
public function handleWrite()
8085
{
81-
if (!is_resource($this->stream) || feof($this->stream)) {
86+
if (!is_resource($this->stream) || ('generic_socket' === $this->meta['stream_type'] && feof($this->stream))) {
8287
$this->emit('error', array(new \RuntimeException('Tried to write to closed or invalid stream.')));
8388

8489
return;

0 commit comments

Comments
 (0)