javascript - 实现服务器推的js+flash+socket为何始终连接不上?

WBOY
Release: 2016-06-06 20:48:13
Original
1207 people have browsed it

目前网页的在线聊天普遍采用定时请求这种方式,服务器开销很大,搜索了一下怎样用js保持网页长连接的功能,无意中看到AFLAX这个东东,觉得很有意思,它是通过js调用flash通过socket通信从而保持网页的长连接,人人网的在线聊天也是基于此,在phpchina上看到这个帖子http://bbs.phpchina.com/thread-208988-1-1.html,下载了源码放到本地php环境
javascript - 实现服务器推的js+flash+socket为何始终连接不上?

但是一直连接不上
javascript - 实现服务器推的js+flash+socket为何始终连接不上?
是不是要把js中的127.0.0.1改为目标php的路径啊?

<code>connection = new AFLAX.Socket(aflax, "127.0.0.1", 10031, "onConnectEvent", "onDataEvent", "onCloseEvent");
</code>
Copy after login
Copy after login

我不知道为什么,求高手不吝赐教

回复内容:

目前网页的在线聊天普遍采用定时请求这种方式,服务器开销很大,搜索了一下怎样用js保持网页长连接的功能,无意中看到AFLAX这个东东,觉得很有意思,它是通过js调用flash通过socket通信从而保持网页的长连接,人人网的在线聊天也是基于此,在phpchina上看到这个帖子http://bbs.phpchina.com/thread-208988-1-1.html,下载了源码放到本地php环境
javascript - 实现服务器推的js+flash+socket为何始终连接不上?

但是一直连接不上
javascript - 实现服务器推的js+flash+socket为何始终连接不上?
是不是要把js中的127.0.0.1改为目标php的路径啊?

<code>connection = new AFLAX.Socket(aflax, "127.0.0.1", 10031, "onConnectEvent", "onDataEvent", "onCloseEvent");
</code>
Copy after login
Copy after login

我不知道为什么,求高手不吝赐教

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!