Thanks for the nice example.

Have you thought about using the System.Net.WebSockets available in .NET 4.5 DP?