comet

AJAX Polling Frequency - To long poll or not to long poll?

徘徊边缘 提交于 2019-12-04 16:45:34
问题 I'm building a component of a web page that needs relatively constant database polling. I can see two different approaches for this, and I'm wondering if one of them is better than the others, or if I'm missing a third option. 1) Send off an AJAX request every 1 or 2 seconds to check for updates. Each request returns immediately whether or not there is new data. 2) Fire off a single AJAX request that will not return until it receives data or a timeout occurs. Upon either of those happening,

Broadcasting to a subset of subscribers in Atmosphere

我与影子孤独终老i 提交于 2019-12-04 15:51:56
What I'm trying to do: Be able to have users subscribed to a number of different 'chat rooms' and use reverse AJAX / comet to send messages from a chat room to everyone logged into that room. (a bit more complicated but this is a similar use case). What I'm doing: Using Grails with JMS and Atmosphere. When a message is sent, I'm using JMS to send the message object which is received by a Grails service which is then broadcasted to the atmosphere URL (i.e. atmosphere/messages). Obviously JMS is a bit redundant there but I though I could use it to help me filter who should retrieve the message

码云 Gitee 云端软件平台学习--GitHub

佐手、 提交于 2019-12-04 15:38:07
码云 Gitee http://git.oschina.net/jackjiang/MobileIMSDK http://www.blogjava.net/jb2011/archive/2018/11/27/433523.html Web端即时通讯技术盘点:短轮询、Comet、Websocket、SSE Web端即时通讯技术因受限于浏览器的设计限制,一直以来实现起来并不容易,主流的Web端即时通讯方案大致有4种:传统Ajax短轮询、Comet技术、WebSocket技术、SSE(Server-sent Events)。本文将简要介绍这4种技术的原理,并指出各自的异同点、优缺点等。 2. 概述 1996年IETF HTTP工作组发布了HTTP协议的1.0版本 ,到现在普遍使用的版本1.1,HTTP协议经历了17 年的发展。这种分布式、无状态、基于TCP的请求/响应式、在互联网盛行的今天得到广泛应用的协议,相对于互联网的迅猛发展,它似乎进步地很慢。互联网从兴起到现在,经历了门户网站盛行的web1.0时代,而后随着ajax技术的出现,发展为web应用盛行的web2.0时代,如今又朝着web3.0的方向迈进。反观http协议,从版本1.0发展到1.1,除了默认长连接之外就是缓存处理、带宽优化和安全性等方面的不痛不痒的改进。它一直保留着无状态、请求/响应模式,似乎从来没意识到这应该有所改变。

how to trigger notification from other framework in atmosphere (comet)?

柔情痞子 提交于 2019-12-04 14:35:49
问题 basically i have read some samples, but all are self contained in one servlet. such as: use doGet to establish the long polling connection, and then use doPost to trigger the event to notify all suspended connections. Here is my question: I have other web actions programming in spring mvc, in the spring mvc controller a user post a message via /message/post, how can I make this action to trigger the atmosphere handler to notify the suspended connections? 回答1: But what about non web components

Basic use of gwt-comet for GWT

ぃ、小莉子 提交于 2019-12-04 14:14:03
I'm trying out the gwt-comet extension here . I cant get any messages from the server to the client. I have a basic GWT application with a RPC service implementation. Client: MockGui.java public class MockGui implements EntryPoint { @SerialTypes({ Message.class }) public static abstract class MyMessageSerializer extends CometSerializer { } public void onModuleLoad() { ... goServer(); } public void goServer() { GreetingServiceAsync service = GWT.create(GreetingService.class); service.greetServer(new Message(), new AsyncCallback<Void>() { @Override public void onSuccess(Void result) { // TODO

.NET Comet engine

我是研究僧i 提交于 2019-12-04 14:03:43
is there a .net based comet engine? like Ajax Push Engine that is free and open source? Orbited Orbited is an HTTP daemon that is optimized for long-lasting comet connections. It is designed to be easily integrated with new and existing applications. Orbited allows you to write real-time web applications, such as a chat room or instant messaging client, without using any external plugins like Flash or Java. It can be installed as a windows service. The license is MIT. MethodWorx MethodWorx was developed out of this series of articles on Code Project. It has an Open Source license. This is a

Using atmosphere for GWT Comet

我的未来我决定 提交于 2019-12-04 14:00:37
I was looking for a simple framework for implementing Comet for my GWT application. I looked on gwt-rocket which seems to be non active, then on gwt-comet which is not active, then on atmosphere-gwt-comet which was moved into the atmosphere project, and finally - tried to actually download the gwt sample from atmosphere and work with it. :| I added the atmosphere-gwt-server and atmosphere-gwt-client modules (version 0.8.6) to my project and tried to make the existing atmosphere sample to work. I'm getting connection terminated exceptions all the time, and no messages. It seems that example

Long Polling Options: Nginx, PHP, Node.js

微笑、不失礼 提交于 2019-12-04 12:05:09
问题 I'm designing a long-polling app to broadcast small changes very rapidly to, possibly, a large number of users. The app will run in tandem with a website running a fairly standard cms. They'll both be running on one server, and to begin with so will the database. I come very much from a LAMP environment and I'm definitely a developer and not a sys-admin. That said I'm not afraid to try out some new things. I've spent the day researching my options and I'm hoping people can answer some

Problem of choosing comet server

99封情书 提交于 2019-12-04 11:30:55
I want to write a php site which uses the comet technology for real time update. I have a few questions: Is it better to use a comet server? Which comet server is good? For comet server (e.g. orbited), I have to first install the python based orbited server and then write php file to create socket to connect to the comet server. Right? (Orbited.org does not have any tutorial about this.) Yes it's better to use a dedicated server. StreamHub Comet Server seems to be the most popular these days. For a tutorial on how to get started with comet read this: Getting Started with Comet and StreamHub .

PHP Comet. How to do it better?

时光怂恿深爱的人放手 提交于 2019-12-04 11:24:54
I have a simple comet chat. JavaScript send ajax request with long polling. When server find new messages in the database, it answers and gives JSON. Next, JavaScript send the request again. Javascript: function cometConnect(){ $.ajax({ cache:false, type:"get", data:'ts='+ts, url: urlBack, async: true, success: function (arr1) { //work with JSON //..... }, complete:function(){ cometConnect(true); nerr=false; }, dataType: "text" }); } PHP $flag=true; $lastmodif = isset($_GET['ts']) ? $_GET['ts'] : 0; while($flag){ $q=mysql_query("SELECT text, posterId,modified, fromUserId,toUserId, login FROM