Mysterious socket / HttpWebRequest timeouts

Posted by Daniel Mošmondor on Stack Overflow See other posts from Stack Overflow or by Daniel Mošmondor
Published on 2010-04-08T13:35:49Z Indexed on 2010/04/08 13:43 UTC
Read the original article Hit count: 425

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about sockets