I saw the light Silverlight Tip: Problems with polling duplex inactivitytimeout. - Alexey Zakharov's Blog

Silverlight Tip: Problems with polling duplex inactivitytimeout.

 Many people ask question why polling duplex session shutdown after 10 minutes in spite of polling duplex InactivityTimeout value is more than hour.

In private email Christopher Scrosati (Silverlight WS Team) told me that I've also should configure ReciveTimout.

Here is the code sample, which shows how to configure polling duplex correctly:

HttpTransportBindingElement http = new HttpTransportBindingElement();

BinaryMessageEncodingBindingElement binary = new BinaryMessageEncodingBindingElement();

PollingDuplexBindingElement polling = new PollingDuplexBindingElement();

polling.InactivityTimeout = TimeSpan.FromHours(1);

CustomBinding binding = new CustomBinding(polling, binary, http);

binding.ReceiveTimeout = TimeSpan.FromHours(1);

Hope it helps! Many thanks to Christopher =)

 

Published Friday, April 17, 2009 2:53 PM by brainbox
Filed under: , ,

Comments

# re: Silverlight Tip: Problems with polling duplex inactivitytimeout.

Friday, April 17, 2009 7:55 AM by Radenko Zec

Great posts.Just keep going good work.

Polling duplex is hot subject these days...

# re: Silverlight Tip: Problems with polling duplex inactivitytimeout.

Friday, April 17, 2009 8:42 AM by brainbox

Thanks Zec, Soon I'm going to experiment with SL socket and make some kind of comparison, because of many colleagues say that sockets are much faster.

# Silverlight Duplex Wrap-up | DavideZordan.net

Monday, April 27, 2009 9:04 AM by Silverlight Duplex Wrap-up | DavideZordan.net

Pingback from  Silverlight Duplex Wrap-up | DavideZordan.net

# re: Silverlight Tip: Problems with polling duplex inactivitytimeout.

Tuesday, April 20, 2010 2:33 PM by Mark Richards

How does the timeout work?  If the client is alive and responding, it shouldn't ever time out, right ?  Or am I wrong, is the session basically only good for whatever duration you set at the beginning?

Is there a way on the client side to determine if you've been timed out and to reconnect ?

# re: Silverlight Tip: Problems with polling duplex inactivitytimeout.

Thursday, September 30, 2010 2:22 PM by Rajan Soni

cool.. It worked. btw, I put ReceiveTimeout on PollingDuplexHttpBinding, and it's working fine..

PollingDuplexHttpBinding polling = new PollingDuplexHttpBinding();

polling.InactivityTimeout = TimeSpan.FromHours(1);

polling.ReceiveTimeout = TimeSpan.FromHours(1);

btw, How can I put it in infinite loop?

# re: Silverlight Tip: Problems with polling duplex inactivitytimeout.

Wednesday, December 15, 2010 12:05 PM by Stefan Roth

Hi there,

I wrote a WCF server which generates a number each second (selfhosting console application). I sucessfully connected my silverlight 4 app to it and display the number the server pushes to the callback. This works for 10 minutes, afterwards client and server stop to produce/display any further numbers. I set the InactivityTimeout AND the ReceiveTimeout on the client side. It doesn't affect the timeout, though. Can anybody provide a working example where a silverlight client really gets updates after 10 minutes? Or do I have to set these timeouts on the server side? How can I do this in the config file?

Regards,

Stefan

# re: Silverlight Tip: Problems with polling duplex inactivitytimeout.

Sunday, January 23, 2011 9:44 PM by Scott Edmondson

@Stefan:

I believe the PollingDuplexHttpBinding.InactivityTimeout and .ReceiveTimeout properties need to be set on both the client- and server-side bindings. I can increase the length of time (10 mins default) before which the duplex messages stop (by increasing the properties mentioned above), but I don't understand why it times-out at all since our server-side code is sending a message every 30 seconds.

Regards,

Scott

# re: Silverlight Tip: Problems with polling duplex inactivitytimeout.

Monday, February 07, 2011 6:33 PM by Zain

I was able to have it run for more that ten minutes by setting three different parameters to the following:

var binding = new PollingDuplexHttpBinding(PollingDuplexMode.MultipleMessagesPerPoll);

binding.ReceiveTimeout = TimeSpan.MaxValue;

binding.InactivityTimeout = new TimeSpan(24,0,0,0); //maximum is 24 days

and in the web.config file I changed  serverPollTimeout="Infinite".

# re: Silverlight Tip: Problems with polling duplex inactivitytimeout.

Friday, April 01, 2011 11:16 PM by scott vn

I agree with Scott Edmondson  too, Do you find any other solution?

Regards

scott

# re: Silverlight Tip: Problems with polling duplex inactivitytimeout.

Thursday, April 07, 2011 3:10 AM by Di Xiao

I set my silverlight codes according to abovementioned method. But I never got it run over 10 minutes.

Please one successfully running the settings give a suggestion. Thanks,

Di

My Web.config

...

       <bindings>

           <basicHttpBinding>

               <binding name="MediaBinding" maxReceivedMessageSize="200000000" maxBufferSize="200000000">

                   <readerQuotas maxArrayLength="200000000" maxStringContentLength="200000000"/>

               </binding>

           </basicHttpBinding>

           <pollingDuplexHttpBinding>

               <binding name="multipleMessagesPerPollPollingDuplexHttpBinding"

                        duplexMode="MultipleMessagesPerPoll"

                        receiveTimeout="10:00:00"

                sendTimeout="10:00:00"

                transferMode="Buffered"

                hostNameComparisonMode="StrongWildcard"

                maxBufferPoolSize="5242880"

                maxBufferSize="655360"

                maxReceivedMessageSize="655360"

                        serverPollTimeout="Infinite"/>

           </pollingDuplexHttpBinding>

       </bindings>

...

Codes:

Dim address As New EndpointAddress("../ConferenceServices/ServiceConferencePubSub.svc")

   Dim binding As New PollingDuplexHttpBinding(PollingDuplexMode.MultipleMessagesPerPoll)

   Public WithEvents ConferenceSubscribeProxy As New ServiceConferencePubSubClient(binding, address)

       binding.ReceiveTimeout = New TimeSpan(10, 0, 0)

       binding.SendTimeout = New TimeSpan(10, 0, 0)

       binding.InactivityTimeout = New TimeSpan(24, 0, 0, 0)

# re: Silverlight Tip: Problems with polling duplex inactivitytimeout.

Friday, November 11, 2011 5:32 AM by Everything working

Finaly we've made it working after many hours of problems. The only way it is working is after client bindings time outs are increased, and configuration in Web.config is proper with set both inactivity and receive timeouts.

example in Web.config:

...

     <pollingDuplexHttpBinding >

       <binding name="multipleMessagesPerPollPollingDuplexHttpBinding"

                duplexMode="SingleMessagePerPoll"

                inactivityTimeout="00:03:00"

                receiveTimeout="10:00:00"

                maxOutputDelay="00:00:07"/>

     </pollingDuplexHttpBinding>

...

# re: Silverlight Tip: Problems with polling duplex inactivitytimeout.

Monday, December 26, 2011 12:51 AM by Harshal

hi,i am harshal

i am also facing such kind of issue with duplex binding,its such a big issue that i am facing ever.

Leave a Comment

(required) 
(required) 
(optional)
(required)