Closed Geslain closed 10 years ago
In addition an little MWE for explain that :) https://gist.github.com/camael24/9c601fb14ee003ac7896
I've tested the @camael24 gist and I can reproduce the problem. I tried to debug but can't find where is the problem :-(
While discussing with @Geslain we found that the problem seems to come from :
Because $old
is a resource of type unknown (and we except stream) when the client disconnect. It break, disconnect the current client and stop the broadcast.
If you comment these lines
there is no problem anymore (but it's not a solution !).
A temporary solution seems to be surrounding the _setStream($old) with try catch instructions :
return function ( ) use ( &$send, &$old, &$self ) {
$out = call_user_func_array($send, func_get_args());
try {
$self->getConnection()->_setStream($old);
} catch (\Hoa\Core\Exception\Exception $e) {
echo 'Get Exception : ', $e->getMessage(), "\n";
}
return $out;
};
This patch https://github.com/hoaproject/Stream/pull/4 on Hoa\Stream
should fix your issue. Can you confirm please?
Working for me too
I am asking the review of @osaris and @camael24 also :-).
Tested and it works. Good job !
Same hère
jeudi 24 juillet 2014 19:05 +0200 de Raphaël Emourgeon notifications@github.com: Tested and it works. Good job ! — Reply to this email directly or view it on GitHub .
Closed by https://github.com/hoaproject/Stream/pull/4.
Hi,
When i try to Use the broadcast() function on a close event in the server, if a client disconnect himself, the first remaining connected client gets disconnected and he's the only one to receive the broadcast message . Others don't receive anything.
To understand, here's an example :