Mysterious socket / HttpWebRequest timeouts
- by Daniel Mošmondor
I have a great app for capturing shoutcast streams :-) . So far, it worked with a charm on dozens of machines, and never exhibited behaviour I found now, which is ultimately very strange.
I use HttpWebRequest to connect to the shoutcast server and when I connect two streams, everything's OK. When I go for third one,
response = (HttpWebResponse)request.GetResponse();
throws with Connection Timeout exception.
WTF? I must point out that I had to create .config for the application in order to allow my headers to be sent out from the application, otherwise it wouldn't work at all. Here it is:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing = "true" />
</settings>
</system.net>
</configuration>
Does any of this ring a bell?