EventConfig::requireFeatures
EventConfig::requireFeatures
(PECL event >= 1.2.6-beta)
EventConfig :: requireFeatures - 输入应用程序要求的必需事件方法功能
描述
public bool EventConfig::requireFeatures ( int $feature )
输入应用程序要求的必需事件方法功能
参数
feature
所需功能的位掩码。请参阅 EventConfig :: FEATURE_ *常量
返回值
例子
示例#1 EventConfig :: requireFeatures()示例
<?php
$cfg = new EventConfig(
// Create event_base associated with the config
$base = new EventBase($cfg
// Require FDS feature
if ($cfg->requireFeatures(EventConfig::FEATURE_FDS)) {
echo "FDS feature is now requried\n";
$base = new EventBase($cfg
($base->getFeatures() & EventConfig::FEATURE_FDS)
and print("FDS - arbitrary file descriptor types, and not just sockets\n"
}
?>
上面的例子会输出类似于:
FDS feature is now requried
FDS - arbitrary file descriptor types, and not just sockets
也可以看看
- EventBase :: getFeatures() - 返回支持的功能的位掩码
← EventConfig::__construct
EventConfig::setMaxDispatchInterval →