varspool / Wrench

A simple PHP WebSocket implementation for PHP 7.1
Do What The F*ck You Want To Public License
596 stars 210 forks source link

Socket stream lost handling #55

Closed jdolieslager closed 10 years ago

jdolieslager commented 10 years ago

When dealing with long running PHP background jobs, the situation can occur that the socket is not available or an error occured on the socket. The socket instance does not disconnect in such events, either the Client does not check if the socket is still connected.

jdolieslager commented 10 years ago

@dominics No activity anymore?

dominics commented 10 years ago

Sorry, it can take me while to look at stuff. But this looks really good!

One question: is it valid to call stream_socket_shutdown on a handle you've received feof or fread() === false for? If so, we're good to go. (Otherwise we may just have to unset $this->socket before calling disconnect)