I am creating a Silverlight based chat application using WCF Polling. Everything is working fine people will start chat and send and recieve each others respective messages but the only flaw occurs with inactivity. Lets say if two users have started chatting
and stopped for a long time more than 15 min and when they again start chatting netiher will recieve any response. I have added the inactivity timeout and recieve timeout in my web.Config
But it is not working as expected. I have added the Inactivity and RecieveTimeout property in my code also wherever i am instantiating the proxy client.
Can anyone tell me how can I accomplish this query ?
Hi, I tried and used following code when instantiating client proxy
client = new ChatServicePolling.ChatServiceClient(
new PollingDuplexHttpBinding(PollingDuplexMode.MultipleMessagesPerPoll) { ReceiveTimeout = TimeSpan.FromHours(2), SendTimeout = TimeSpan.FromHours(2) },
new EndpointAddress("../ChatService.svc"));
Nothing is getting fetched through fiddler that shows concern. What I did I open a session in Internet Explorer and a new one in Chrome. I started chatting from both browsers, that was fine. I waited for 10-13 min and chat windows were open and again started
chatting but either user received no response. I checked though fiddler and the last chat message I sent from IE browser (after waiting 10 - 13 min ) and fiddler showed multiple request-response with 200 status code. So, it looks fine here.
Hey Guys, I have been doing my best to resolve this issue I am near about completion just need your support. Could you guys spare some time and help me out here ?
Do you check the InacitivityTimeout of Silverlight? You'd better set InacitivityTimeout of WCF smaller than that of Silverlight, set ReceiveTimeout of WCF bigger than its InactivityTimeout.
Otherwise, if you set InacitivityTimeout of WCF bigger than that of Silverlight, Silverlight InacitivityTimeout expire, Silverlight will close the connection, but WCF does not kown this until SendTimeout of WCF expire.
Best Regards.
Please mark the replies as answers if they help or unmark if not.
Feedback to us
Do you check the InacitivityTimeout of Silverlight? You'd better set InacitivityTimeout of WCF smaller than that of Silverlight, set ReceiveTimeout of WCF bigger than its InactivityTimeout.
Otherwise, if you set InacitivityTimeout of WCF bigger than that of Silverlight, Silverlight InacitivityTimeout expire, Silverlight will close the connection, but WCF does not kown this until SendTimeout of WCF expire.
Best Regards.
Hi,
I think I got confused a bit, Ok, setting WCF InActivityTimeout and ReceiveTimout of WCF means to set it in webConfig (service.model) and in code we are setting it for Silverlight client. I think i didn't wrote any timeout in webConfig.
Ok, setting WCF InActivityTimeout and ReceiveTimout of WCF means to set it in webConfig (service.model) and in code we are setting it for Silverlight client.
Yes, you can set the service timeout in web.config and you can set client timeout either with code or in ServiceReferences.ClientConfig, check a thread:
n00raina
Member
165 Points
120 Posts
How can I increase the timeout in WCF polling application ?
Dec 12, 2012 03:58 AM|LINK
Hello all,
I am creating a Silverlight based chat application using WCF Polling. Everything is working fine people will start chat and send and recieve each others respective messages but the only flaw occurs with inactivity. Lets say if two users have started chatting and stopped for a long time more than 15 min and when they again start chatting netiher will recieve any response. I have added the inactivity timeout and recieve timeout in my web.Config
<system.serviceModel> <extensions> <bindingExtensions> <add name="pollingDuplexHttpBinding" type="System.ServiceModel.Configuration.PollingDuplexHttpBindingCollectionElement,System.ServiceModel.PollingDuplex, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </bindingExtensions> </extensions> <services> <service name="X_OneFront.Web.ChatService"> <endpoint address="" binding="pollingDuplexHttpBinding" bindingConfiguration="myPollingDuplexHttpBinding" contract="X_OneFront.Web.ChatService"/> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> <bindings> <pollingDuplexHttpBinding> <binding name="myPollingDuplexHttpBinding" duplexMode="MultipleMessagesPerPoll" inactivityTimeout="02:00:00" receiveTimeout="02:00:00"/> </pollingDuplexHttpBinding> </bindings> <behaviors> <serviceBehaviors> <behavior name=""> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/> </system.serviceModel>But it is not working as expected. I have added the Inactivity and RecieveTimeout property in my code also wherever i am instantiating the proxy client.
Can anyone tell me how can I accomplish this query ?
senthilwaits
Contributor
3832 Points
651 Posts
Re: How can I increase the timeout in WCF polling application ?
Dec 12, 2012 04:04 AM|LINK
Please refer
http://stackoverflow.com/questions/9249821/set-the-timeout-of-a-callback-in-a-polling-duplex-wcf-service
Senthil Kumar Sundaram
n00raina
Member
165 Points
120 Posts
Re: How can I increase the timeout in WCF polling application ?
Dec 12, 2012 04:26 AM|LINK
Hi, thanks for the reply.
I've already set the inactivity timeout in my code like:
client = new ChatServicePolling.ChatServiceClient( new PollingDuplexHttpBinding(PollingDuplexMode.MultipleMessagesPerPoll) { InactivityTimeout = new TimeSpan(2, 0, 0), ReceiveTimeout = new TimeSpan(2, 0, 0) }, new EndpointAddress("../ChatService.svc")); client.OpenAsync(client); client.OpenCompleted += client_OpenCompleted;Haixia Xie -...
Contributor
3031 Points
296 Posts
Microsoft
Re: How can I increase the timeout in WCF polling application ?
Dec 13, 2012 05:31 AM|LINK
Hi n00raina,
Please inspect the detail error message with fiddler.
And make sure the SendTimeout and RecieveTimeout are big enough.
Best Regards.
Feedback to us
Develop and promote your apps in Windows Store
n00raina
Member
165 Points
120 Posts
Re: How can I increase the timeout in WCF polling application ?
Dec 13, 2012 08:30 AM|LINK
Thanks for the suggestion, I'll get back to you after giving it a try :)
n00raina
Member
165 Points
120 Posts
Re: How can I increase the timeout in WCF polling application ?
Dec 13, 2012 09:11 AM|LINK
Hi, I tried and used following code when instantiating client proxy
client = new ChatServicePolling.ChatServiceClient( new PollingDuplexHttpBinding(PollingDuplexMode.MultipleMessagesPerPoll) { ReceiveTimeout = TimeSpan.FromHours(2), SendTimeout = TimeSpan.FromHours(2) }, new EndpointAddress("../ChatService.svc"));Nothing is getting fetched through fiddler that shows concern. What I did I open a session in Internet Explorer and a new one in Chrome. I started chatting from both browsers, that was fine. I waited for 10-13 min and chat windows were open and again started chatting but either user received no response. I checked though fiddler and the last chat message I sent from IE browser (after waiting 10 - 13 min ) and fiddler showed multiple request-response with 200 status code. So, it looks fine here.
n00raina
Member
165 Points
120 Posts
Re: How can I increase the timeout in WCF polling application ?
Dec 14, 2012 03:53 AM|LINK
Hey Guys, I have been doing my best to resolve this issue I am near about completion just need your support. Could you guys spare some time and help me out here ?
Haixia Xie -...
Contributor
3031 Points
296 Posts
Microsoft
Re: How can I increase the timeout in WCF polling application ?
Dec 14, 2012 05:12 AM|LINK
Hi,
Do you check the InacitivityTimeout of Silverlight? You'd better set InacitivityTimeout of WCF smaller than that of Silverlight, set ReceiveTimeout of WCF bigger than its InactivityTimeout.
Otherwise, if you set InacitivityTimeout of WCF bigger than that of Silverlight, Silverlight InacitivityTimeout expire, Silverlight will close the connection, but WCF does not kown this until SendTimeout of WCF expire.
Best Regards.
Feedback to us
Develop and promote your apps in Windows Store
n00raina
Member
165 Points
120 Posts
Re: How can I increase the timeout in WCF polling application ?
Dec 14, 2012 05:47 AM|LINK
Hi,
I think I got confused a bit, Ok, setting WCF InActivityTimeout and ReceiveTimout of WCF means to set it in webConfig (service.model) and in code we are setting it for Silverlight client. I think i didn't wrote any timeout in webConfig.
But, I tried to set ReceiveTimout here,
<pollingDuplexHttpBinding> <binding name="myPollingDuplexHttpBinding" duplexMode="MultipleMessagesPerPoll" receiveTimout="02:00:00" /> </pollingDuplexHttpBinding>and error arises telling - "Unrecognised attribute receivetimout"
Haixia Xie -...
Contributor
3031 Points
296 Posts
Microsoft
Re: How can I increase the timeout in WCF polling application ?
Dec 14, 2012 08:34 AM|LINK
Yes, you can set the service timeout in web.config and you can set client timeout either with code or in ServiceReferences.ClientConfig, check a thread:
http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/6eb510e8-94ee-4744-88e3-4bef4c6be186
The default value of ReceiveTimout is 10, ReceiveTimeout is not used at Silverlight.
Best Regards.
Feedback to us
Develop and promote your apps in Windows Store