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
send(RequestInterface $request, float|null $timeout = null)

Send an HTTP/2 request.

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.

Parameters

string $host
int $port
bool $ssl
array $settings

at line 48
int send(RequestInterface $request, float|null $timeout = null)

Send an HTTP/2 request.

Parameters

RequestInterface $request
float|null $timeout

Return Value

int

Stream identifier

at line 67
ResponseInterface|null recv(float $timeout = 0)

Receive an HTTP/2 response.

Parameters

float $timeout

Return Value

ResponseInterface|null

at line 89
void write(int $streamId, string $data, bool $end = false, float|null $timeout = null)

Write data to a stream.

Parameters

int $streamId
string $data
bool $end
float|null $timeout

Return Value

void

at line 110
void close()

Close the connection.

Return Value

void

at line 130
bool isConnected()

Determine if the client is connected.

Return Value

bool

at line 138
bool isStreamOpen(int $streamId)

Determine whether the stream remains open.

Parameters

int $streamId

Return Value

bool