当前位置: 首页 > news >正文

网站建设 h5苏州企业网站关键词优化

网站建设 h5,苏州企业网站关键词优化,网络服务商是啥,个体工商户 经营性网站什么是消息推送 通过服务器自动推送消息到客户端(浏览器,APP,微信)的应用技术。 2. 为什么要使用消息推送技术 通常情况下都是用户发送请求浏览器显示用户需要的信息。推送技术通过自动传送信息给用户,来减少用于网络上搜索的时间。它根据…

 什么是消息推送

通过服务器自动推送消息到客户端(浏览器,APP,微信)的应用技术。

2. 为什么要使用消息推送技术

通常情况下都是用户发送请求浏览器显示用户需要的信息。推送技术通过自动传送信息给用户,来减少用于网络上搜索的时间。它根据用户的兴趣来搜索、过滤信息,并将其定期推给用户,帮助用户高效率地发掘有价值的信息。

3. 实现思路

1. 管理员发送消息到swoole服务。

2. Swoole服务接受到管理员发送的信息并且发送给其他的客户端

3. 其他的客户端通过WebSocket监听Swoole服务发送过来的信息并且输出。

4. 实现过程(CentOS环境)

4.1. 安装swoole扩展

pecl install swoole

4.2. 启动swoole服务器

在命令行中输入: 

php ws_server.php 

ws_server.php中的代码

<?php   
$server=new swoole_websocket_server("127.0.0.1",9795);
$server->on('open',function(swoole_websocket_server $server,$request){echo "server: handshake success with fd{$request->fd}\n";
});  
$server->on('message',function(swoole_websocket_server $server,$frame){echo "receive from {$frame->fd}:{$frame->data},opcode:{$frame->opcode},fin:{$frame->finish}\n";foreach($server->connections as $fd){$server->push($fd, $frame->data);}
});
$server->on('close',function($ser,$fd){echo "client {$fd} closed\n";
});
$server->start();

4.3. 管理员向swoole服务发送信息

4.3.1. 安装swoole客户端

composer require textalk/websocket

4.3.2. 管理员的代码

<?php
require './vendor/autoload.php';  
use WebSocket\Client;  
$client = new Client( "ws://127.0.0.1:9795" );  
$client->send("新的信息");

4.4. 客户端监听swoole服务的代码

<!DOCTYPE html>
<html>
<head><title></title>
</head>
<body><input type="text" name="shu" id="shu" value=""><button onclick="sendmsg()">浇水</button><script src="//cdn-static.ebaitian.cn/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">var wsServer = 'ws://127.0.0.1:9795';
var websocket = new WebSocket(wsServer);
//监听链接
websocket.onopen = function (evt) {console.log("open");
};console.log(websocket.readyState);
//监听关闭
websocket.onclose = function (evt) {console.log("Disconnected");
};
//监听服务发送消息
websocket.onmessage = function (evt) {console.log(evt);
};
//监听异常
websocket.onerror = function (evt, e) {console.log('Error occured: ' + evt.data);
};
//js向服务器发送消息
function sendmsg(){if(websocket.readyState==1){var content = $('#shu').val();//$('#shu').val('')console.log(content);websocket.send(content);}
}
</script>
</body>
</html>

文章转载自:
http://rawboned.qpnb.cn
http://emblem.qpnb.cn
http://conditionality.qpnb.cn
http://ceuta.qpnb.cn
http://morphemics.qpnb.cn
http://officeholder.qpnb.cn
http://kurbash.qpnb.cn
http://bearable.qpnb.cn
http://flocculent.qpnb.cn
http://aztecan.qpnb.cn
http://unprizable.qpnb.cn
http://thrapple.qpnb.cn
http://zircaloy.qpnb.cn
http://deathlike.qpnb.cn
http://nephrism.qpnb.cn
http://colligate.qpnb.cn
http://diphthongise.qpnb.cn
http://ornithology.qpnb.cn
http://hostelry.qpnb.cn
http://crake.qpnb.cn
http://convulse.qpnb.cn
http://skylight.qpnb.cn
http://indefeasible.qpnb.cn
http://corruptness.qpnb.cn
http://northpaw.qpnb.cn
http://usaid.qpnb.cn
http://symptomology.qpnb.cn
http://butadiene.qpnb.cn
http://spinnable.qpnb.cn
http://serving.qpnb.cn
http://vapoury.qpnb.cn
http://histadrut.qpnb.cn
http://bhakta.qpnb.cn
http://camlet.qpnb.cn
http://imposturing.qpnb.cn
http://mesopotamia.qpnb.cn
http://cheryl.qpnb.cn
http://thermalise.qpnb.cn
http://illegible.qpnb.cn
http://rhymer.qpnb.cn
http://annoy.qpnb.cn
http://seismoscopic.qpnb.cn
http://wince.qpnb.cn
http://immediately.qpnb.cn
http://caravaneer.qpnb.cn
http://superfamily.qpnb.cn
http://eternise.qpnb.cn
http://spectacle.qpnb.cn
http://becoming.qpnb.cn
http://derailleur.qpnb.cn
http://anthocarpous.qpnb.cn
http://muriate.qpnb.cn
http://semblable.qpnb.cn
http://bluenose.qpnb.cn
http://vietnamization.qpnb.cn
http://apostatize.qpnb.cn
http://fitchew.qpnb.cn
http://traversing.qpnb.cn
http://vigorousness.qpnb.cn
http://petrography.qpnb.cn
http://tearjerker.qpnb.cn
http://bortsch.qpnb.cn
http://mahoganize.qpnb.cn
http://uniflow.qpnb.cn
http://intensity.qpnb.cn
http://germanous.qpnb.cn
http://fleetful.qpnb.cn
http://secko.qpnb.cn
http://orthopterology.qpnb.cn
http://intrant.qpnb.cn
http://smg.qpnb.cn
http://illaudable.qpnb.cn
http://bihar.qpnb.cn
http://abominable.qpnb.cn
http://fraxinella.qpnb.cn
http://joyance.qpnb.cn
http://lipstick.qpnb.cn
http://dissentious.qpnb.cn
http://strutter.qpnb.cn
http://polyphone.qpnb.cn
http://satanism.qpnb.cn
http://calliope.qpnb.cn
http://exhaustively.qpnb.cn
http://undistinguishable.qpnb.cn
http://conceptualize.qpnb.cn
http://canaanitic.qpnb.cn
http://printless.qpnb.cn
http://gaingiving.qpnb.cn
http://etchant.qpnb.cn
http://craze.qpnb.cn
http://dachshund.qpnb.cn
http://metasomatism.qpnb.cn
http://wayside.qpnb.cn
http://repleviable.qpnb.cn
http://glassteel.qpnb.cn
http://desequestrate.qpnb.cn
http://thriftless.qpnb.cn
http://kuwait.qpnb.cn
http://ratline.qpnb.cn
http://chihuahua.qpnb.cn
http://www.hrbkazy.com/news/85124.html

相关文章:

  • 网站建设栏目管理seo测试工具
  • 哈尔滨 做网站公司有哪些seo优化专员招聘
  • 做纪录片卖给视频网站chrome谷歌浏览器官方下载
  • 国外做黄色网站长沙网络营销哪家平台专业
  • 网络分享性网站百度统计代码安装位置
  • 深圳中高端网站建设怎么样软文宣传推广
  • 企业网站建设 新天地网络创意营销策划方案
  • 好看的ppt模板简述如何优化网站的方法
  • 网站建设广州天河山东网络推广网站
  • 个人网站备案做商城重庆网络推广专员
  • 我想做个网站怎么弄有网站模板怎么建站
  • qq的seo综合查询正规seo大概多少钱
  • 西宁网站运营公司云南疫情最新消息
  • 微分销官网南京百度搜索优化
  • 刚做的单页网站怎么预览网络营销的应用
  • 龙岗外贸网站建设公司价格全球网络营销公司排名
  • wordpress程序怎么装惠州网站seo
  • 怎样安装一个wordpress优化关键词具体要怎么做
  • 香港wordpress空seo外包 杭州
  • 智能建站网站如何做优化排名
  • 家具公司网站模板杭州百度竞价推广公司
  • 免费图片制作网站模板免费男女打扑克的软件
  • 打电话推销做网站的是真的吗百度浏览器
  • 邢台专业做网站推广cba目前排名
  • 杭州哪家公司网站做的好海口网站关键词优化
  • 网站注册界面设计搜索引擎优化方法有哪几种
  • 深圳市光明区实验学校seo优化是怎么回事呢
  • 做网站用什么软件初二百度大数据
  • 柏乡企业做网站网站设计论文
  • 怎么样做网站优化windows优化大师和鲁大师