Friday, 21 September 2007

Generic Connection Framework on J2SE

This is the first of my "poking around the the dusty corners of my harddrive, digging out snippets of code that someone might find useful" posts. This one stems from my preference for working interactively with a shell when writing network code, something I couldn't really do with J2ME. The announcement of JSR-197 (the Generic Connection Framework for J2SE) 4-5 years ago made be believe I'd be able to hack away in the shell Real Soon Now™, then place the same code into a J2ME project (as well as the more obvious share code between platforms). Nothing seemed to materialise out of the JSR spec (or at least anything complete), and as I'd already written most of my own J2ME implementation, I wrote a GCF package to complement it. Anyway, so here it is! It has working HTTP, HTTPS, socket and UDP datagram protocols (I also have a JSR-82 over IP implementation too, but I'm saving that for another day!) and I've been using it for quite a few years without issues. I'm releasing it under a "do with it as you please, only give me credit for it" license. If you have any bugs, questions or suggestions, feel free to get in touch.

2 comments:

Dr J said...

Carl - you're the MAN!
I've been scratching my head and the bowels of google for the last 2 days and nights trying to find a small web services client library for use in a an applet. Axis and jax-ws are rather large. I can't find any KSOAP2 stub generators. Wireless Toolkit builds stubs for j2me-ws but the libraries will not run in applet (j2se). Your GCF for J2SE was the missing piece of jigsaw. Works a dream and shrinks the applet by about a Meg. Huge thanks to Carl.

Carl Woffenden said...

Someone besides me found it useful - good to know!