| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Administrator
- * Date: 2019/5/23
- * Time: 17:42
- */
- define('START_TIME', microtime(true));
- require __DIR__.'/../vendor/autoload.php';
- \app\lib\boot::init();
- use WebSocket\Client as Client;
- $conf = \app\lib\GlobConfigs::getKey('admin_conf');
- $url = "?token=".$conf['admin_token'];
- $client = new Client("ws://192.168.2.200:9090/".$url);
- $data = '{"title":"odds","game_code":"zq","match_id":"3740504","lg_id":"2630139","source":"hg0088","data":[{"match_id":"3740504","lg_id":"2630139","odds_code":"ior_HTSY","status":0,"sort":0,"p_code":"sw_HTS","odds":3.14,"condition":"\u662f","odds_only":"2a1fd6f86b9d61545286ceec5b8d9404","sole":"2a1fd6f86b9d61545286ceec5b8d9404","source":"hg0088","type":0,"team":""},{"match_id":"3740504","lg_id":"2630139","odds_code":"","status":0,"sort":0,"p_code":"sw_HTS","odds":4.23,"condition":"\u4e0d\u662f","odds_only":"4f78d4ecabf5c41cf07d9b79eef1fd26","sole":"4f78d4ecabf5c41cf07d9b79eef1fd26","source":"hg0088","type":0,"team":""},{"match_id":"3740504","lg_id":"2630139","odds_code":"half_two_sides_single","status":0,"sort":0,"p_code":"two_sides","odds":3.22,"condition":"\u5355","odds_only":"5702dbf44a3d373379bbd7385315deb5","sole":"5702dbf44a3d373379bbd7385315deb5","source":"hg0088","type":0,"team":""},{"match_id":"3740504","lg_id":"2630139","odds_code":"half_two_sides_double","status":0,"sort":0,"p_code":"two_sides","odds":5.44,"condition":"\u53cc","odds_only":"45478113634bf90d6fef75629bd4a225","sole":"45478113634bf90d6fef75629bd4a225","source":"hg0088","type":0,"team":""}]}';
- $data = htmlentities($data);
- $array = [
- "title"=>"odds",
- "game_code"=>"zq",
- "match_id"=>"3740504",
- "lg_id"=>"2630139",
- "source"=>"hg0088",
- "data"=>[
- [
- "match_id"=>"3740504","lg_id"=>"2630139","odds_code"=>"ior_HTSY","status"=>0,"sort"=>0,"p_code"=>"sw_HTS","odds"=>3.14,"condition"=>"大","odds_only"=>"2a1fd6f86b9d61545286ceec5b8d9404","sole"=>"2a1fd6f86b9d61545286ceec5b8d9404","source"=>"hg0088","type"=>0,"team"=>""
- ],
- [
- "match_id"=>"3740504","lg_id"=>"2630139","odds_code"=>"ior_HTSY","status"=>0,"sort"=>0,"p_code"=>"sw_HTS","odds"=>3.14,"condition"=>"大","odds_only"=>"2a1fd6f86b9d61545286ceec5b8d9404","sole"=>"2a1fd6f86b9d61545286ceec5b8d9404","source"=>"hg0088","type"=>0,"team"=>""
- ]
- ]
- ];
- //str = '{"cmd":"test","act":"odds","data":"'.json_encode($array,256).'","time":1558492565,"token":"aasasfa"}';
- $lastArr = [
- "cmd"=>"test",
- "act"=>"odds",
- "time"=>1558492565,
- "token"=>"aasasfa",
- 'data'=>$array
- ];
- $str = json_encode($lastArr,256);
- $r = $client->send($str);
- $msg = $client->receive();
- echo "Recive: ".$msg."\n\n\n";
- $client->close();
|