略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: EventBufferEvent::__construct

2024-12-22

EventBufferEvent::__construct

(PECL event >= 1.2.6-beta)

EventBufferEvent::__constructConstructs EventBufferEvent object

说明

public 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() .

参数

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.

返回值

Returns buffer event resource optionally associated with socket resource. */

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/eventbufferevent.construct.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3