Skip to content

Commit

Permalink
Set correct timeout in ConnectContext
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Aug 2, 2019
1 parent 7caa006 commit ac5d90e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Connection/DefaultConnectionPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function getConnection(Request $request, CancellationToken $cancellation)
$checkoutCancellationToken = new CombinedCancellationToken($cancellation, new TimeoutCancellationToken($request->getTcpConnectTimeout()));

/** @var EncryptableSocket $socket */
$socket = yield $this->connector->connect('tcp://' . $authority, $connectContext, $checkoutCancellationToken);
$socket = yield $this->connector->connect('tcp://' . $authority, $connectContext->withConnectTimeout($request->getTcpConnectTimeout()), $checkoutCancellationToken);
} catch (Socket\ConnectException $e) {
throw new SocketException(\sprintf("Connection to '%s' failed", $authority), 0, $e);
} catch (CancelledException $e) {
Expand Down

0 comments on commit ac5d90e

Please sign in to comment.