diff --git a/VERSION b/VERSION index 6a6a3d8..097a15a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.6.1 +2.6.2 diff --git a/src/PHPWebSockets/UpdatesWrapper.php b/src/PHPWebSockets/UpdatesWrapper.php index 67b93eb..c9f42bc 100644 --- a/src/PHPWebSockets/UpdatesWrapper.php +++ b/src/PHPWebSockets/UpdatesWrapper.php @@ -261,7 +261,7 @@ public function update(float $timeout = NULL, array $tempStreams = []) { $this->_onInvalidStream($update); break; case Update\Error::C_ASYNC_CONNECT_FAILED: - $this->_onDisconnect($update); + $this->_onAsyncConnectFailed($update); break; default: throw new \UnexpectedValueException('Unknown or unsupported update code for error: ' . $code); @@ -597,4 +597,13 @@ private function _onInvalidStream(Update\Error $update) { private function _onDisconnectDuringHandshake(Update\Error $update) { $this->_triggerErrorHandler($update->getSourceConnection(), $update->getCode()); } + + private function _onAsyncConnectFailed(Update\Error $update) { + + $source = $update->getSourceConnection(); + + $this->_triggerDisconnectHandler($source, FALSE, NULL); + $this->_handledDisconnects[$source->getResourceIndex()] = TRUE; + + } }