Skip to content

Commit 5a98fbb

Browse files
committed
Improve error handling on failed DNode::connect()
1 parent cadbd3a commit 5a98fbb

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/DNode/DNode.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function connect()
3838
throw new \Exception("For now we only support TCP connections to a defined port");
3939
}
4040

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

50-
var_dump('sleeping');
51-
sleep(1);
52-
5350
return;
5451
}
5552

0 commit comments

Comments
 (0)