Client
class Client implements ClientInterface
Properties
| protected Client | $client |
Methods
__construct(string $host, int $port = 80, bool $ssl = false, array $settings = [])
Create a new HTTP/2 client instance.
int
ResponseInterface|null
recv(float $timeout = 0)
Receive an HTTP/2 response.
void
write(int $streamId, string $data, bool $end = false, float|null $timeout = null)
Write data to a stream.
void
close()
Close the connection.
bool
isConnected()
Determine if the client is connected.
bool
isStreamOpen(int $streamId)
Determine whether the stream remains open.
Details
at line 24
__construct(string $host, int $port = 80, bool $ssl = false, array $settings = [])
Create a new HTTP/2 client instance.
at line 48
int
send(RequestInterface $request, float|null $timeout = null)
Send an HTTP/2 request.
at line 67
ResponseInterface|null
recv(float $timeout = 0)
Receive an HTTP/2 response.
at line 89
void
write(int $streamId, string $data, bool $end = false, float|null $timeout = null)
Write data to a stream.
at line 110
void
close()
Close the connection.
at line 130
bool
isConnected()
Determine if the client is connected.
at line 138
bool
isStreamOpen(int $streamId)
Determine whether the stream remains open.