final class EventHttp (View source)

EventHttp.

Represents HTTP server.

Methods

__construct(EventBase $base, EventSslContext|null $ctx = null)

__construct.

bool
accept(mixed $socket)

accept.

bool
addServerAlias(string $alias)

addServerAlias.

bool
bind(string $address, int $port)

bind.

bool
removeServerAlias(string $alias)

removeServerAlias.

void
setAllowedMethods(int $methods)

setAllowedMethods.

bool
setCallback(string $path, string $cb, string|null $arg = null)

setCallback.

void
setDefaultCallback(string $cb, string|null $arg = null)

setDefaultCallback.

void
setMaxBodySize(int $value)

setMaxBodySize.

void
setMaxHeadersSize(int $value)

setMaxHeadersSize.

void
setTimeout(int $value)

setTimeout.

Details

__construct(EventBase $base, EventSslContext|null $ctx = null)

__construct.

Constructs EventHttp object(the HTTP server).

bool accept(mixed $socket)

accept.

Makes an HTTP server accept connections on the specified socket stream or resource.

Parameters

mixed $socket

Return Value

bool

See also

https://secure.php.net/manual/en/eventhttp.accept.php

bool addServerAlias(string $alias)

addServerAlias.

Adds a server alias to the HTTP server object.

Parameters

string $alias

Return Value

bool

See also

https://secure.php.net/manual/en/eventhttp.addserveralias.php

bool bind(string $address, int $port)

bind.

Binds an HTTP server on the specified address and port.

Parameters

string $address
int $port

Return Value

bool

See also

https://secure.php.net/manual/en/eventhttp.bind.php

bool removeServerAlias(string $alias)

removeServerAlias.

Removes server alias.

Parameters

string $alias

Return Value

bool

See also

https://secure.php.net/manual/en/eventhttp.removeserveralias.php

void setAllowedMethods(int $methods)

setAllowedMethods.

Sets the what HTTP methods are supported in requests accepted by this server, and passed to user callbacks.

Parameters

int $methods

Return Value

void

See also

https://secure.php.net/manual/en/eventhttp.setallowedmethods.php

bool setCallback(string $path, string $cb, string|null $arg = null)

setCallback.

Sets a callback for specified URI.

Parameters

string $path
string $cb
string|null $arg (optional)

Return Value

bool

See also

https://secure.php.net/manual/en/eventhttp.setcallback.php

void setDefaultCallback(string $cb, string|null $arg = null)

setDefaultCallback.

Sets default callback to handle requests that are not caught by specific callbacks.

Parameters

string $cb
string|null $arg (optional)

Return Value

void

See also

https://secure.php.net/manual/en/eventhttp.setdefaultcallback.php

void setMaxBodySize(int $value)

setMaxBodySize.

Sets maximum request body size.

Parameters

int $value

Return Value

void

See also

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

void setMaxHeadersSize(int $value)

setMaxHeadersSize.

Sets maximum HTTP header size.

Parameters

int $value

Return Value

void

See also

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

void setTimeout(int $value)

setTimeout.

Sets the timeout for an HTTP request.

Parameters

int $value

Return Value

void

See also

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