Exemplo n.º 1
0
 /**
  * Initiates the closing handshake for a client connection
  *
  * @param Net_Notifier_WebSocket_Connection $client the client to close.
  * @param integer                           $code   optional. The WebSocket close
  *                                                  close reason code. If
  *                                                  not specified,
  *                                                  {@link Net_Notifier_WebSocket_Connection::CLOSE_NORMAL}
  *                                                  is used.
  * @param string                            $reason optional. A description
  *                                                  of why the connection
  *                                                  is being closed.
  *
  * @return void
  */
 protected function startCloseClient(Net_Notifier_WebSocket_Connection $client, $code = Net_Notifier_WebSocket_Connection::CLOSE_NORMAL, $reason = '')
 {
     $this->log(sprintf('disconnecting client from %s for reason "%s" ... ', $client->getIPAddress(), $reason), Net_Notifier_Logger::VERBOSITY_CLIENT);
     $client->startClose($code, $reason);
     $this->log('done' . PHP_EOL, Net_Notifier_Logger::VERBOSITY_CLIENT, false);
 }