views:

71

answers:

2

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 different shoutcast servers 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?

A: 

Maybe the ShoutCast server you're connecting to only allows two concurrent connections from the same machine? Or maybe your local settings are only allowing two concurrent outgoing connections?

Jonners
I am connecting to multiple different shoutast servers. And if my connections are limited to two PER PROCESS (check out my upper comment) then I would like where to change that setting (registry??!?)
Daniel Mošmondor
+2  A: 

Probably this website has restriction on the number of simultaneous connections from the same ip address. Also take a look on

ServicePointManager.DefaultConnectionLimit

By default this value is 2. Change it to a bigger one.

Hun1Ahpu
You got it! I have set it to 999 :) Do you know WHY it works on every other machine than this one?
Daniel Mošmondor
I'm not sure but probably it's set to a another value in .NET configuration files on other machines.
Hun1Ahpu