Windows Store apps: StreamSocket connection to localhost

Posted on July 8, 2013

The problem: running unit tests on a Windows Store app that connects to a port on localhost results in the error "A connection attempted failed because the connection party did not properly respond after a period of time ...". Connecting to a loopback address ( or localhost) is not supported in a Windows Store application.  Period. However, connecting to localhost while debugging an application in Visual Studio IS supported. ...

Read More

Windows Store Apps: Threads to Tasks

Posted on June 21, 2013

If you're updating an old .NET code base to a Windows Store app, you may notice that the Thread class is no longer available.  Instead, we have the more sophisticated Task.  If you have a lot of Thread usage in your old code, you may find a re-write of the threading code to be a large task (sorry). Here's some code that you can use in place of the missing Thread class. This uses Tasks under the hood: using System; using System.Thre...

Read More