GoDaddy Linux 专用服务器中的 Comet 聊天?
- 我想知道是否可以使用ajax推送制作我自己的聊天应用程序。
- 如果是的话,最简单的方法是什么?
我知道如何使用 javascript 并进行 ajax 调用,但仅此而已。我自己可以找到教程,但我无法判断该方法是否好,因此任何链接将不胜感激。
谢谢
- I want to know if it's possible to make my own chat application with ajax push.
- And if it's, what is the easiest way to do it?
I know how to use javascript and make ajax calls but that's as far as I go. I can find tutorials myself but I can't tell whether the method is good or not so any links will be appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要使用ajax推送(comet),您必须创建一个能够保持并发连接的服务器。
您确实可以做任何事情来寻找您最喜欢的语言的回显服务器。 Java/C/C++ ..我会用 Java 来做这件事,因为它也可以在 Linux 上运行。
您可以使用 http://www.ape-project.org/ 这似乎已经全部完成对你来说..但看起来很复杂..我建议从头开始使用回显服务器。
to use ajax push (comet), you must make a server that will keep concurrent connections.
You can really do anything look for echo servers in your favorite language. Java/C/C++.. I'd do this in Java since it can run on Linux as well.
You can use http://www.ape-project.org/ which seems to be done already all for you.. but seems complex.. I'd recommend starting from scratch with a echo server.
我建议使用 Node.js,因为它在 Comet/Ajax-push 方面非常出色。为什么它很棒? Comet 应用程序往往是事件驱动的,而 Node.js/javascript 擅长此类事情。
但是,如果您更喜欢用 Java 进行操作,只要您的 servlet 实现 CometProcessor 并且使用 NIO 作为 http 连接器,Tomcat 实际上就支持 Comet。请参阅 http://tomcat.apache.org/tomcat-6.0-doc/aio。 html
I would recommend using Node.js as it is great at Comet/Ajax-push. Why is it great? Comet applications tend to be event driven and Node.js/javascript excels at these kinds of things.
However, if you prefer to do it in Java, Tomcat actually supports Comet as long as your servlet implements CometProcessor and you use NIO as your http connector. See http://tomcat.apache.org/tomcat-6.0-doc/aio.html