class EventHttpConnection (View source)

EventHttpConnection.

Represents an HTTP connection.

Methods

__construct(EventBase $base, EventDnsBase $dns_base, string $address, int $port, EventSslContext|null $ctx = null)

__construct.

false|EventBase
getBase()

getBase.

void
getPeer(string $address, int $port)

getPeer.

bool
makeRequest(EventHttpRequest $req, int $type, string $uri)

makeRequest.

void
setCloseCallback(callable $callback, mixed $data = null)

setCloseCallback.

void
setLocalAddress(string $address)

setLocalAddress.

void
setLocalPort(int $port)

setLocalPort.

void
setMaxBodySize(string $max_size)

setMaxBodySize.

void
setMaxHeadersSize(string $max_size)

setMaxHeadersSize.

void
setRetries(int $retries)

setRetries.

void
setTimeout(int $timeout)

setTimeout.

Details

__construct(EventBase $base, EventDnsBase $dns_base, string $address, int $port, EventSslContext|null $ctx = null)

__construct.

Constructs EventHttpConnection object.

Parameters

EventBase $base
EventDnsBase $dns_base
string $address
int $port
EventSslContext|null $ctx

See also

https://secure.php.net/manual/en/eventhttpconnection.construct.php

false|EventBase getBase()

getBase.

Returns event base associated with the connection.

void getPeer(string $address, int $port)

getPeer.

Gets the remote address and port associated with the connection.

Parameters

string $address
int $port

Return Value

void

See also

https://secure.php.net/manual/en/eventhttpconnection.getpeer.php

bool makeRequest(EventHttpRequest $req, int $type, string $uri)

makeRequest.

Makes an HTTP request over the specified connection.

Parameters

EventHttpRequest $req
int $type
string $uri

Return Value

bool

See also

https://secure.php.net/manual/en/eventhttpconnection.makerequest.php

void setCloseCallback(callable $callback, mixed $data = null)

setCloseCallback.

Set callback for connection close.

Parameters

callable $callback
mixed $data (optional)

Return Value

void

See also

https://secure.php.net/manual/en/eventhttpconnection.setclosecallback.php

void setLocalAddress(string $address)

setLocalAddress.

Sets the IP address from which HTTP connections are made.

Parameters

string $address

Return Value

void

See also

https://secure.php.net/manual/en/eventhttpconnection.setlocaladdress.php

void setLocalPort(int $port)

setLocalPort.

Sets the local port from which connections are made.

Parameters

int $port

Return Value

void

See also

https://secure.php.net/manual/en/eventhttpconnection.setlocalport.php

void setMaxBodySize(string $max_size)

setMaxBodySize.

Sets maximum body size for the connection.

Parameters

string $max_size

Return Value

void

See also

https://secure.php.net/manual/en/eventhttpconnection.setmaxbodysize.php

void setMaxHeadersSize(string $max_size)

setMaxHeadersSize.

Sets maximum header size.

Parameters

string $max_size

Return Value

void

See also

https://secure.php.net/manual/en/eventhttpconnection.setmaxheaderssize.php

void setRetries(int $retries)

setRetries.

Sets the retry limit for the connection.

Parameters

int $retries

Return Value

void

See also

https://secure.php.net/manual/en/eventhttpconnection.setretries.php

void setTimeout(int $timeout)

setTimeout.

Sets the timeout for the connection.

Parameters

int $timeout

Return Value

void

See also

https://secure.php.net/manual/en/eventhttpconnection.settimeout.php