8 posts tagged “cometd”
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/ext-ux/lib/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.Gateway 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, and a Jabber client, which can be seen on Comet Desktop
See WebSockets, for another writeup of this technology.
David Davis
☄ Software Engineer
http://xant.us/
We recently voted to accept DWR into the Dojo Foundation.
DWR is Direct Web Remoting.
Congrats to Joe and DWR!
DWR allows Javascript in a browser to interact with Java on a server and helps you manipulate web pages with the results.
Ajaxian reported it this morning: DWR joins Dojo Foundation - Joe Walker joins SitePen
DojoToolkit, openrecord, and Cometd are also Dojo Foundation projects.
I recently released v0.07 of Sprocket, my Perl networking framework.
What's New
Some notable changes since v0.05 include:
Added a File Descripter passing utility module: Sprocket::Util::FDpasser which uses File::FDpasser
Spread integration; plugins can pubsub
Soft Shutdown
Observer hooks; attach callbacks to events by name
Log4perl logging
The file descriptor passer allows you to send or receive file handles across processes. This includes Sockets. For instance, Sprocket can now take connections from Apache for things like Cometd. See mod_handoff for the apache2 code. I have a partially working Sprocket::Server::FDreceiver module that will accept a socket from any process and inject it into the framework as if it handled the socket in the first place.
One point Oh
Don't let the version number fool you. It's not "1.0", but this framework is ready to help you get started on writing that server you've always wanted to write. v1.0 is on target for release in late December.
Getting Sprocket
You can download Sprocket, or get it using CPAN.pm:
perl -MCPAN -e 'install Sprocket'
or you can check it out from svn:
svn co http://svn.xantus.org/sprocket/trunk/Sprocket/ sprocket
Thanks
Thanks go to perigrin, andyg and dec for their help!
Jason Cline, from SitePen, posted about his chat app on the iPhone. It uses the Dojo toolkit, and Cometd.
Cometd has been tested on the iPhone before, but this one was custom made for it. Great job Jason.
It's nice to see my project (Cometd) being used for some cool apps!
Cometd Developer Day is being held on Thu the 11th, a day before the Dojo Developer Day here in San Francisco!
You can visit Cometd's blog to get the details.
I've been working on an inter window communication javascript library based on javascript built for Vox. This allows browser windows or tabs on the same domain to communicate and cooperate. One use case for this is for comet connections. Due to self imposed browser limitations, multiple connections to the same domain are limited to two connections and comet connections would produce odd behavior when multiple windows or tabs are opened on the same domain. This is the first step in efficient use of a single comet connection across multiple tabs or windows. This library would be used with another project of mine: Cometd: The Scalable Comet Framework
Check out my demo: Inter Window Communication
Note: Currently this only works in Firefox 2 and IE 5.1+
What's one thing that you hope to do or accomplish before the end of this year?
I hope to have ☄Cometd and a few examples working. We're making great progress, but I'm hoping to speed that up in August. We may have a working demo in time for OSCON.
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/