| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- /**
- * Created by PhpStorm.
- * Name: 芸众商城系统
- * Company: 广州市芸众信息科技有限公司
- * Profile: 广州市芸众信息科技有限公司位于国际商贸中心的广州,专注于移动电子商务生态系统打造,拥有芸众社交电商系统、区块链数字资产管理系统、供应链管理系统、电子合同等产品/服务。官网 :www.yunzmall.com www.yunzshop.com
- * Date: 2022/5/7
- * Time: 16:52
- * Author: Merlin
- */
- namespace app\process;
- /**
- * 内部通讯
- */
- class InnerSocket
- {
- /**
- * @param array $ids
- * @param string $content
- * @param string $type
- * @return bool
- */
- public static function send(array $ids, array $content, string $type)
- {
- $data['ids'] = $ids;
- $data['content'] = $content;
- $data['type'] = $type;
- $client = stream_socket_client('tcp://127.0.0.1:5678', $errno, $errmsg, 1);
- fwrite($client, json_encode($data)."\n");
- $result = fread($client,8192);
- if ($result == "success\n") {
- return true;
- }
- return str_replace("\n","",$result);
- }
- }
|