2 posts tagged “ajax”
My project, Sprocket.Socket must have inspired, Michael Carter of orbitd: Comet Daily: Sockets in the Browser
One thing he didn't consider is that you need data framing to handle raw data from sockets correctly.
For instance, if you are parsing lines of data from a socket:
This is a line\r\n
This is another line\r\n
This is
You received a partial line, like the last line above. You need to wait for the rest of the line, and buffer it until you reach a line ending, which in this case is \r\n
I'm a POE programmer, and we have modules that frame data, and we call them Filters.
I have written several data framing filters in JavaScript, inspired by POE filters:
http://svn.xantus.org/sprocket/trunk/Sprocket-JavaScript/js/Ext-ux/Sprocket/
JSON, IRC, Line, etc
I think having pseudo-sockets in the browser is very useful if done right. Sprocket.Socket handles multiple outgoing connections from the browser using only one long polling xmlhttp. A spare xmlhttp request is used for quick sending of data while the other is waiting, so it doesn't have to be woken up. All data is delivered in order.
Sprocket.Socket consists of several parts:
The framework, Sprocket
Sprocket.HTTP plugin. It serves files, fast. Including CGI's
Sprocket.Socket plugin. This proxies the socket requests
An access control module. Controls which hosts the clients can connect to.
The JavaScript library Sprocket.Socket. This handles the pseudo-sockets in the browser
The JavaScript data framing filters, and base class
Extjs, a rich js framework.
This seems like a lot, but I can run one script and fire up a browser to get it to work.
I have a working IRC client built on all of this :)
Stay tuned for more
I've started a project in my spare time, called ShortBus.
What is ShortBus?
ShortBus is an event bus that can deliver low latency data to the browser. In other words, you can provide live chat, or collaborative applications in a browser without using flash, or limiting the user to one browser.
Similar programs
GMail's Google Talk
Meebo
Renkoo
Jot Live
mod_pubsub
Is there some sort of buz word I can associate with this technology?
Sure! Alex of DojoToolKit calls it Comet . No relation to this comet, think ajax...comet.
I've started a minimal site with an old design: http://shortbus.xantus.org/
You can find the google groups link and the subversion repository there.
[update] ShortBus has been renamed. The new site is at http://cometd.com/