amphp / byte-stream

A non-blocking stream abstraction for PHP based on Amp.

Home Page:https://amphp.org/byte-stream

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in ResourceOutputStream, fwrite

opened this issue · comments

After last commit, I get strange errors:

Amp\ByteStream\StreamException: Failed to write to socket Errno: 2; stream_socket_accept(): accept failed: Connection timed out

and

Amp\ByteStream\StreamException: Failed to write to socket Errno: 2; inet_pton(): Unrecognized address 127.0.0.1:11001

after some research i find that problems are from this:
https://github.com/amphp/byte-stream/blob/master/lib/ResourceOutputStream.php#L71

if I call it without $chunkSize all is ok!

is this problem from PHP ?
I am using this:
PHP 7.1.3 (cli) (built: Mar 17 2017 13:43:06) ( NTS )

Only I get this bug ?
Can someone confirm this ?

UPDATE: find problem, preparing pull request