0

I have a Axis2 web service deployed in web logic server. My application establishes connection with web service using WCF (CustomBinding, ChannelFActory and WSDL.)

MyBinding mybinding= new MyBinding();
Binding binding = mybinding.GetCustomBinding();
binding.SendTimeout = new TimeSpan(0, 5, 0);
EndpointAddress serviceAddress = new EndpointAddress(url);
myChannelFactory = new ChannelFactory<MyServicePortType>(binding, serviceAddress);

My C#.net application pings the web service every 10 secs in a thread to get some information. And in parallel, I'm using HttWebRequest to download some files from the server in segments in separate threads (one thread for each segment).

When I start both the above at the same time, I get the response for the web service request for the first time, but from second time I'm getting timeout exception while accessing the web service method and for file downloads, 1 or 2 segments are downloaded and for others it is throwing timeout exception.

But when I run only the downloads separately without the ping, Im not getting any timeout error. Ping alone also works fine.

Thanks In advance

  • Hi, got it resolved by setting this property: System.Net.ServicePointManager.DefaultConnectionLimit=100 See this: http://stackoverflow.com/questions/1361771/max-number-of-concurrent-httpwebrequests and http://www.neowin.net/forum/topic/874834-c%23-webrequest-limiting-concurrent-connections/ – user1140366 Dec 11 '12 at 08:57

1 Answers1

0

Got it resolved by setting this property: System.Net.ServicePointManager.DefaultConnectionLimit=100 whose default value is 2.

See these links:

Max number of concurrent HttpWebRequests

http://www.neowin.net/forum/topic/874834-c%23-webrequest-limiting-concurrent-connections

Community
  • 1
  • 1