Skip to content

Commit 0fc2f2a

Browse files
authored
Merge pull request #230 from Expensify/flo_revert
2 parents 4b813ec + 29b0581 commit 0fc2f2a

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "expensify/bedrock-php",
33
"description": "Bedrock PHP Library",
44
"type": "library",
5-
"version": "2.1.3",
5+
"version": "2.1.4",
66
"authors": [
77
{
88
"name": "Expensify",

src/Client.php

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -552,29 +552,7 @@ private function sendRawRequest(string $host, int $port, string $rawRequest)
552552
@socket_connect($this->socket, $host, $port);
553553
$socketErrorCode = socket_last_error($this->socket);
554554
if ($socketErrorCode === 115) {
555-
$this->logger->info('Bedrock\Client - socket_connect returned EINPROGRESS, waiting for connection to complete');
556-
557-
// Use select to wait for the socket to become writable (indicates connection completion)
558-
$write = [$this->socket];
559-
$read = null;
560-
$except = null;
561-
562-
$selectResult = socket_select($read, $write, $except, $this->connectionTimeout, $this->connectionTimeoutMicroseconds);
563-
if ($selectResult === false) {
564-
$socketError = socket_strerror(socket_last_error());
565-
throw new ConnectionFailure("Failed to select on socket for host $host:$port. Error: $socketError");
566-
} elseif ($selectResult === 0) {
567-
throw new ConnectionFailure("Connection timeout while waiting for EINPROGRESS completion for host $host:$port");
568-
}
569-
570-
// Check if connection completed successfully
571-
$connectionError = socket_get_option($this->socket, SOL_SOCKET, SO_ERROR);
572-
if ($connectionError !== 0) {
573-
$socketError = socket_strerror($connectionError);
574-
throw new ConnectionFailure("Connection failed after EINPROGRESS for host $host:$port. Error: $connectionError $socketError");
575-
}
576-
577-
$this->logger->info('Bedrock\Client - EINPROGRESS connection completed successfully');
555+
$this->logger->info('Bedrock\Client - socket_connect returned error 115, continuing.');
578556
} elseif ($socketErrorCode) {
579557
$socketError = socket_strerror($socketErrorCode);
580558
throw new ConnectionFailure("Could not connect to Bedrock host $host:$port. Error: $socketErrorCode $socketError");

0 commit comments

Comments
 (0)