Actually, I can see only one problem in your code: you did not handle possible exceptions, so I'm not sure how exactly the problem appears. So, here are my suggestions:
- Handle all exceptions on the top stack frame of all threads. Display comprehensive exception information. Just in case.
- For experimental purpose, increase timeout, even make it infinite. No problem, for experimental purpose, it's would be acceptable even if you kill your process in case of prolonged hanging.
- Test your code on some well-known high-performance site, such as Google, Bing, MSDN…
I would assume that the problem is your server part, not the code you've shown, but let's get more information and see what's going on in more detail.
—SA