I'm trying to create a download application, in which there would be four or more download queues using which a user can download files from the server. What would be best possible solution to accomplish this without letting the queues blocking each other. I'm starting every download queue in a different background thread which reports progress to the WPF Client UI as the bytes are getting downloaded from service. But, a new download queue blocks any previously running download Queue. I've tried to search a lot on google and StackOverflow but, still not able to resolve the issue
Methodology Applied: We are using Windows Azure Service Bus to connect to our WCF service using the NetTcpRelayBinding.
Client Side Configuration:
<system.serviceModel>
<bindings>
<!-- Application Binding -->
<netTcpRelayBinding>
<binding name="default"
connectionMode="Hybrid"
maxReceivedMessageSize="2147483647"
transferMode="Streamed"
closeTimeout="01:00:00"
openTimeout="00:30:00"
sendTimeout="infinite"
receiveTimeout="infinite"
maxBufferPoolSize="2147483647"
maxBufferSize="2147483647"
maxConnections="500"
listenBacklog="200">
<security mode="None"/>
<readerQuotas maxBytesPerRead="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" />
<reliableSession enabled="false" ordered="true" />
</binding>
</netTcpRelayBinding>
</bindings>
<client>
<!-- Application Service -->
<endpoint name="RelayEndpoint" contract="DDMInterface.IBaseService" binding="netTcpRelayBinding" bindingConfiguration="default" address="" />
</client>
Service Configuration:
<system.serviceModel>
<bindings>
<!-- Application Binding -->
<netTcpRelayBinding>
<binding name="default"
connectionMode="Hybrid"
maxReceivedMessageSize="2147483647"
transferMode="Streamed"
closeTimeout="01:00:00"
openTimeout="00:30:00"
sendTimeout="infinite"
receiveTimeout="infinite"
maxBufferPoolSize="2147483647"
maxBufferSize="2147483647"
maxConnections="500"
listenBacklog="200">
<security mode="None"/>
<readerQuotas maxBytesPerRead="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" />
<reliableSession enabled="false" ordered="true" />
</binding>
</netTcpRelayBinding>
</bindings>
<services>
<!-- Application Service -->
<service name="DDMService.DDMBaseService" behaviorConfiguration="ThrottleBehavior">
<endpoint name="RelayEndpoint"
contract="DDMInterface.IBaseService"
binding="netTcpRelayBinding"
bindingConfiguration="default"
address=""/> <!--behaviorConfiguration="defaultBehavior"-->
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ThrottleBehavior">
<serviceThrottling maxConcurrentCalls="2147483647" maxConcurrentInstances="2147483647" />
<!--maxConcurrentSessions="2147483647"-->
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="defaultBehavior">
<dispatcherSynchronization asynchronousSendEnabled="true"/>
</behavior>
</endpointBehaviors>
</behaviors>
Service Behavior:
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple)]
public class DDMBaseService : IBaseService
{
I've been banging my head since past 2 weeks on this problem and still not able to resolve it. Please help me finding a proper approach by suggesting links or solutions. Please ask any more information if required. Thanks in advance...
UPDATE I tried debugging the code more and more and found that the downloads were indeed working in parallel but were not getting reflected at the UI. I corrected that problem.