require('/etc/cdrtool/global.inc'); require('cdr_generic.php'); require('rating.php'); require('rating_server.php'); // Init Rating Engine syslog(LOG_NOTICE,"Starting CDRTool Rating Engine..."); $RatingEngineServer = new RatingEngine(); if (!$RatingEngineServer->init_ok) { syslog(LOG_NOTICE,'Error: Cannot start Rating Engine, fix the errors and try again'); exit; } syslog(LOG_NOTICE,"Rating Engine started sucesfully, going to background..."); // Go to the background $d = new Daemon('/var/run/ratingEngine.pid'); $d->start(); $daemon = new socketDaemon(); $server = $daemon->create_server('ratingEngineServer', 'ratingEngineClient', $RatingEngine['socketIP'], $RatingEngine['socketPort']); syslog(LOG_NOTICE,"Rating Engine is now ready to serve network requests"); $daemon->process(); ?>
#!/usr/bin/php -Cq <?php /* phpSocketDaemon 1.0 Copyright (C) 2006 Chris Chabot <*****@*****.**> See http://www.chabotc.nl/ for more information This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ ini_set('mbstring.func_overload', '0'); ini_set('output_handler', ''); error_reporting(E_ALL | E_STRICT); @ob_end_flush(); set_time_limit(0); include "socket.php"; include "httpServer.php"; $daemon = new socketDaemon(); $server = $daemon->create_server('httpdServer', 'httpdServerClient', 0, 2001); $daemon->process();
<?php error_reporting(E_ALL); set_time_limit(0); ob_implicit_flush(); require_once realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'conf' . DIRECTORY_SEPARATOR . 'includes.php'; new MySQLDBase(MYSQLHOST . ':' . MYSQLPORT, MYSQLUSER, MYSQLPASSWORD, MYSQLDBASE); $daemon = new socketDaemon(); $server = $daemon->create_server('gameServer', 'gameServerClient', SERVER_IP, SERVER_PORT); $daemon->process();
<?php include 'phpsocketdaemon/socket.php'; include 'FlashServer.php'; include 'PolicyServer.php'; set_time_limit(0); $daemon = new socketDaemon(); $server = $daemon->create_server('PolicyServer', 'PolicyServerClient', '0.0.0.0', 843); $server = $daemon->create_server('FlashServer', 'FlashServerClient', '0.0.0.0', 5011); echo 'Server started!'; $daemon->process();