Skip to content

Commit

Permalink
static_server
Browse files Browse the repository at this point in the history
  • Loading branch information
xtgxiso committed Nov 14, 2016
1 parent 7431545 commit 7d98ca6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions App.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class App extends Worker

public $onAppStart = NULL;

public $statistic = false;
public $statistic_server = false;

public function __construct($socket_name, $context_option = array())
{
Expand Down Expand Up @@ -92,9 +92,9 @@ public function onClientMessage($connection,$data){
$connection->send($str);
return;
}
if ( $this->statistic ){
if ( $this->statistic_server ){
require_once __DIR__ . '/Libs/StatisticClient.php';
$statistic_address = 'udp://127.0.0.1:55656';
$statistic_address = $this->statistic_server;
}
$this->conn = $connection;
$url= $_SERVER["REQUEST_URI"];
Expand Down Expand Up @@ -132,7 +132,7 @@ public function onClientMessage($connection,$data){
break;
}
}
if ( $this->statistic ){
if ( $this->statistic_server ){
StatisticClient::report($class, $method, 1, 0, '', $statistic_address);
}
}catch (\Exception $e) {
Expand All @@ -141,15 +141,15 @@ public function onClientMessage($connection,$data){
echo $e;
}
$code = $e->getCode() ? $e->getCode() : 500;
if ( $this->statistic ){
if ( $this->statistic_server ){
StatisticClient::report($class, $method, $success, $code, $e, $statistic_address);
}
}
}else{
$this->show_404($connection);
$code = 404;
$msg = "class $class not found";
if ( $this->statistic ){
if ( $this->statistic_server ){
StatisticClient::report($class, $method, $success, $code, $msg, $statistic_address);
}
}
Expand Down

0 comments on commit 7d98ca6

Please sign in to comment.