首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > Web实时聊天室源码

Web实时聊天室源码

  • 资源大小:444.32 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: Web,聊天室,c#

资 源 简 介

用纯js通过长轮询来实现 前端用Jquery ajax来实现 1 $(function () { 2 window.polling = { 3 ///长连接地址 4 connectionUrl: "/channel/polling", 5 ///发送方式 6 method: "POST", 7 ///事件载体 8 event_host: $("body"), 9 ///连接失败时重连接时间 10 period: 1000 * 20, 11 ///连接超时时间 12 timeOut: 180 * 1000, 13 v: 0, 14 ///连接ID 15 id: "", 16 error_num: 0, 17 Reconnect: function () { 18 polling.v++; 19 $.ajax({ 20 url: polling.connectionUrl, 21 type: polling.method, 22 data: { id: polling.id, v: polling.v }, 23 dataType: "json", 24 timeout: polling.time

文 件 列 表

WebSite
Views
Scripts
Properties
obj
Models
Controllers
Content
bin
App_Data
Global.asax
Global.asax.cs
Web.config
Web.Debug.config
Web.Release.config
WebSite.csproj
WebSite.csproj.user
WebChat
Properties
obj
bin
Program.cs
WebChat.csproj
WebChat.sln
VIP VIP
0.187495s