<?php
Swoole\Event->isset(int $fd, int $events = SWOOLE_EVENT_READ | SWOOLE_EVENT_WRITE)
fd
of the socket
SWOOLE_EVENT_READ
SWOOLE_EVENT_WRITE
SWOOLE_EVENT_WRITE|SWOOLE_EVENT_READ
if success, it returns TRUE, otherwise it returns FALSE.
Check if the fd
is registed on event
on the Event Loop.
<?php
use Swoole\Event;
$fp = stream_socket_client("tcp://www.google.com:80", $errno, $errstr, 30);
fwrite($fp,"GET / HTTP/1.1\r\nHost: www.google.com\r\n\r\n");
Event::add($fp, function($fp) {
$resp = fread($fp, 8192);
Swoole\Event::del($fp);
fclose($fp);
}, null, SWOOLE_EVENT_READ);
var_dump(Event::isset($fp, SWOOLE_EVENT_READ));
var_dump(Event::isset($fp, SWOOLE_EVENT_WRITE));
var_dump(Event::isset($fp, SWOOLE_EVENT_READ | SWOOLE_EVENT_WRITE));