Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Improve error handling on failed DNode::connect()
Browse files Browse the repository at this point in the history
  • Loading branch information
igorw committed Feb 5, 2013
1 parent cadbd3a commit 5a98fbb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/DNode/DNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function connect()
throw new \Exception("For now we only support TCP connections to a defined port");
}

$client = stream_socket_client("tcp://{$params['host']}:{$params['port']}");
$client = @stream_socket_client("tcp://{$params['host']}:{$params['port']}");
if (!$client) {
$e = new \RuntimeException("No connection to DNode server in tcp://{$params['host']}:{$params['port']}");
$this->emit('error', array($e));
Expand All @@ -47,9 +47,6 @@ public function connect()
trigger_error((string) $e, E_USER_ERROR);
}

var_dump('sleeping');
sleep(1);

return;
}

Expand Down

0 comments on commit 5a98fbb

Please sign in to comment.