Commit 274b04d7 by BANice

去除协议中的var_dump()

parent 9f403f0d
GATEWAY_IP=127.0.0.1
GATEWAY_PORT=8282
GATEWAY_START_PORT=1230
GATEWAY_START_PORT=2310
GATEWAY_COUNT=4
GATEWAY_NAME=cdz
REGISTER_PORT=1239
REGISTER_IP=100.103.160.19
REGISTER_IP=127.0.0.1
REDIS_HOST=redis.staging.senthink.com
REDIS_PORT=6379
START_FILES=start_gateway
START_FILES=start_gateway|start_businessworker|start_register
DB_USER=cdz
DB_NAME=cdzpay
DB_PASSWORD=senthink123
......@@ -24,4 +24,4 @@ MESSAGE_START=MxqrGTUD9K3FiP5WsZvooam5LZdeCmFq7TqrZwoM4
MESSAGE_REFUND=b9Q6ZeQ6qDpuxymHcvlh0tX1GFV1Pzc_O0DOLIsnRNg
MESSAGE_FINISH=euUQrXFejUeyyxJbfaZQaRQfnXSqi05XMFLNfIsC0vA
MESSAGE_FINISH_INFO=mHD4sJPOYpYLcqWhQnRpJ-PQ99i_69tEZCK_w0NCI_c
MESSAGE_CHARGER_INFO=sCtztz8xYzsgR1IpZ5GohMuG9DScY5OOcI4VVEEwtg8
\ No newline at end of file
MESSAGE_CHARGER_INFO=sCtztz8xYzsgR1IpZ5GohMuG9DScY5OOcI4VVEEwtg8
/storage/
/.idea
\ No newline at end of file
/.idea
/.env
\ No newline at end of file
......@@ -63,6 +63,8 @@ class Events
public static function onConnect($clientId)
{
var_dump('connect');
Log::debug('connect', [
'time' => date('H:i:s'),
......@@ -74,6 +76,8 @@ class Events
public static function onMessage($clientId, $message)
{
var_dump($message);
$crc = substr($message, -2);
$makeCrc = sprintf('%08x', (Crc::crc(substr($message, 0, -2))));
......
......@@ -1537,3 +1537,20 @@ Stack trace:
2018-05-21 08:52:18 pid:2817 Workerman[start.php] start in DEBUG mode
2018-05-21 09:38:57 pid:2817 Workerman[start.php] stopping ...
2018-05-21 09:38:57 pid:2817 Workerman[start.php] has been stopped
2018-08-01 09:15:03 pid:15451 Workerman[start.php] start in DEBUG mode
2018-08-01 09:15:38 pid:15451 Workerman[start.php] stopping ...
2018-08-01 09:15:38 pid:15451 Workerman[start.php] has been stopped
2018-08-01 09:16:27 pid:15503 Workerman[start.php] start in DEBUG mode
2018-08-01 09:17:18 pid:15505 SendBufferToWorker fail. The connections between Gateway and BusinessWorker are not ready. See http://wiki.workerman.net/Error3
2018-08-01 09:17:18 pid:15505 SendBufferToWorker fail. The connections between Gateway and BusinessWorker are not ready. See http://wiki.workerman.net/Error3
2018-08-01 09:17:25 pid:15503 Workerman[start.php] stopping ...
2018-08-01 09:17:25 pid:15503 Workerman[start.php] has been stopped
2018-08-01 09:18:04 pid:15569 Workerman[start.php] start in DEBUG mode
2018-08-01 09:21:11 pid:15569 Workerman[start.php] stopping ...
2018-08-01 09:21:11 pid:15569 Workerman[start.php] has been stopped
2018-08-01 09:21:12 pid:15629 Workerman[start.php] start in DEBUG mode
2018-08-01 09:23:13 pid:15629 Workerman[start.php] stopping ...
2018-08-01 09:23:13 pid:15629 Workerman[start.php] has been stopped
2018-08-01 09:23:13 pid:15672 Workerman[start.php] start in DEBUG mode
2018-08-01 09:23:59 pid:15672 Workerman[start.php] stopping ...
2018-08-01 09:23:59 pid:15672 Workerman[start.php] has been stopped
......@@ -28,38 +28,33 @@ class Bintohex
$packageLength = strlen($data);
$packageLength/=2;
echo 'length' .$packageLength.PHP_EOL;
$packageLength /= 2;
//小于最小的头长度继续等待
if($packageLength < self::HEAD_LENGTH)
{
var_dump('package length less than '.self::HEAD_LENGTH);
if ($packageLength < self::HEAD_LENGTH) {
return 0;
}
//数据非ffaa开头直接断开连接
if(substr($data,0,4) !== 'ffaa')
{
if (substr($data, 0, 4) !== 'ffaa') {
$tcpConnection->close();
}
$hexCount = hexdec(substr($data,8,4));
$hexCount = hexdec(substr($data, 8, 4));
if($packageLength >= $hexCount)
{
if ($packageLength >= $hexCount) {
return $hexCount;
}else{
} else {
return 0;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment