We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Http2Client::isConnected()
1 parent 7703c9e commit 6ade264Copy full SHA for 6ade264
src/Http/V2/Client.php
@@ -59,6 +59,11 @@ public function close(): bool
59
return $this->client->close();
60
}
61
62
+ public function isConnected(): bool
63
+ {
64
+ return $this->client->connected;
65
+ }
66
+
67
private function transformResponse(SwResponse $request): ResponseInterface
68
{
69
return new Response(
tests/Cases/Http2ClientTest.php
@@ -39,6 +39,12 @@ public function testHttp2ServerReceived()
39
$client->send(new Request('/not-found'));
40
$response = $client->recv(1);
41
$this->assertSame(404, $response->getStatusCode());
42
43
+ $this->assertTrue($client->isConnected());
44
45
+ $client->close();
46
47
+ $this->assertFalse($client->isConnected());
48
});
49
50
0 commit comments