5 posts tagged “sprocket”
It works! Sprocket.Reader is an IMAP mail server that pulls news feeds from a database. I'm focusing on the iPhone mail client at the moment. It's easy to use and there are no downloads or mods required.
If you are interested in being a beta tester, email me at: xantus at xantus d.o.t org.
Here are screen shots of me reading Slashdot
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 maintain a few modules on CPAN, and not all of my modules are in my svn repo.(I know, I know, shame on me) I wanted to capture the change history from my previous releases instead of just committing the most recent version. My idea was to download all versions from backpan and cpan and commit them sequentially, tagging each version so I could easily diff between release versions.
Yesterday, I created some Perl scripts to do just that. I started off by running cpansvn on Data-ObjectDriver, authored by Ben Trott, and Sprocket, authored by me. These two modules have from 5-7 releases and are good test subjects for me.
Eventually, I'll automate the whole process, and watch all modules on CPAN....
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!
I've been working on an IMAP server that serves up rss feeds so I can easily read feeds on my iPhone.
I got it working tonight! It's blazingly fast, even on edge.
Screen shots of Sprocket Reader:
It currently reads a few feeds I have setup to automatically update. The server is written in Perl and Sprocket, a networking library I created. Sprocket can handle thousands of simultaneous connections, so I may open it up for beta testing in the future.
Things to do:
Link it with google reader
Add a 'starred' folder and enable messages to be moved to it.
Make it pluggable
OpenID?
Suggestions?