diff --git a/src/React/Stomp/Factory.php b/src/React/Stomp/Factory.php index 93fcfe9..96edc3e 100644 --- a/src/React/Stomp/Factory.php +++ b/src/React/Stomp/Factory.php @@ -43,6 +43,10 @@ public function createClient(array $options = array()) $input->emit('error', array($e)); }); + $conn->on('end', function () { + throw new ConnectionException('Connection has been lost'); + }); + return new Client($this->loop, $input, $output, $options); }