当前位置: 首页>>代码示例>>PHP>>正文


PHP Daemon::useSockets方法代码示例

本文整理汇总了PHP中Daemon::useSockets方法的典型用法代码示例。如果您正苦于以下问题:PHP Daemon::useSockets方法的具体用法?PHP Daemon::useSockets怎么用?PHP Daemon::useSockets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Daemon的用法示例。


在下文中一共展示了Daemon::useSockets方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initSettings

 public static function initSettings()
 {
     Daemon::$version = file_get_contents(Daemon::$dir . '/VERSION');
     Daemon::$settings = array('maxrequests' => '1k', 'maxmemoryusage' => '0b', 'maxidle' => '0s', 'expose' => 1, 'pidfile' => '/var/run/phpdaemon.pid', 'defaultpidfile' => '/var/run/phpdaemon.pid', 'configfile' => Daemon::$dir . '/conf/phpdaemon.conf.php', 'chroot' => '/', 'cwd' => '.', 'path' => NULL, 'startworkers' => 20, 'minworkers' => 20, 'maxworkers' => 80, 'minspareworkers' => 20, 'maxspareworkers' => 50, 'obfilterauto' => 1, 'logstorage' => '/var/log/phpdaemon-%DATE=d.m.Y%.log', 'logging' => 1, 'user' => NULL, 'group' => NULL, 'keepalive' => '0s', 'autoreadbodyfile' => 1, 'ipcwstate' => '/var/run/phpdaemon-wstate.ipc', 'autogc' => '1', 'mpmdelay' => '1s', 'logsignals' => 0, 'chunksize' => '8k', 'maxconcurrentrequestsperworker' => 1000, 'logreads' => 0, 'autoreload' => '0s', 'logworkersetstatus' => 0, 'logevents' => 0, 'logqueue' => 0, 'microsleep' => 100000, 'logsendrecordmiss' => 0, 'workerpriority' => 4, 'masterpriority' => 100, 'throwexceptiononshutdown' => 0, 'locale' => '', 'logerrors' => 1);
     Daemon::loadSettings(Daemon::$settings);
     Daemon::$useSockets = version_compare(PHP_VERSION, '5.3.1', '>=');
     Daemon::$dummyRequest = new stdClass();
     Daemon::$dummyRequest->attrs = new stdClass();
     Daemon::$dummyRequest->attrs->stdin_done = TRUE;
     Daemon::$dummyRequest->attrs->params_done = TRUE;
     Daemon::$dummyRequest->attrs->chunked = FALSE;
 }
开发者ID:svcorp77,项目名称:phpdaemon,代码行数:12,代码来源:Daemon.class.php

示例2: initSettings

 /**
  * Loads default setting.
  * @return void
  */
 public static function initSettings()
 {
     Daemon::$version = file_get_contents('VERSION', true);
     Daemon::$config = new Daemon_Config();
     Daemon::$useSockets = version_compare(PHP_VERSION, '5.3.1', '>=');
     // currently re-using listener ports across multiple processes is available
     // only in BSD flavour operating systems via SO_REUSEPORT socket option
     Daemon::$reusePort = (bool) preg_match("~BSD~i", php_uname('s'));
     if (Daemon::$reusePort) {
         if (!defined("SO_REUSEPORT")) {
             define("SO_REUSEPORT", 0x200);
         }
     }
     // FIXME: this is a BSD-only hack
 }
开发者ID:J3FF3,项目名称:phpdaemon,代码行数:19,代码来源:Daemon.php


注:本文中的Daemon::useSockets方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。