Skip to content

Commit

Permalink
Merge pull request #60 from WarriorXK/hotfix/2.6.2
Browse files Browse the repository at this point in the history
Hotfix/2.6.2
  • Loading branch information
WarriorXK authored Jun 4, 2020
2 parents 63c1ca8 + 93d2f45 commit 38928d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.1
2.6.2
11 changes: 10 additions & 1 deletion src/PHPWebSockets/UpdatesWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

}
}

0 comments on commit 38928d6

Please sign in to comment.