コード例 #1
0
ファイル: Watchdog.php プロジェクト: nask0/Wild-IRC-Bot
 /**
  * Checks if ping timed out.
  * @param Timer $e The timer.
  */
 public function pingTimer($e)
 {
     if ($this->lastActivity + self::TIMEOUT < time()) {
         // Ping timed out. Reconnecting time!
         $this->bot->log('Ping timeout detected. Attempting to reconnect.', array(), LogLevels::WARNING);
         $this->bot->reconnect();
     }
     // Check back in another round.
     $e->extend(self::TIMEOUT);
 }
コード例 #2
0
 /**
  * Flushes queues. Called by timer.
  * @param Timer $e The timer that called this method.
  */
 public function flush(Timer $e)
 {
     $e->extend(5);
 }