C# 2008 SP1
I am using this code to connect to our client website. This is for a softphone application. Before the user makes a call, the softphone has to test if th
What is the softphone going to use for its real communication? Is that going over HTTP/HTTPS to the same web site? If so, that's absolutely the right way to go - the next step is to work out why it's taking so long.
Is the network connection definitely up before you may the request? Are you definitely not making any requests beforehand? I ask because I notice you're not disposing of the response - if that happens elsewhere as well, you may find that you're running up against the connection pool only giving you a couple of connections to a particular server. The moral is to always put HttpWebResponses in a using statement. Of course, that may well not be the problem in your case, but it's worth a try.
If your actual application is going to connect elsewhere, then that's where your test should check as well. Basically, make it as close to the real thing as possible.
Out of interest, you say it's a "softphone" application - is this actually running on a phone of some description, using the compact framework, or is it a desktop app?