Пример #1
0
 /**
  * Process main logic
  */
 public function run()
 {
     // init first time
     if (!$this->port) {
         $ports = $this->ports;
         $this->port = array_pop($ports);
         // current process's port (no shared)
         $this->ports = $ports;
         // store children process pid
         // do only once !!!
         $this->__pid(true);
     } else {
         echo "\n";
     }
     echo "Listening on : " . $this->port . "\n";
     try {
         // start socket message queue server
         $server = Pms_Adaptor::server(array('host' => $this->host, 'port' => $this->port));
         $server->daemon();
     } catch (Exception $e) {
         Hush_Util::trace($e);
         $server->close();
         $this->run();
     }
 }