Swoole\Event->set

Declaration

<?php
Swoole\Event->set(int $fd, mixed $read_callback, mixed $write_callback, int $flags)

Parameters

fd

fd of the socket

read_callback

Read callback function

write_callback

Write callback function

flags

flags: SWOOLE_EVENT_READ SWOOLE_EVENT_WRITE SWOOLE_EVENT_READ|SWOOLE_EVENT_WRITE

Return

success

if success, it returns TRUE, otherwise it returns FALSE.

Description

Update the read, write callback function and flags registed on the Event Loop.

Example