final class EventListener (View source)

EventListener.

Represents a connection listener.

Constants

OPT_LEAVE_SOCKETS_BLOCKING

OPT_CLOSE_ON_FREE

OPT_CLOSE_ON_EXEC

OPT_REUSEABLE

OPT_THREADSAFE

OPT_DISABLED

OPT_DEFERRED_ACCEPT

Properties

int $fd

Methods

__construct(EventBase $base, callable $cb, mixed $data, int $flags, int $backlog, mixed $target)

__construct.

bool
disable()

disable.

bool
enable()

enable.

void
free()

No description

void
getBase()

getBase.

static bool
getSocketName(string $address, int $port)

getSocketName.

void
setCallback(callable $cb, mixed $arg = null)

setCallback.

void
setErrorCallback(string $cb)

setErrorCallback.

Details

__construct(EventBase $base, callable $cb, mixed $data, int $flags, int $backlog, mixed $target)

__construct.

Creates new connection listener associated with an event base.

Parameters

EventBase $base
callable $cb
mixed $data
int $flags
int $backlog
mixed $target

See also

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

bool disable()

disable.

Disables an event connect listener object.

bool enable()

enable.

Enables an event connect listener object.

void free()

No description

Return Value

void

void getBase()

getBase.

Returns event base associated with the event listener.

static bool getSocketName(string $address, int $port)

getSocketName.

Retreives the current address to which the listener's socket is bound.

Parameters

string $address
int $port

Return Value

bool

See also

https://secure.php.net/manual/en/eventlistener.getsocketname.php

void setCallback(callable $cb, mixed $arg = null)

setCallback.

The setCallback purpose.

Parameters

callable $cb
mixed $arg

= null

Return Value

void

See also

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

void setErrorCallback(string $cb)

setErrorCallback.

Set event listener's error callback.

Parameters

string $cb

Return Value

void

See also

https://secure.php.net/manual/en/eventlistener.seterrorcallback.php