diff --git a/src/Client.php b/src/Client.php index 32fb43f..8de9b91 100644 --- a/src/Client.php +++ b/src/Client.php @@ -202,6 +202,7 @@ public function setLogger(?LoggerInterface $logger): self public function setTimeout(float $value): self { + $this->connect(); $seconds = (int) floor($value); $milliseconds = (int) (1000 * ($value - $seconds)); diff --git a/tests/SubjectTest.php b/tests/SubjectTest.php index c7c1a71..ac71b89 100644 --- a/tests/SubjectTest.php +++ b/tests/SubjectTest.php @@ -12,7 +12,7 @@ class SubjectTest extends Test { public function testPerformance() { - $client = $this->createClient()->setDelay(0); + $client = $this->createClient()->setTimeout(0.1)->setDelay(0); $client->setLogger(null); $this->logger?->info('start performance test');