On 28 March 2016 at 02:57, Grzegorz Zdanowski <grzegorz...@gmail.com> wrote:
> Hello!
>
>  by „gone away“
> I mean some underlying error like forceful close of FD and not a
> standard disconnection
> of the client.

What problem exactly are you trying to solve, and do you have a way of
showing the problem that isn't just what looks like a programming
mistake?

e.g. The following code works fine. The file being closed doesn't
affect the filehandle

$fileHandle = fopen('foo.txt', 'r+');
unlink('foo.txt');
$data = fread($fileHandle, 20);

The following code doesn't work fine. The filehandle being closed,
surprisingly enough, makes it not usable any more:

$fileHandle = fopen('foo.txt', 'r+');
fclose($fileHandle);
$data = fread($fileHandle, 20);

or, as the link you sent puts it:

> If a connection is closed at client side, and you call select() on the server 
> side socket, FD_READ will be triggered and recv() will return zero, then you 
> can close the socket at server side.
>
> The "bad file descriptor" error only happens when you call API on an already 
> closed socket.

So I don't understand what problem you're trying to analyze, other
than closed file descriptors are closed.

cheers
Dan

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to