No Sockets for Windows Phone 7

Update: Socket support was added in Windows Phone 7.5

So this weekend I was looking into some Windows Phone 7 development, with the intention of getting started on a WP7 port of Pocket IRC.  It was all progressing along handily until, much to my dismay, I discovered that the initial release of WP7 will not provide application level support for sockets.  I’ve seen other more authoritative links on the subject, but can’t find them at the moment.

The only networking capability provided is via the Windows Communication Foundation, a high level interface, which will provide only single request/response access to HTTP.

So that means no IRC, or any other protocol which doesn’t operate over HTTP.  I’m not sure how email will be implemented, but I imagine over HTTP gateways or simply through APIs not exposed to 3rd party applications.

WP7 also doesn’t have multitasking support, repeating the historical choice of the earlier iPhones.  This is also a bit of a shot to connection oriented protocols like IRC, where disconnecting and reconnecting has a noticeably detrimental impact on the user experience.

From the sound of various MS posts and comments, they do intend to add socket support eventually, but not in the first release.  For the sake of the platform I hope limitations like this will not kill it before MS  gets a chance to release all the features they want.

At this point it looks like my choices are, simply wait for a future revision of the Windows Phone platform, or waste time and effort implementing some hack temporary solution like an IRC client that operates over an HTTP gateway, which has it’s own problems, namely having to run an HTTP gateway.

Windows Phone 7 looks like it has potential, but I’m a bit worried about its chances against iPhone and Android if it’s coming out of the gate with such glaring limitations.

Posted in IRC, Programming, Windows Mobile, Windows Phone 7 | Tagged , , , , | 3 Comments

Twitter OAuth in C++ for Win32 – Part 2

Part 1 covered the OAuth process at a high level, and Part 2 goes over the example code in what will likely turn out to be too much detail.

The example project and source files are available on Google Code; C++ code for Win32, with a Visual Studio 2008 project file. Update: Part 3 builds on the code in this section, however the older code as discussed here is still available under tags/blog-part-2.

Making OAuth Requests

Now lets take a look at what OAuthWebRequest actually does. The steps are essentially the same for any request, however not all of the parameters are used all the time.

Continue reading

Posted in C++, Twitter, Win32 | Tagged , , , , , , | 12 Comments

Twitter OAuth in C++ for Win32

The Problem

There seems to be lackluster support for Twitter in the C++ community.  I haven’t yet seen a single Twitter client for Windows written in C++ that was… acceptable.

Accessing the Twitter API using Basic Authentication is pretty straightforward, however Basic Authentication is going to be turned off on August 16th, 2010 (last I checked), and after that will require all applications to use OAuth.

Having looked into what it would take to implement OAuth, I’m not surprised that few people have jumped at the opportunity to do so.  I had to scrounge around the net for several hours in order to piece together the necessary information and code required to implement bare bones OAuth functionality in C++, it’s fairly involved, and not at all well documented.

Existing Libraries

There are currently only two C++ Twitter libraries listed on Twitter’s library list, QTwitLib, and Twitcurl.  Neither appears to be under active development, they’re both GPL (which I’m not a big fan of), QTwitLib uses Qt (which I’m not a big fan of), and neither support OAuth anyway.

There is only one C++ OAuth library, liboauth, listed on Twitter’s OAuth library list, and it requires OpenSSL or Mozilla’s NSS.  OpenSSL requires Perl and NASM to be installed to build, and while I haven’t looked at NSS much, it doesn’t appear to be sync-and-go either.  At least liboauth is available under an MIT License, so this is something I might return to later.  It might be possible to remove HTTPS support and drop the dependencies without too much headache.

The Solution

So the perfectly rational (and conveniently most interesting) solution, is to try and write up some OAuth code from scratch… or from bits and pieces anyway.  Be warned, this isn’t going to be pretty.

Continue reading

Posted in C++, Twitter | Tagged , , , , , | 9 Comments

Why are Twitter Clients all AIR or .NET?

I currently use twhirl, because it’s the only Twitter client I’ve found for Windows so far that I can stand.  It’s simple, unintrusive, single column, and just generally looks decent and works well.  There are a few problems though…

1) It’s written in Adobe AIR.  Task Manager reveals that twhirl is second only to Outlook in using up my precious, precious RAM.

Task Manager Screenshot


I might overlook this if I were running it on my main PC with 4GB (the future is now!), but I run email, IRC, messaging clients, etc. on my laptop which has only 1GB.

Which reminds me of DestroyTwitter which boasts, among other things, of having “an unbelievably small footprint”.  How does memory usage of as low as 25MB sound?  Pretty believable, and a bit high for something that only has to display a few lines of text and some icons.

Destroy Twitter Website

That's unpossible!

2) It’s out of date, doesn’t support the new ReTweet functionality for example, and doesn’t appear to be under active development, as Seesmic has moved on to Seesmic Desktop.  Recently I’ve been discovering other bugs, that I just didn’t notice before or because the Twitter API is changing in subtle ways that twhirl isn’t liking.

3) And the final nail in the coffin, as far as I know, there are no plans to add OAuth support to twhirl.  Which is going to become a problem on August 16th, when Twitter disables basic authentication and requires all clients to use OAuth.

I think it’s about time the C++ community took a hint from apps like uTorrent, and started developing lightweight native Twitter clients for Windows.

Update: Oops, I had said DestroyTwitter is .NET, it’s actually AIR too.  A few other clients, like Blu and Seesmic for Windows are .NET.

Posted in C++, Twitter | Tagged , , , , , | 3 Comments

Pocket IRC is now free

Pocket IRC screenshot in VGA on a Dell Axim X51v

Pocket IRC on Windows Mobile 5

Pocket IRC my IRC client for Pocket PC and Windows Mobile devices.  Version 1.3 has been released removing registration requirements and is now available for free, previously $14.95 USD.

This release doesn’t add a lot of new functionality, but it had significant re-factoring internally a couple of years ago, and not a whole lot of testing since then, so fingers crossed.

The free release is a stepping stone to open sourcing the code.  I haven’t decided yet where or how I’ll be releasing the source, so in the meantime I figured I might as well make it free.  Likely it will be a public read-only SVN repository, maybe on Google Code, and probably under an MIT or similar license.

Posted in IRC, Windows Mobile | Tagged , , , , | Leave a comment