[ws] Updated onError handle to make sure to close if conditions aren't met
This commit is contained in:
parent
78b6e2b6c8
commit
ef5ece0739
@ -149,10 +149,8 @@ class WsServer implements HttpServerInterface {
|
|||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function onError(ConnectionInterface $conn, \Exception $e) {
|
public function onError(ConnectionInterface $conn, \Exception $e) {
|
||||||
if ($conn->WebSocket->established) {
|
if ($conn->WebSocket->established && $this->connections->contains($conn)) {
|
||||||
if ($this->connections->contains($conn)) {
|
|
||||||
$this->component->onError($this->connections[$conn], $e);
|
$this->component->onError($this->connections[$conn], $e);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$conn->close();
|
$conn->close();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user