php8.5
Home/ Manual/ event / eventbufferevent/ EventBufferEvent::__construct

EventBufferEvent::__construct

PHP function Edit on GitHub ✎

(PECL event >= 1.2.6-beta)

Constructs EventBufferEvent object

Description

EventBufferEvent::__construct(EventBase $base, mixed $socket = null, int $options = 0, callable $readcb = null, callable $writecb = null, callable $eventcb = null, mixed $arg = null)

Create a buffer event on a socket, stream or a file descriptor. Passing null to socket means that the socket should be created later, e.g. by means of EventBufferEvent::connect.

Parameters

base

Event base that should be associated with the new buffer event.

socket

May be created as a stream(not necessarily by means of sockets extension)

options

One of EventBufferEvent::OPT_* constants, or 0.

readcb

Read event callback. See About buffer event callbacks.

writecb

Write event callback. See About buffer event callbacks.

eventcb

Status-change event callback. See About buffer event callbacks.

arg

A variable that will be passed to all the callbacks.

See Also

  • EventBufferEvent::sslFilter
  • EventBufferEvent::sslSocket

Source: reference/event/eventbufferevent/construct.xml · from the official PHP manual (php/doc-en)